14
TEMPERATURE DATA LOGGER

basics of temperature data logger (with energia and stellaris)

Embed Size (px)

Citation preview

Page 1: basics of  temperature data logger (with energia and stellaris)

TEMPERATURE

DATA

LOGGER

Page 2: basics of  temperature data logger (with energia and stellaris)

HARDWARE• STELLARIS (ARM CORTEX M-4 , LM4F120)

• LM 35 (ANALOG TEMPERATURE SENSOR)

• DS1307 (REAL Time clock)

• Energia compiler

SOFTWARE

Page 3: basics of  temperature data logger (with energia and stellaris)

LM 35

• Analog temperature sensor

• It has an output voltage that is proportional to the Celsius temperature.

• The scale factor is .01V/oC

• The output voltage is converted to temperature by a simple conversion factor.

Page 4: basics of  temperature data logger (with energia and stellaris)

• Conversion factor that is the reciprocal, that is 100 oC/V.

• The general equation used to convert output voltage to temperature is:

Temperature (oC) = Vout * (100 oC/V)

Page 5: basics of  temperature data logger (with energia and stellaris)

DS 1307 (RTC)

Real Time Clock IC

I2C communication (SCL , SDA)

SDA = Serial Data Line

SCL = Serial Clock Line

Page 6: basics of  temperature data logger (with energia and stellaris)

Masters and Slaves :

The devices on the I2C bus are either masters or slaves. The master is always the device that drives the SCL clock line. The slaves are the devices that respond to the master.

Slave is DS1307 , Master Stellaris in our case.

Master must know the Slave address ( 0x68 for DS1307)

Page 7: basics of  temperature data logger (with energia and stellaris)

RTC - Ram Address Map And Time Keeper Registers :

Page 8: basics of  temperature data logger (with energia and stellaris)

Circuit of RTC :

Page 9: basics of  temperature data logger (with energia and stellaris)

ENERGIA COMPILER AND STELLARIS

Energia is an open-source electronics prototyping platform for MSP-EXP430G2, MSP-EXP430FR5739 and Stellaris EK-LM4F120XL LaunchPads.

Energia uses the mspgcc compiler ,is based on the Wiring and Arduino framework.

It has a lot of libraries including «Wire» library which is for I2C operations.

Page 10: basics of  temperature data logger (with energia and stellaris)

Some «wire» functions : Wire. Begin() ; Initiate the Wire library and join the I2C bus

as a master or slave. Wire.setModule (x) ; Choose one of the I2C pairs. Wire.beginTransmission(ds1307_address) : begins the I2C

transmission Wire.endTransmission(); Finishes the transmission

between master and slave. Wire.write() ; Writes the data that will be transmitted to

slave. Wire.write(zero) ; Stop/start the oscillator Wire.read() : Read data from slave Wire.requestFrom(ds1307_address,7); Used by the master

to request bytes from a slave device. 7 is the number of bytes requested from slave. (total bytes of second,minute,hour,weekday,week,mounthday,mounth and year is 7 .That’s why ,7 is used in the project)

Page 11: basics of  temperature data logger (with energia and stellaris)

In our project ; First operation ; time must be set (initialization)1. Transmission is started

2. Oscillator is stopped

3. Second ,minute,hour ,weekday,mounthday,mounth ,year are sent as bytes sequentially ( because, each related address is 1 byte in the RTC)

4. Oscillator is started

5. Transmission is finished.

Page 12: basics of  temperature data logger (with energia and stellaris)

Reading from slave (RTC)

1. Transmission is started2. Oscillator is stopped3. Data requested from Slave 4. Second ,minute,hour ,weekday,mounthday,mounth

,year are read from slave sequentially

Reading LM35

1. Volt is read from lm35 with analogRead() function2. Convertion :

temperature = ((5.0 * volt )/8192.0) *100

(Remember : Temperature (oC) = Vout * (100 oC/V))

Page 13: basics of  temperature data logger (with energia and stellaris)

Last words …

In the project , a time interval is decided, then ,temperature data and time value is read continuously (polling method) . When the time comes , temperature and time is written to the serial monitor.

Page 14: basics of  temperature data logger (with energia and stellaris)