In this post i will show you how to make a Temperature Meter using Bar Graph & Atmega328p. The post will include all the details like circuit diagram, PCB fabrication , Coding, Assembly & Testing. I have also included a video containing all the details.
Step 1: Components
- 1*Bar Graph
- 1*10K Ohm
- 10*220 Ohm
- 1*Terminal Block
- 2*22pf Ceramic Capacitor
- 1*16 MHz Crystal
- 1*Custom Made PCB by JLCPCB.com
- Atmega328p - https://amzn.to/2YOAyk2
- Bar Graph - https://amzn.to/2Ma64Hu
- 16 MHz Crystal - https://amzn.to/2VS266c
- Atmega328p - https://amzn.to/2YLm18q
- Bar Graph - https://amzn.to/2Wlpayd
- 16 MHz Crystal - https://amzn.to/2Erg2hq
- Atmega328p - http://s.click.aliexpress.com/e/cpGPZBZI
- Bar Graph - http://s.click.aliexpress.com/e/bgbq8NP2
- 16 MHz Crystal - http://s.click.aliexpress.com/e/bpqjFRKC
Step 2: Circuit Diagram, PCB Layout & Sketch
The circuit was designed in KiCad. After designing the circuit i designed the PCB layout & generated the Gerber & Drill File. Then uploaded a Zip folder containing all the Gerber & Drill file in JLCPCB.com website for fabrication (Who offered 5 PCB's for 2$ with one day shipping).
The sketch which i used is a very basic sketch which can easily understood. The first part of the sketch (highlighted in yellow) is used to declare & initialize the variables. Next Line which is highlighted is to get the analog value from the LM35. The next two line is used to convert the analog value to Celsius (to know more about the formula please click here). I have also included a line which you can use if you want the value in Fahrenheit. The last part of the code is simple if statement used to turn on and off of the Bar Graph based on the temperature.
Step 3: Construction & Testing
After receiving the board from JLCPCB.com i assembled the board & connected it to a 5V DC power supply. The Atmega328 was programmed before hand. If you are not familiar on how to program Atmega328p then you can refer this video. Please note this device is programmed to show the temperature from 25'C to 34'C. I have also included the comparison of the two design showing the temperature.
Thank you reading. Please subscribe to my YouTube channel for more such content.
This is an entry in the
Colors of the Rainbow Contest