1
\$\begingroup\$

Trying to build a temperature sensor circuit that can be reset to room temp. and then will let you know if the temperature changes using an LED. I want to be able to set several up and see differences in temp around an area.

I am trying to use LM35 sensor with a PIC10 microcontroller and a 3 LED setup:

  • Green LED = set to room temperature
  • Blue LED = decrease in temperature
  • Red LED = increase in temperature

I am having trouble with the circuit to sense and reset to room temperature. I want to hit a reset button or have it set to room temp when you turn it on. I may have to use Arduino for this but I am trying to keep these as small as possible.

I am fairly new to electronics so any input would be appreciated!

\$\endgroup\$
11
  • \$\begingroup\$ Need more information, what are you building this with? FPGA, micro controller? 74series logic? Please provide your attempt with a circuit. \$\endgroup\$
    – Voltage Spike
    Commented Aug 28 at 18:06
  • 1
    \$\begingroup\$ ""LM35 sensor with a PIC10 Micro Controller'" \$\endgroup\$
    – AnalogKid
    Commented Aug 28 at 18:16
  • 1
    \$\begingroup\$ @AnalogKid Typically these questions are open ended, I'm fine with reopening it but we need a question to answer. \$\endgroup\$
    – Voltage Spike
    Commented Aug 28 at 20:15
  • 1
    \$\begingroup\$ @VoltageSpike - Agreed. As you see, I have asked the OP to clarify their specific question. \$\endgroup\$
    – SamGibson
    Commented Aug 28 at 20:18
  • 1
    \$\begingroup\$ you are confusing sensor with controller ... the sensor detects temperature ... the controller receives data from the sensor ... the controller lights LEDs \$\endgroup\$
    – jsotola
    Commented Aug 28 at 22:14

2 Answers 2

1
\$\begingroup\$

Here is a first pass at a circuit. It is very simple because all of the real work is done in firmware inside the PIC.

RA5 is configured as an A/D input. This plus a look-up table in firmware is how all temperatures are captured, stored, compared, etc.

RA3 is the switch input. The PIC can either poll this input or the input can be configured to pull a hardware interrupt. The switch is debounced in firmware.

RA0, RA1, and RA2 drive the three LEDs. Because only one LED is lit at any time, only one current limiting resistor is needed.

C1 and C2 are power supply decoupling caps for U1 and U2. These should be as close as possible to the device power pins.

If you are asking about a circuit external to the PIC that can sample a voltage that is proportional to the current temperature, and then compare that voltage to the sensor output as the temperature changes, that is a very different problem.

It can be done with a sample-and-hold circuit (or IC) and a pair of comparators, but it takes a very high quality capacitor and high-impedance electronics. You don't say how long the circuit has to hold the reference temperature, but the longer the time, the more expensive the cap. Pre- and post- WW II, this was the way these things were done, so there is nothing new there. But it will be much larger, and more complex and expensive than a PIC solution - IF - you have the hardware, software, and coding skills.

UPDATE:

First, as hack says, consider using a thermistor instead of a temperature-sensing IC. In the coding, the only difference is a different set of values in the lookup table. Some thermistors are accurate to 0.1 degree C without calibration.

Also, you don't need a separate input pin for the switch. If the switch is directly the (thermistor) temperature sensor, the uC can see when that analog input goes to 0 V and use the most recent non-zero reading as the new setpoint for the comparisons. This eliminates one resistor and reduces the total number of I/O's to 4, so you can use an even cheaper uC.

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ See update..... \$\endgroup\$
    – AnalogKid
    Commented Aug 29 at 16:34
  • \$\begingroup\$ This is very similar to what I was going to build, so I will try it first. Thanks \$\endgroup\$ Commented Aug 29 at 16:57
1
\$\begingroup\$

If you're interested in detecting a change in temperature, you want to take a derivative of temperature vs. time. That is, compute some delta-temp over a time period (say, several seconds.)

It could be possible to do this in the analog domain using an op-amp differentiator circuit, which computes a derivative, followed by a window comparator to filter it down to three states (increase, no change, decrease.)

But this could also be easily done with a microcontroller that has an ADC, by reading the LM35 output, computing the derivative numerically, then windowing it down to the three states to drive the LEDs.

Side note. I would consider using an NTC instead. They're cheap, reliable and have though-hole leaded versions which would give more mounting options to get the best reading. Example here. Since you don't care about the actual value in degrees Celsius, detecting a change in NTC resistance would be fine for your intended use.

Also, I don't think you need a reset button. Differentiators, be they analog or digital are inherently self-resetting in the absence of a change.

BONUS: An analog heating/cooling detector using op-amps and an NTC (simulate it here):

enter image description here

The first op-amp is the differentiator. The other two are wired up as window comparators, with a polarity swap on the lower one so that we can detect no-change on the green LED.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.