To control Relay to turn it high/low using MLX90614 Temperature sensor & Arduino

Hello Everyone,

I am preparing one project in which I have to first read temperature using IR temperature sensor (MLX90614) and then based on the reading and set threshold value, I have to switch the relay ON/OFF which in turn will control the Solenoid Valve for water flow.

I have attached the project flowchart.

Can someone please help me in writing the Arduino code for the same. I have already prepared model using IR temperature sensor and it works. I need help in preparing the sketch and code to switch relay ON/OFF according to attached flowchart.

I am not good in programming and writing codes and I am not able to move ahead. I know it is easy for someone who know how to write codes in Arduino. Can I get some help, please.

I am sorry for that. Thanks for saving my life from span emails.