Non-contact Forehead Infrared Thermometer - Part 4

Published


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.

Non-contact Forehead IR Thermometer ICSP Header
USBaspIR Thermometer PCB ICSP Header
5VVCC
MISOMISO
SCKSCK
MOSIMOSI
SSSS
GNDGND
Arduino Uno (as ArduinoISP)IR Thermometer PCB ICSP Header
5VVCC
D12MISO
D13SCK
D11MOSI
D10SS
GndGND

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.

Arduino Uno Burn Bootloader

Then you can upload the code by clicking Upload Using Programming under the Sketch menu.

Arduino IDE Upload Using Programmer

PCB Design

Non-Contact Forehead IR Thermometer PCB
Non-Contact Forehead IR Thermometer PCB
Non-Contact Forehead IR Thermometer Power Supply PCB
Non-Contact Forehead IR Thermometer Power Supply PCB

Actual PCB Images

IR Thermometer & Power Supply PCBs Top
IR Thermometer & Power Supply PCBs Bottom

Assembled PCB

Power Supply PCB Bottom
Power Supply PCB Top
IR Thermometer PCB Bottom
IR Thermometer PCB Top
IR Thermometer PCB Top Sensors Connected
IR Thermometer PCBs Assembled Side View
IR Thermometer PCBs Assembled Left Side
IR Thermometer PCBs Assembled Right Side
IR Thermometer PCBs Assembled Front

Bill of Materials

PartEstimated Cost
1. GY906~$9.00
2. ATmega328P-PU~$2.25
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

Non-contact Forehead IR Thermometer Hardware Initialization
Non-contact Forehead IR Thermometer Hardware Initialization
Low Power Mode After Startup
Low Power Mode After Startup
Scanning Temperature
Scanning Temperature
Low Power Mode After Scanning Temperature
Low Power Mode After Scanning Temperature
Exit display_Ambient_and_Object_Temperature_on_OLED() Function
Exit display_Ambient_and_Object_Temperature_on_OLED() Function
Non-contact Forehead IR Thermometer Current Consumption [5V Power Supply]
Non-contact Forehead IR Thermometer Current Consumption [5V Power Supply]
Non-contact Forehead IR Thermometer Low Power Mode Current Consumption [5V Power Supply]
Non-contact Forehead IR Thermometer Low Power Mode Current Consumption [5V Power Supply]

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.

Make Bread with our CircuitBread Toaster!

Get the latest tools and tutorials, fresh from the toaster.

What are you looking for?