​ ​ ​ IR set 18M2 Clock + Thermometer - Blogs - PICAXE Forum
View RSS Feed


IR set 18M2 Clock + Thermometer

Rate this Entry
Part 3

Continued from Part 2: http://www.picaxeforum.co.uk/entry.p...Y-OLED-display

The little 18M2's have lots of code-space! Surely do not wish to waste any...

I am beginning to think that the AXE133Y OLED serial module is probably the "new" development platform. Instead of blinking LEDs in on-off sequences, one can actually jump-in-the-water and do some "Hello World!" programming and be instantly gratified with on-display text... all very inexpensively. This approach will not give very many I/O lines but when re-purposed there are easily 4 lines available: The original serial input, plus C.0, C.1, and C.2. In the code presented C.0 is being used for a 1-second clock pulse, C.1 is being used for the IR receiver, and C.2 is being used for the thermistor-resistor bridge (10K resistor to +5, resistor + 10K thermistor junction to C.2, and other end of thermistor to GND.) I may use the original serial input line as a battery monitor to detect when the AC fails and the battery goes into operation... one forum member was interested in when the AC mains went down, so I have 16 bytes of EEPROM available still to record events.

This project started simply because I was given an old wall clock with a quartz module capable of being modified to generate a 50ms pulse every second. I added the clock logic in the previous articles and the infrared decoder to be used for setting the clock. The code in this blog incorporates a 10K NTC thermistor and an algorithm plagiarized (respectively) from our senior forum member Peter Anderson in his article: http://www.phanderson.com/picaxe/lin_thermistor.html
The article is titled, "Linearizing an NTC Thermistor to Simplify Calculations" and is well worth your time investment. Due to loop timing constraints, I do not average the AD conversions, rather, I only call the AD routine every 10 seconds to provide a reasonably stable temperature display. It only takes a wee draft to cause the low-mass thermistor to change value. I may epoxy the thermistor to a small aluminum heatsink once the unit is in a permanent enclosure and call the update routine every second since the thermal mass will prevent radical changes in thermistor value.

Please see previous article for an explanation of how un-named memory is used as a dual-line display buffer for the OLED. I have incorporated some ideas, such as the ESC character short-circuiting the spooling of characters to the display controller... however, most of these techniques are NOT utilized and remain untested; placeholders for future testing and evolution.

- Ray

20120102_OLED-18M2_Clock+Therm.bas.txtClick image for larger version. 

Name:	IR Clock Thermo.jpg 
Views:	158 
Size:	133.5 KB 
ID:	10024

Submit "IR set 18M2 Clock + Thermometer" to Digg Submit "IR set 18M2 Clock + Thermometer" to del.icio.us Submit "IR set 18M2 Clock + Thermometer" to StumbleUpon Submit "IR set 18M2 Clock + Thermometer" to Google

Updated 05-01-2012 at 19:37 by mrburnette