Arduino - Control Heating Element
In this tutorial, we are going to learn how to control a Heating Element using Arduino. Based on this tutorial, you will learn how to make a heating system in another tutorial.
Or you can buy the following sensor kit:
|DIYables Sensor Kit 30 types, 69 units
About Heating Element
Heating Element usually has two pins:
- Positive (+) pin (red): needs to be connected to 12V of DC power supply
- Negative (-) pin (black): needs to be connected to GND of DC power supply
How to Control Heating Element
If 12V Heating Element is powered by 12V power supply, it emits heat. To control a Heating Element, we need to use a relay in between Arduino and Heating Element. Arduino can control the Heating Element via the relay. If you do not know about relay (pinout, how it works, how to program ...), learn about relay in the Arduino - Relay tutorial
This image is created using Fritzing. Click to enlarge image
The below code repeatedly turns the Heating Element ON in five seconds and OFF in five seconds,
- Connect Arduino to PC via USB cable
- Open Arduino IDE, select the right board and port
- Copy the above code and open with Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino
- Check the Heating Element's temperature
Please be careful. It can burn you and your house. This is a serious topic, and we want you to be safe. If you’re NOT 100% sure what you are doing, do yourself a favor and don’t touch anything. Ask someone who knows! We do NOT take any responsibility for your safety.
Read the line-by-line explanation in comment lines of code!
We are considering to make the video tutorials. If you think the video tutorials are essential, please subscribe to our YouTube channel to give us motivation for making the videos.