Temperature Measurement - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Temperature Measurement

Description:

Status Register (address 378 1): Printer can announce its status ... General information on the LM75. The program code. The main-routine. The While-operation ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 37
Provided by: drandre59
Category:

less

Transcript and Presenter's Notes

Title: Temperature Measurement


1
Temperature Measurement
  • with the LM75 via I2C-Bus-Interface

2
Agenda
  • Overview architecture (Baumgart, Stickdorn)
  • I2C-Bus and LM75 (Carel, Barnefski, Mehlich)
  • The parallel interface (Müller, Böttcher)
  • Programming the parallel interface and the
    C-Programm to control temperature measurement
    (Schmitz, Sprenger, Hoffmann)

3
Index
  • Overview architecture (Baumgart, Stickdorn)
  • I2C-Bus and LM75 (Carel, Barnefski, Mehlich)
  • The parallel interface (Müller, Böttcher)
  • Programming the parallel interface and the
    C-Programm to control temperature measurement
    (Schmitz, Sprenger, Hoffmann)

4
Overview Architecture
  • INTRODUCTION

5
Agenda
  1. Lets get a general idea
  2. I²C-Bus
  3. LM75-board

6
Lets get a general idea
  • Temperature is fed into the PC with help of
    electronic devices.
  • There is a variety of possibilities.
  • We have decided to use the digital temperature
    sensor LM75 and to connect this with the PC via
    parallel interface.

PC
parallel interface
C-program
7
The LM75-Board
  • components
  • --------------------------------------------------
    -------------------------
  • bidirectional printer cable, ...
  • SMD board
  • several SMD chip resistors
  • LM 75
  • SMD LED (Light-Emitting Diode)

8
The Program
  • The data will be processed by the program.
  • Via the parallel port it gets all information.
  • The program is written in the C-programming
    language.

9
Index
  • Overview architecture (Baumgart, Stickdorn)
  • I2C-Bus and LM75 (Carel, Barnefski, Mehlich)
  • The parallel interface (Müller, Böttcher)
  • Programming the parallel interface and the
    C-Programm to control temperature measurement
    (Schmitz, Sprenger, Hoffmann)

10
(No Transcript)
11
The LM75
  • temperature sensor
  • analogue- to digital converter
  • digital over-heating detector
  • I2C interface.
  • The host can query the LM75 at any time to read
    temperature.
  • Over-heating shutdown becomes active when the
    temperature reaches a programmable limit.

12
Specifications
  • There are two types, the first one works with a
    supply voltage of 3.0V, and the second with 5.5V.
  • The maximum current is 1 mA, the typical value is
    250 µA.
  • The LM75 detects the temperature.

13
Connection Diagram
14
Typical Performance Characteristics
15
Functional Description
  • The LM75 temperature sensor contains temperature
    sensor and a 9-bit Analog-to-Digital Converter.
  • The temperature data output of the LM75 is
    available at all times via the I2C bus.
  • The typical sequence is
  1. Stop condition in order to reset the LM75
  2. Start condition start signal
  3. Addressing the LM75 if there are several
    available, selection
  4. First temperature byte with integer part of
    temperature value
  5. Second temperature byte (decimal places)
  6. Stop condition

16
I2C BUS INTERFACE
  • I²C bus means announced Internal Integrated
    Bus.
  • Sometimes it also is called 2 wire bus (mass and
    supply tension not counted).
  • The first pipe is called SDA ( serially data).
    The real data are transmitted serially over these
    line.
  • The second pipe is called SCL ( serially clock).
    The time impulses are sent here.

17
  • Every I²C device can be selected via a 7 bit
    address.
  • The 8th bit indicates reading or writing.
  • Communication always takes place between a master
    and a slave.
  • In our case the PC is the master and the LM75 is
    the slave.
  • It doesnt matter in which interval the transfer
    is done. It may take 7 days to transfer 1 Byte -)

18
Index
  • Overview architecture (Baumgart, Stickdorn)
  • I2C-Bus and LM75 (Carel, Barnefski, Mehlich)
  • The parallel interface (Müller, Böttcher)
  • Programming the parallel interface and the
    C-Programm to control temperature measurement
    (Schmitz, Sprenger, Hoffmann)

19
The Parallel Interface
20
Definition
  • Via the parallel interface the Computer can
    communicate with external devices.
  • Data transmission is done simultaneously (8 bit
    parallel).
  • Often a printer is connected to the parallel
    interface.
  • Sometimes it is called Centronics interface.

21
Advantage Disadavantage
  • Advantage
  • - quick transmission
  • Disadvantage
  • - thick cable with limited length, higher costs

22
The parallel port
Pin Name Direc-tion Function Pin Name Direc-tion Function
1 Strobe ? Strobe 13 SEL ? Select
2 D0 ? Data bit 0 14 AUTOFD ? Autofeed
3 D1 ? Data bit 1 15 ERROR ? Error
4 D2 ? Data bit 2 16 INIT ? Initialize
5 D3 ? Data bit 3 17 SELIN ? SELECT in
6 D4 ? Data bit 4 18 GND - Signal Ground
7 D5 ? Data bit 5 19 GND - Signal Ground
8 D6 ? Data bit 6 20 GND - Signal Ground
9 D7 ? Data bit 7 21 GND - Signal Ground
10 ACK ? Acknowledge 22 GND - Signal Ground
11 BUSY ? Busy 23 GND - Signal Ground
12 PE ? To PAPERS end 24 GND - Signal Ground
25 GND - Signal Ground
All these pins correspond to the registers which
are programmed by our software.
23
Components for parallel interfaces
  • The link between the periphery and the
    microprocessor used in the equipment is a
    component optimized particularly for this
    intended purpose, which mostly is called PIO
    (English parallel input/ output) or
  • PPI (programmable peripheral interface).
  • Components for parallel interfaces are in many
    forms and variants.

24
Handshake
  • Handshake is used to synchronize data
    communication

25
Register Addresses
  • Data-Register (address 378) data output to the
    parallel if
  • Status Register (address 3781) Printer can
    announce its status
  • Control-Register (address 3782) Controls the
    interface

26
Index
  • Overview architecture (Baumgart, Stickdorn)
  • I2C-Bus and LM75 (Carel, Barnefski, Mehlich)
  • The parallel interface (Müller, Böttcher)
  • Programming the parallel interface and the
    C-Programm to control temperature measurement
    (Schmitz, Sprenger, Hoffmann)

27
LM-75
  • Application Software

28
Index of contents
  • General information on the LM75
  • The program code
  • The main-routine
  • The While-operation
  • The temperature
  • Temp. Output

29
General information about LM-75
  • Digital temperature sensor via LPT-interface
  • LM75 measures temperatures in an area from -55C
    to 125C
  • Temperature is retrieved via the parallel
    interface from the LM75 board with our program
  • Code is written in C
  • Base address is 0x378 (hex figure)

30
The Main-Routine
  • Deklaration of the variables
  • Screen-Messages
  • LED is switched off by an out-command
  • out (0x378, 0x00) means the 0-byte is written in
    address 0x378
  • LED is switched on for 3000 ms (sleep command)
  • LED is switched off

31
The while-operation
  • Closed loop so this action is repeated endlessly
  • i2cstop resets the i2c bus
  • i2cstart attention command on the bus
  • the LM75 is adressed with address 10010001
    (0x91)
  • If the LM75 sends ACK, all is ok, otherwise
    (NACK) an error message is printed on the screen.

32
The Temperature
  • The temperature is written in the variable called
    cByte1 (i2clesen command)
  • If its successful, a positive ack is sent back
    to the LPT-interface
  • A second cByte is sent to get the decimal place
  • This is now saved in the cByte 2
  • The i²c sends a not-ok ack back, to stop the data
    transfer

33
Temp. Output
  • Cbyte 1 cbyte 2 are written in the fGradCelsius
    Variable
  • If there isnt any mistake the program prints the
    exact room temperature on the screen.
  • In case of error the program produces an error
    message

34
  • Thank you for your attention

35
  • but his is not the end
  • now it is your turn

36
Installing the Software
  • Install the UserPort.sys driver in the diretory
    windows\system32drivers\
  • Start UserPort
  • Plug in the LM75 board into your parallel
    interface
  • Start lm75.exe
Write a Comment
User Comments (0)
About PowerShow.com