Showing posts with label thermometer. Show all posts
Showing posts with label thermometer. Show all posts

Tuesday, 17 July 2012

Frankenstein's Thermometer Mk2

Well it's been just over a year since this blog started and what better way to celebrate than revising an old project? I'd had a look at Frankenstein's thermometer before, using a neat trick with a mono jack plug and a stereo socket to switch the power. However I wasn't really pleased with this arrangement, because it separated the thermistor from the main box when it wasn't in use.

The idea was to upgrade the firmware to put the ATtiny into deep sleep after a short time. The complete code is now:

The main additions are:
  • the sleep() routine which causes the ATtiny to enter a power-down mode,
  • the PCINT1_vect which wakes it up again when the push-button is pressed.
The port PB1, which the push-button connects to ground, generates PCINT9. On the ATtiny84, there are two pin-change interrupts, PCINT0 and PCINT1. The former handles pin change signals on Port A, while the latter handles those from Port B. Our handler simply checks whether the interrupt has woken us up, or was to change the units of temperature.

The sleep routine switches off all of the LEDs and the ADC before putting the ATtiny to sleep. When it wakes up again, the ADC must be re-enabled.

With the new software installed,  the device consumes about 11mA when on but 0.16mA when off. With a nominal capacity of 1000mAh, this would drain the batteries in about 6000 hours (or 250 days). This was a bit surprising, as was the discovery that this current was still drawn when the AVR was removed altogether. This indicated that the source of the drain was the voltage divider comprising the thermistor and a 10k resistor. (See the circuit diagram in the original posting.) At room temperature, the current drawn would be 3v/20k or 0.15mA.

Rather than complicate the circuit with a MOSFET switch, we decided simply to increase the value of the bias resistor from 10k to 47k. This reduced the current by a factor of 4 increasing the battery life to over 2 years. (The calculation of the Thermistor equation has been cleaned up a bit too: the original made the assumption that the 10k resistor would cancel the thermistor's resistance at 25C.)

Wednesday, 25 May 2011

Frankenstein's Thermometer, redux

Finally managed to find a diagramming program I didn't dislike: a freeware version of Eagle. It produced the following circuit diagram for the thermometer:

There's not too much to say about that circuit, except that an ATtiny24 probably doesn't have enough storage to run the program. I used an -84. (Note that I don't think that arduino-tiny supports -44 chips yet.)



Here's a picture of the finished "product" in mid-measure:

It runs on two AAA batteries.

Thursday, 5 May 2011

Frankenstein's Thermometer

Not much more complicated than the simplest thing you can do with an Arduino is measure and display temperature. The picture shows such a device at the embryo stage.

The parts' list for this is:
  • 3x10k
  • 10k NTC thermistor (beta = 3977)
  • 100nF ceramic capacitor
  • 7x470R
  • Pushbutton switch
  • 7-segment LED display (common cathode)
The measurement is performed by a 10k resistor and the thermistor at the top of the picture. This is read by the Arduino on A5 and converted using the thermistor equation.

Each digit of the result is output on digital pins 2-8 in turn. A resistor is required for each segment of the display because otherwise the total current through the display would have to be shared between all of the lit segments; use whichever resistor-decade you have most of.

Finally, digital pin 9 is used to sense the state of the pushbutton. This allows cycling between centigrade, fahrenheit and the absolute temperature scale.

This circuit can be powered by 3v and draws between 15 and 30mA, depending on the digit displayed, indicating that the display is consuming the majority of the power. Thus, a couple of alkaline AAA cells would power this circuit for about 3 days.

If the thermistor is disconnected entirely, it displays -273C, which is nice.

Fritzing is here.