Control a Relay with Arduino according to the Temperature
Control a Relay with Arduino according to the Temperature
Control a Relay with Arduino according to the Temperature
Sometimes it is necessary to check high voltage equipment (such as appliances, lights, etc.) based on values.
Today we will see how to control a Relay, which can turn on other high voltage equipment, via an Arduino card according to the temperature values.
For my tutorial I will use a Dallas Ds18b20 temperature sensor but any sensor will be fine by changing the code appropriately.
What is needed:
- x 1 Ds18b20 temperature sensor.
- x 1 Relay Module.
- x 1 Arduino Card whatever it is.
- Cables for connection.
Assembling
We connect components in this way:
- Temp Vcc Sensor --- Arduino 5V
- Temp GND Sensor --- Arduino GND
- Temp Data Sensor --- Arduino Pin 2
- Relay Vcc --- Arduino 5V
- GND Relay --- Arduino GND
- Signal Relay --- Arduino Pin
Source code
Conclusions
The circuit and the program is very simple, hence it is possible to connect any sensor to control any equipment via the relay, such as a real time clock, you could power of a coffee machine at a specific times etc. Imagination is the limit!
If you have any questions do not hesitate to leave a comment!
Bonjour, j'aimerais faire le même type de configuration mais avec un contrôleur de son.
ReplyDeletePourriez vous m'aider à écrire le code?