Simple Temperature Comprator Using LM35 and ATtiny13A

by RinTECH in Circuits > Microcontrollers

254 Views, 1 Favorites, 0 Comments

Simple Temperature Comprator Using LM35 and ATtiny13A

cover.png

Because summer is really hot nowadays, I have windows opened the whole night. But in the morning I usually forget to shut them, letting the hot air get in. So I've decied to build this simple temperature comparator to remind me of closing windows if it's hotter outside. But I don't stop you here, you can use it for whatever you want!

Supplies

Components:

  • ATtiny13 or 13A (or if you're more advenced in microcontrollers you can choose other)
  • LED diode with matching resistor or a buzzer
  • 2 LM35s
  • ON/OFF switch
  • some cables to connect everything together or a PCB
  • few meters of wire for the LM35s
  • 2 AA batteries with a basket and 5V boost converter or other 5V power supply

Tools:

  • soldering iron
  • solder wire
  • pliers/wire cutters
  • some glue if needed
  • laptop/computer
  • programmer

Programming the Chip

Zrzut ekranu 2023-07-11 194618.png
Zrzut ekranu 2023-07-11 195210.png

With your computer and a programmer download the code to a chip. You can select from an Arduino sketch or already compiled .hex file for more advanced users.

[To people using .hex file: the fuses can remain default]

Personally I loaded it using XGecu T48 and matching software (Xgpro), but you can use USBASP, Arduino as ISP, etc.

If you are new to this topic, there are many Instructables showing how to succeed in this.

Solder Everything Together

schematic.png
attiny13a-pinouts.jpg
Zrzut ekranu 2023-07-11 200959.png

With your soldering iron connect everything according to this diagram. I used ATtiny in SOIC8 but you can use the one with a DIP package - it's easier to solder. On the schematic Vcc and GND are the red and black wires of the batteries' basket. The LM35s are connected using the "few meters of wire" mentioned earlier, but you can connect them as you like. Instead of an LED signaling the "alarm" you can use a buzzer or other device like a relay turning something ON/OFF. The output pin is just a regular HIGH/LOW pin so the possibilities are endless.

Assembling the Hardware and Electronics

20230711_191830.jpg

Connect the electronics with batteries' basket or the power supply using glue or screws or anyway you like. You can give it a form as you like.

Mine looks like shown on a picture above

Enjoy!