Switching ON/OFF relay using IR temperature sensor and Arduino

I am a beginner and I don’t have any knowledge about writing codes in Arduino. I want to make a project using Arduino in which I have to switch ON/OFF a 12V Relay using Infrared Temperature sensor and MOSFET. The flowchart for my project is as below.

I would be thankful if someone can help me with the circuit diagram (with connections) and Arduino code to run it?

1 Like

Ok, so I am also a beginner but I have some experience making this type of project. I guess you’ll obviously need a temperature sensor from Amazon and probably the relay itself. I’m sure that you’ve already made an LED light blink on and off before. You’re basically going to do the same thing. The temperature sensor is going to be sending data to the Arduino to do whatever it’s programmed to do; so you want the sensor to be an input. Let’s say you used pin 3 for the sensor. So you want to put an If statement. So basically it’ll say if pin 3 is more than 50 then open whatever pin you’ll have the air compressor shutoff on.:+1::+1::+1: