Introduction:
Smart Heater made with Arduino IoT Cloud, can be controlled with Amazon Alexa using the Arduino Alexa skill. It utilizes relays to "hack" the buttons on the remote (I used relays because I wanted to use the MKR IoT Carrier) but it can be achieved with opto-isolators/optocouplers too. It utilizes Arduino IoT Cloud to interact with an Amazon Alexa device. The tutorial below will show you how to create and adapt this project. I find a delay of 100 milliseconds works best for how long to activate the relay, it doesn't go too fast so the relay won't get burned out and the remote will also receive the message.
Video tutorial found here:
IoT Retrofitting: The Alexa-Enabled Heater
The Fully Alexa Controlled Smart Heater is a professional-grade "Hardware Hack" that brings modern voice control to traditional appliances. Instead of using generic smart plugs—which can handle power but can't change specific heater settings—this project uses the Arduino Oplà IoT Kit to physically simulate button presses on the heater's native remote. This allows you to control Heat Modes, Timer Settings, and Power States entirely via voice commands to your Amazon Alexa device.
The Engineering "Hack": Relay Simulation
The core of the project is the interface between the MKR IoT Carrier and the heater's circuitry:
- Direct Button Interfacing: By soldering thin wires to the diagonal terminals of the remote's momentary switches, you gain electrical access to the heater's logic.
- The Relay Bridge: These wires are then connected to the COM (Common) and NC (Normally Closed) terminals of the Oplà's built-in relays.
- Timing Logic: The Arduino is programmed to "Pulse" the relay for exactly 100ms. This simulates a human finger press perfectly, triggering the remote's transmitter without burning out the relay or stalling the heater's input.
Project Tutorial:
Step 1, Configuring IoT Cloud:
Add these variables (all variables will appear as "devices" to Alexa, but they don't have to be) to IoT Cloud you may have to adapt these to your needs and change the code too:
- Variable name: Heater, Variable type: Cloud Switch (Alexa Compatible), Variable Update Policy: On Change, Purpose: Use this variable to turn heater on and off.
- Variable name: high_power_mode, Variable type: Cloud Switch (Alexa Compatible), Variable Update Policy: On Change, Purpose: Use this variable to toggle the Heater Mode.
- Variable name: low_power_mode, Variable type: Cloud Switch (Alexa Compatible), Variable Update Policy: On Change, Purpose: Use this variable to toggle the Heater Mode.
My heater has toggle switches so you might need to adapt this for other kinds of remote controls.
Cloud Integration: Alexa Compatibility
The software lives in the Arduino IoT Cloud, using prioritized variables that Alexa recognizes instantly:
- Cloud Switches: Three primary switches are created: "Heater," "High Power Mode," and "Low Power Mode."
- Naming Constraints: A crucial discovery noted in the project is that Alexa does not understand underscores. The variables must be renamed in the Alexa app (e.g., from
high_power_modeto "High Power Mode") for voice recognition to work reliably. - Variable Synchronization: The code includes logic to ensure that if you turn "High Power" on, the "Low Power" variable is automatically updated to off, preventing internal conflicts within the heater's state.
Step 2, Create the Circuit:
Once you open up your remote, it might be a pcb with momentary switches like mine or it might have a forked pattern of metal the gets connected when someone pushes the button because the button has a conductive material on the back, in the first case solder two wires on the two diagonal terminals of the button. In the second case solder the two wires on both sides of the forked pattern. Then attach the on of the wires to the COM (common) terminal on the relay connecter on the Arduino Opla, it should lock in. Now insert the the second one into the NC (normally closed) terminal, it should also lock in. This will allow us to connect and disconnect the two wires, activating and deactivating the switch. For anyone who doesn't know how a relay works it uses an electromagnet to connect the COM terminal to the NC or NO terminal mechanically.
Step 3, Code the Arduino:
ImportantNote: You will find that the code has a mechanism for tracking when variables change, you will also notice Arduino IoT Cloud generated functions On[Insert Variable Name]Change the reason we use the mechanism instead is because with Alexa Compatible variables it doesn't trigger the function ONLY when the variable actually CHANGES it triggers it anytime you give Alexa a command utilizing the variable in question, the reason this causes problems for us is because the heater has toggle switches and if a user sends a command to Amazon Alexa twice it will seriously mess the code up.
Other then that the code is pretty self-explanatory, BUT we still need the cloud generated functions to switch the low power mode and high power mode variables, ex. when high power mode is turned on, low power mode is automatically turned off. The code also uses the Arduino Opla screen to display the status.
Step 4, Configure Amazon Alexa:
For this you will need the Amazon Alexa app and (obviously) an Amazon Alexa device, so go into the app and go to the skills section, and install the Arduino skill, then go to the devices section, scroll down and click YOUR SMART HOME SKILLS, the click enable to use. Scan for smart devices and three should show up (heater, low_power_mode and high_power_mode). Set heater off and mode to whatever mode your heater defaults to when it starts up.
ImportantNote: Alexa doesn't understand underscores! You will have to rename the high_power_mode and low_power_mode "devices" to high power mode and low power mode without underscores, replacing them with regular spaces.
Safety and Operation
Given the nature of high-wattage heating appliances, the build includes critical safety warnings:
- Boot-Up Compensation: Relays on the MKR Carrier may toggle during a firmware upload. You should always wait for the system to stabilize before plugging the heater into its main socket.
- Display Status: The Oplà's circular OLED display is programmed to show real-time status, providing a physical "Dashboard" that confirms if your Alexa commands were successfully processed.
Step 5, How to use and configure (ImportantStuff):
Insert the batteries in your remote (but don't plug your heater in yet because for some reason the MKR IoT Carrier's relays will turn on and off on start up and upload) and start the Arduino, Once you see that the relays have stopped turning on and off and the Arduino has compensated for any changes made while it was off screen you can plug the heater in, the device is meant to stay on but if you are turning it off for a while make sure heater is off and the mode is set to whatever mode your heater defaults to when it starts up. Don't change the variables when the device is off.
And you're done! Let me know what you think of this project in the comments.
This project is an excellent example of how makers can bridge the gap between "Old" hardware and the "New" IoT ecosystem, creating a more cohesive and intelligent home.