Visit Us On FacebookVisit Us On TwitterVisit Us On Google PlusVisit Us On LinkedinVisit Us On YoutubeCheck Our Feed

Thermometer V2.0

Angle ViewFront ViewSide view

 

ThermometerV2.0 is coming to replace in hardware and software V1.0.

Introduction

I designed this version in the need of a thermometer for my room, built in a small pack and easy to control. The hardware is designed on a way so that the pcb can be wall mounted. At the top side of the device the PCB extents giving space for two keyhole type holes which are able to keep the device mounted on the wall. The LCD display plugs at the front side of the PCB, covering all the electronic components and giving a compact design view. The user can interact with the device using the left side switch button. The design includes a 6-pin header which gives connectivity for UART (RX,TX,GND) and for the external sensor DHT-11 (VCC,GND,DATA). Also there is an ISP-6 pin header which gives the option of on board programming. Finally there is an optional Bluetooth plug on the back side connected with AVRs UART for possible communication to other devices like mobile phones, home automation devices, pc's or whatever you imagine.

The code is written in C and is well performed in a readable way so anybody can read and modify it. For the LCD driving i have used Peter Fleury's library.

Function Modes

Display modes:
 1)Celsius
 2)Fahrenheit

Backlight modes:
 1)Fast mode (press the button, light on, 2 seconds delay, light off)
 2)Light switched off
 3)Light switched on

Hardware description:

The power supply

The power supply is a basic LM7805 power supply using two pair's of decoupling capacitors before and after the regulator. Additionaly can be used the AMS1117 regulator at 3.3V. This regulator is included in the design to give the option of using a Bluetooth module which usually work at 3.3V.

The LCD HD44780 16×2 Char

A 16×2 character LCD display is used to display data to user. The only thing that somebody may not understand here is the use of BC547. BC547 is used as a switch to switch on/off LCD's back light or to pulse it using PWM adjusting the back light lightness and giving nice fading options. R3 is used to limit the current flow to transistors base, and R1 is there to pull down base voltage.

Main Brain Atmega8

The main brain of this device is Atmega8.

Note. A 16Mhz crystal has been used instead of 8Mhz shown on the schematic in order to read DHT data easier.

Peripherals

Above are the peripherals used. From left to right,

  • The Bluetooth module, this module is optional. It is connected to avr's uart so everything in UART can be sent via Bluetooth. For example it can send the sensor reading on a pc, a mobile phone, e web server.
  • The DHT-11 sensor is used for outside humidity and temperature measurement. It has a 5k pull up resistor to Data pin to pull data bus to VCC and a 100nF decoupling capacitor to filter noise
  • Including an ISP header on the design makes it easy to update the software and debug on board.
  • For inside temperature sensing has been used the LM35.
  • A button is used to interact with the user. This button is pulled up with avr's internal pull up resistor and is connected to INT0 interrupt pin.
  • Also there is a UART pin header for optional module installation or for serial connection to PC.

More photos:

The PCB Board:

Pcb Board Front Side Pcb Board Back Side

From Design to reality

PCB Design Pcb Board Front Side Soldered

The back side of the PCB and all the parts nedded for this project.

Pcb Board Back Side All components for this project

While testing the Hardware and the Software on breadboard proto.

The final device view.

 

Sending sensor readings over Bluetooth.

 

The source code can be found here:

DOWNLOAD HERE

 

Thermometer V1.0

Digital Thermometer BreadBoard testing

Thermometer V1.0 was built at my very first steps on microcontrollers and generally in electronics about 2008. Then i was still writing embedded software in assembly as a starter. It was a big challenge for me to drive the HD44780 LCD Display and the ADC of the Atmega8 using assembly. I remember, i was writing and testing about a month to make it work. Searching for bugs on both hardware and software. By the way when you develop both sides hardware and software, debugging is the most difficult thing. Υou don't know where to start from, searching for bugs, software or hardware? I also had came across with the problem of making a division and that wasn't that easy. I had to write a whole function to do it (in C you can just write the symbol / and division is done). In assembly if the division is by 2 you can easily shift the value right but if it isn't what you can do?

This project wasn't something admirable but it was much a lesson for me. I learnt a lot of things from this like writing assembly, learning how the LCD  works and how to drive it with the correct timing! Every difficulty you come across is a lesson for you!. Of course when i saw it working (on breadboard) i felt so happy like a kid.

I also remember a classmate of mine sawing him the code and talking about how many hours it took to me to make this thing work and him telling to me "Oh that's what you made? this is very easy… I made the same thing in about half an hour". When i asked him how he did it, he revealed me that he had just copied some C code (about 20 lines) of a book he found when mine was about 600lines and i knew where is each word in the code. Well the answer is yours… You can make things the easy way but you have to know that someone else had worked for you to make these things easy for you and he is the one who has learned the more! If you want to learn don't choose every time the easy way.

Well here i post some photos of the circuit. It was my first homemade double side pcb using short wires for vias and soldering components in both sides which finally didn't work :P. For a reason i don't know i have lost the Eagle Schematic and Board Layout. I have only the code and the photos. So i post what i have.

As i remember i have used ATmega8, LM35 and HD44780 LCD Display. Also LM7805 has been used for power supply.

 

Digital Thermometer Digital Thermometer

Digital Thermometer Digital Thermometer

The Assembly code can be downloaded at the following link

DOWNLOAD HERE