Over the past six years, I have used NodeMCU for my IoT Controllers. Cheap, cheerful and very functional. Let’s dig in.
I accidently fell into IoT controllers when building a signal generator, shown above top left. I needed a microcontroller to run my AD9850 direct digital synthesizer chip. I selected the NodeMCU so I could control this device either over USB or wireless. Shown above is my toner transfer PCB with both devices mounted. Also added were an LCD display and rotary encoder. You can study the whole project here.
Last year, I made a remotely controlled small transmitting loop, using a DC motor for loop rotation and a stepper for adjusting a tuning capacitor. Rather than a PC board, I used a plastic mount for all the pieces of the control unit, as shown lower left. As described earlier, my NodeMCU was mounted on a motor control shield, and connected to a separate module for stepper control.
This was probably the most complicated of my IoT controllers, with gears and pulleys for motion. Kind of like a robot. I found it neat that I could have a complete loop antenna show up as a device on my home network.
Slightly less complex is my current diversity reception antenna switch. As shown above right, my NodeMCU is slaved to a couple of PCF8574 GPIO expansion modules to control a bunch of relays. In turn, these relay boards switch coax connections from my wideband loop array to all of my different receivers.
In all of these examples, my control protocol is simple ASCII text terminated with a line feed. My microcontroller reads these strings and translates them into physical action with motors and relays, or tuning a DDS module in the case of the signal generator.
Firmware for my IoT Controllers
Writing firmware for these projects is pretty easy. My NodeMCU is fully supported by the Arduino IDE. I use Visual Studio for development and testing. The rest of my series here will describe all of the parts of a firmware program for the antenna switch. You can use this as a template for your own projects.
If you are happy using your home wireless network on 2.4 GHz for your IoT devices, NodeMCU is a simple solution. Amazing what you can do with $5. If you have a 3D printer, you can fabricate structures to hold the electronics and mechanical parts, as shown above.