Monday, 6 May 2013

Digital Thermometer

This entry is to log the development of the Digital Thermometer Arduino Project.

 #Current version (v3.5)

Figure 1. Top down view of digital thermometer

Figure 2. Side view of Digital Thermometer

#Patch Notes below

//LM35 Temperature Sensor
//v1.0 (1/5/2013)
//+ using EEPROM to store data and serial monitor to display data
//- data stored in form of integers not floating point
//v1.1 (2/5/2013)
//+ added user defined symbol
//v1.2 (3/5/2013)
//+ added timer1 interrupt every .5sec to blink user defined symbol
//+ added extra button to display previously recorded temperature
//- previously recorded temp only shows once and cannot be removed
//v2.0 (4/5/2013)
//+ previously recorded temp can now be removed and constantly 
//  updates itself when activated.
//+ button connected to external interrupt to allow higher
//  responsiveness to button press
//+ allows read from EEPROM or sensor or stop reading from any
//  source.
//+ write to EEPROM now activated by switch and can be stopped at
//  any time. When activated again, continues to the next address
//* future improvements will be focused on the sensitivity of the
//  sensor and EEPROM storage capabilities. Additional features 
//  are constrained by lack of I/O pins.
//Note: (4/5/2013)
//System stability compromised. System increasingly buggish
//v2.1 (4/5/2013)
//* removed user defined graphics due to bug
//* sysmtem stability compromised by timer interrupt 
//v2.2 (5/5/2013)
//+ EEPROM successfully configured to take record every 30 minutes
//+ EEPROM read now stops when the address being read contains no
//  data to improve read time
//+ Added 2nd potentiometer support for backlight brightness, 
//  brightness can now be tuned on the go.
//v3.0 (6/5/2013)
//+ reading are now passed through an averager to obtain a more 
//  accurate and precise reading which also eliminates some 
//  fluctuations

//v3.5 (7/5/2013)
//+ EEPROM is now checked at the beginning to see if there is any 
//  data in the memory cells. If there is, lcd will show a mem full
//  indication.
//+ EEPROM read through serial monitor now shows a more detailed
//  explanation on the reading. Since readings taken every 30 minutes
//  EEPROM read now shows the total time elapsed where EEPROM is
//  written to.

##Next improvement to allow user to set recording period for EEPROM eg 20 minutes
    1 hour, 2 hours and so on. 
##Project is still Work In Progress [WIP]

#User guide for possible serial monitor command


#User Guide
|  R/r - read from EEPROM             |
|  C/c - clear EEPROM                     |
|  E/e - read data from sensor           |
|  S/s - stops data read from sensor  |

#Serial Monitor Images

Figure 3. Using the C/c command allows the user to clear all the EEPROM memory cells (as shown on line 3) while using the E/e command allows user to read the real time temperature(as shown starting from line 4)
Figure 4.  Using the S/s command allows user to stop real time temperature reading
Figure 5. Using the R/r command allow user to read the EEPROM memory. Read stops when there are no more data to read. It also tell user the total time taken to take all the readings
Figure 6. This is purely simulation to show the user what happens if all memory cells in EEPROM are used and read.
Please ignore the total time as the timing algorithm is changed for this simulation
Figure 7. Another simulation to show what happens when reading from empty EEPROM memory cells

#Source Code

*Due to long source code, source code is not posted but moved to the link below.
Digital Thermometer v3.5
*Additional Info
  1. Active low switch for toggling previous temperature display 
This switch is connected to pin 2 of the Arduino which has an external interrupt function. (INT0)
Since it is active low, interrupt is toggled on the falling edge of a pulse as illustrated in figure 4.
Figure 8. Active low switch 
Figure 9. Active low interrupt trigger

  2.   EEPROM switch

The EEPROM switch allows the user to turn EEPROM write on/off as he pleases. EEPROM write will write to any available memory cells until all cells are filled with data. This can be done by sliding the switch to the left which closes the circuit between the positive terminal of the battery pac and the input pin. 

*However, this is still not a matured function as the device does not automatically checks whether the EEPROM is full when it is in reset mode. This will cause the EEPROM memory cells to be overwritten.
# This problem will be looked in the next update

EEPROM memory cell data can be read from the serial monitor by referring to the suitable commands to use on the serial monitor.

Figure 10. EEPROM write mode switch
3. Potentiometers for contrast and brightness.

Figure 11. Overall connection of the device without the LM35 sensor ( noticed that battery pack removed since arduino can provide supply voltages through supply voltage pins )

4.  LM35 Temperature sensor

Figure12. Overall Connection with LM35 Temperature Sensor
The most detailed LM35 datasheet as of current findings (6/5/2013) :

5.  Bill Of Materials (BOM) - 6/5/2013 - May be subjected to change

Core Materials:
1 x Arduino board (UNO equivalent used here ) - RM72 ( this can be reused for other projects )
1 x LM35 Temperature Sensor - RM8
1 x 16x2 LCD (blue backlight) - RM18
2 x 10k potentiometers - RM1.20 each, total - RM2.40
1 x 10k (0.25Watt) resistor - RM0.05
1 x 1k (0.25Watt) resistor - RM0.05
1 x slide switch - RM0.90
1 x (6x6x1) push button - RM0.50

1 set Male to Male jumper wires - RM12 ( this can also be reused )

Total = RM 113.90

*keep in mind that the Arduino board is mainly used for rapid prototyping, at the end, the project may be replaced by a cheaper equivalent.

Total cost without factoring Arduino and jumper wires : RM29.90 ~ RM30

No comments:

Post a Comment