Non-contact Forehead Infrared Thermometer - Part 4New
So we are almost done with this project/tutorial. In the previous part, we’ve discussed the software or code of the non-contact forehead IR thermometer. This time, we are going to discuss how to program the MCU of the thermometer. We’re also going to show the assembled thermometer and demonstrate how it works.
Programming the ATmega328-PU
If you’re going to use an Arduino Uno board, you can connect it to the computer using a USB printer cable. Then you can just copy the code, paste it into the Arduino IDE, click the Verify button, then upload the code by clicking the Upload button. However, since we’re using a standalone or minimal Arduino Uno from a fresh factory MCU, we need to set the fuse bits of the MCU first.
The easiest way to do this is to burn the Arduino Uno bootloader using an external programmer. You can also use an Arduino Uno board to burn the bootloader to an ATmega328P-PU chip. You just need to upload the ArduinoISP sketch to the Arduino Uno board and then connect the Arduino Uno to the ATmega328P-PU through the ICSP pins. I used a USBasp to burn the bootloader and upload the code to the ATmega328P-PU MCU.
|USBasp||IR Thermometer PCB ICSP Header|
|Arduino Uno (as ArduinoISP)||IR Thermometer PCB ICSP Header|
As you can see in the image above, there’s an ICSP header on the thermometer PCB. You can connect the USBasp or other AVR external programmer to that header to burn the bootloader and the code. After connecting to the header, you can burn the burn bootloader by clicking the Burn Bootloader under Tools in the Arduino IDE. Just make sure you have selected the right Board (Arduino Uno) and Programmer (USBasp or other programmer) under the Tools menu.
Then you can upload the code by clicking Upload Using Programming under the Sketch menu.
Actual PCB Images
Bill of Materials
|3. 28-pin IC Socket||~$0.13|
|4. 2pcs. 0.1uF Ceramic Capacitors||~$0.04|
|5. 16MHz Crystal||~$0.24|
|6. 2pcs. 22pF Ceramic Capacitors||~$0.04|
|7. 3pcs. 10kΩ Resistor||~$0.03|
|8. 0.96" 128x64 I2C SSD1306 OLED Display||~$3.58|
|9. HC-SR04 Ultrasonic Sensor||~$1.28|
|10. AM312 PIR Motion Sensor||~$1.30|
|11. 2pcs. 5V Buzzers||~$0.49|
|12. 2pcs. 2N3904||~$0.03|
|13. 2pcs. 1kΩ Resistors||~$0.02|
|14. Red LED||~$0.02|
|15. 2.2kΩ Resistor||~$0.01|
|16. Green LED||~$0.02|
|17. 47kΩ Resistor||~$0.01|
|18. 2pcs AAA Battery Holders||~$0.48|
|19. 1-5V to 5V Boost Converter||~$0.49|
|20. microUSB Breakout Board||~$0.12|
|21. Male and Female Headers||~$2.00|
|22. PCB Standoff||~$3.35|
|23. PCBs||$9.80 (Shipping fee not included. 5pcs 2 PCB designs. Ordered from Elecrow.)|
|Estimated Total Cost||~$34.73|
Testing the Thermometer
So I think we've already discussed everything. I hope you find this project/tutorial interesting and helpful in case you want to build your own non-contact IR thermometer. Just a reminder, make sure that you calibrate the thermometer well so that you can get an accurate reading of the body temperature. Also, in case the reading exceeds 37.5, use a tympanic or other contact thermometers to double check the temperature. If you have any questions, comments, or suggestions, please feel free to leave a comment below or contact us.
Get the latest tools and tutorials, fresh from the toaster.