Arduino Nano 33 IoT - Control Heating Element
This guide shows you how to use the Arduino Nano 33 IoT to control a heating element. In another guide, you will learn how to build a heating system.

Hardware Preparation
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of Heating Element
Pinout

A heating element normally has two pins.
- The red positive (+) pin should go to the 12V of the DC power supply.
- The black negative (-) pin should go to the ground (GND) of the DC power supply.
How to Control Heating Element
A 12V heating element warms up when it gets power from a 12V supply. To control the heating element, use a relay between the Arduino Nano 33 IoT and the heating element. The Arduino Nano 33 IoT sends signals to the relay, which then turns the heating element on or off. If you are not familiar with relays (what pins they use, how they work, how to program them, etc.), learn more in the Arduino Nano 33 IoT - Relay tutorial tutorial.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
Arduino Nano 33 IoT Code
This code repeatedly turns the heating element on for five seconds and then off for five seconds.
Detailed Instructions
If you are new to the Arduino Nano 33 IoT, be sure to check out our Getting Started with Arduino Nano 33 IoT tutorial. Then, follow these steps:
- Connect the components to the Arduino Nano 33 IoT board as depicted in the diagram.
- Use a USB cable to connect the Arduino Nano 33 IoT board to your computer.
- Launch the Arduino IDE on your computer.
- Select the Arduino Nano 33 IoT board and choose its corresponding COM port.
- Copy the code provided above and paste it into the Arduino software.
- Click the Upload button to compile and send the code to your Arduino Nano 33 IoT board.
- Look at the temperature of the heating element.
WARNING
Be careful. It can burn you and your home. This is very serious, and we want you to be safe. If you are not 100% sure about what you are doing, please do not touch anything. Ask someone who understands. We are not responsible for your safety.
Code Explanation
The Arduino Nano 33 IoT code above has an explanation for each line. Please read the comments in the code!