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.

Arduino Nano 33 IoT Heating Element

Hardware Preparation

1×Arduino Nano 33 IoT
1×Micro USB Cable
1×Relay
1×Heating Element
1×12V Power Adapter
1×Optionally, DC Power Jack
1×Breadboard
1×Jumper Wires
1×Recommended: Screw Terminal Expansion Board for Arduino Nano
1×Recommended: Breakout Expansion Board for Arduino Nano
1×Recommended: Power Splitter for Arduino Nano

Or you can buy the following sensor kits:

1×DIYables Sensor Kit (30 sensors/displays)
1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of Heating Element

Pinout

Arduino Nano 33 IoT 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

The wiring diagram between Arduino Nano and 33 IoT Heating Element

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.

/* * This Arduino Nano 33 IoT code was developed by newbiely.com * * This Arduino Nano 33 IoT code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-nano-iot/arduino-nano-33-iot-controls-heating-element */ #define RELAY_PIN 2 // The Arduino Nano 33 IoT pin connected to the heating element via the relay // The setup function runs once on reset or power-up void setup() { // initialize digital pin D2 as an output. pinMode(RELAY_PIN, OUTPUT); } // The loop function repeats indefinitely void loop() { digitalWrite(RELAY_PIN, HIGH); // turn on heating element 5 seconds delay(5000); digitalWrite(RELAY_PIN, LOW); // turn off heating element 5 seconds delay(5000); }

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!

Video Tutorial

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!