
Explore building a terrarium control system using node red and ESP32, with a raspberry pi as the brain and mosquitto broker for publish-subscribe messaging, plus hardware and software integration.
Discover the software requirements for the ESP32 terrarium controller, including node-RED on Raspberry Pi OS, mosquito broker, quiddity, and cloud services like Google Sheets/Drive API and IFTTT.
Select flexible, low-cost hardware for the Node-RED ESP32 project, using Wi-Fi-enabled controllers (ESP32, Raspberry Pi) and generic sensors like DHT22 with simple motor control.
Plan dedicated, uninterrupted study blocks to master each lecture's learning and practical outcomes, then apply Modred and Quiddity to a terrarium controller project, with flexibility to substitute components.
Explore the official release plan for Node-RED versions, understand upgrade paths between major releases, and learn when minor upgrades affect your flows.
Walks through the Tyrolean controller circuit for the Node-RED and ESP32 project, detailing the ESP32 devkit, temperature and humidity sensors, and motor drive with a transistor and flyback diode.
Demonstrates setting up the ESP32 circuit on a breadboard, wiring a pump, moisture sensor (via a voltage divider), and a DHT-22 humidity/temperature sensor for testing.
Explore the esp32 pcb design, from version one to two, with a compact layout, central linear components, tip122, dht22, and moisture sensor, and motor power wiring.
Ensure the power supply can deliver enough current to prevent ESP32 brownout and motor stall; a 9-volt, 2-amp supply with a capacitor works, with separate supplies also viable.
Switch to a capacitive moisture sensor to avoid corrosion, connect via a groove connector, and simulate soil with sponge sandwiches to test Node-RED and ESP32 data flows.
Install Raspberry Pi OS on an SD card with Imager. Enable ssh by adding an empty ssh file to the boot partition to host a note server and integrity service.
log in to the new Raspberry Pi, set a hostname like node-red.local, reboot, and verify the hostname to prepare for installing and configuring Node-RED.
Explore Node-RED as a browser-based programming environment that builds graphical flows from nodes via drag-and-drop, using JavaScript, with open-source documentation and Raspberry Pi support.
Install Node-RED on a Raspberry Pi following the documentation, upgrade system packages, run Node-RED, configure as a service to auto-start, and review the configuration file.
Learn to configure a Node-RED instance via the settings wizard, back up the settings and flows files, enable user security, and apply changes by restarting.
Explore the node editor interface and how to deploy changes to flows. Learn to import and export flows, search flows, and navigate the palette, tabs, and debug and dashboard views.
Explore Node-RED basics for ESP32 projects by configuring nodes, building simple flows, using the debug and inject tools, and installing third-party dashboards on a Raspberry Pi.
Learn how to use node groups in Node-RED to organize nodes, name and color groups, copy groups with notes, and manage group properties and environment variables for clearer flows.
Learn to configure Node-RED flows with the DHT-22 sensor on a Raspberry Pi, using inject, debug, and trigger nodes, and export, import, and document flows.
Learn how Node-RED messages enable data exchange between notes, carrying payloads and complete message objects. Explore message IDs, metadata, and JSON payloads with practical debugging examples.
Master passing data with messages and variables in Node-RED, using node, flow, and global contexts. Learn to set, read, and reset these variables with change and function nodes.
Learn how the complete node in Node-RED links to other nodes and fires when that node completes, passing the message payload for reuse; deploy, test, and observe in debug window.
Learn how the catch node in Node-RED captures errors across a tab and outputs an error object for debugging, and read the error object's message attribute in debug mode.
Use link out and link in nodes as an alternative to global variables for exchanging data between flows. Name the links to visualize connections and deploy the flow across tabs.
Learn to implement conditional routing with the switch node in node-red, using payload rules (greater than five or less than or equal to five) and first-match or all-rules options.
Apply the range node to map an analog input from 0 to 1023 into a 0 to 100 scale, enabling soil humidity readings as a percentage.
Learn to configure the trigger node in Node-RED to emit messages at a chosen period, reset via payload, and control a simple inject flow with a DHT22 example.
Use the RBE (report by exception) node to pass output changes only when the input value changes, blocking unchanged values and saving bandwidth in a terrarium controller.
Explore the Node-RED dashboard, its widgets, groups, and tabs, and learn how widgets interact, how to edit properties, and how to customize themes to build interactive IoT dashboards.
Configure a text input and text output on the Node-RED dashboard, organizing them into tab one and group one, and learn to pass the payload via the message object.
Wire a momentary button in a Node-RED dashboard to a text output, style it blue with a 'press me' label, and use a trigger node to reset after one second.
Explore how to use gauge widgets in Node-RED with four styles—normal, donut, compass, and level—and drive them with a slider, including range mapping, rounding, and layout tips.
Learn to implement an on/off switch in the Node-RED dashboard by adding a switch node with a text output, configuring boolean payloads, and arranging layout groups for true/false display.
Learn to use the dropdown widget from the dropdown node to create a color selector on a dashboard, including single and multiple selections and a text output.
The template node in the Node-RED and ESP32 project enables customizing dashboards with HTML and mustache, controlling text color via a dropdown.
Create and configure a form widget in a dashboard flow, including text, checkboxes, and a date element, with submit and cancel actions, validation, and a form output display.
Explore the lightweight MQTT publish-subscribe model with a broker routing messages between publishers and subscribers in an IoT setup, including topics, wildcards, and quality-of-service levels using Mosquitto on Raspberry Pi.
Install the mosquitto broker and clients on a Raspberry Pi via apt, start the service, verify it runs, and review the configuration file for future security and graphical client use.
Explore mqtt pub and sub concepts using mosquitto on Raspberry Pi, with command line and GUI clients, publish to topics, and verify with multiple publishers and subscribers.
Configure mosquitto to require client authentication by using a password file, set allow_anonymous false, and encrypt passwords with mosquitto_passwd, then restart the service.
Configure the mosquito broker to require authentication and demonstrate authenticated mqtt subscribers and publishers. Verify messages flow between authenticated clients on a Raspberry Pi and prepare for Node-RED integration.
Configure an MQTT in node in Node-RED, set up a local Raspberry Pi broker, and publish to and subscribe from a topic using an ESP32 simulator.
Publish messages to a topic with the mqtt out node and trigger them with an inject node, then subscribe to view DHT-22 sensor data on a Raspberry Pi dashboard widgets.
Enable the flow to publish DHT22 temperature and humidity to the mqtt broker, split the function output into two topics, and test with subscribers before wiring dashboard widgets.
Learn to build an MQTT-enabled ESP32 project with Node-RED, publishing DHT22 temperature and humidity data to a broker, then visualize it with dashboard widgets and historical charts.
Create a mqtt dashboard with a slider that publishes numbers (0–50) to a topic and displays them on a gauge in a new dashboard tab.
Review the first prototype of the terrarium controller on a breadboard, integrating a motor pump, soil humidity sensor, ESP32, and a Node-RED dashboard to test automatic watering.
Review the completed breadboard circuit with the TIP122 transistor driving a motor, a 100 μF ceramic capacitor to damp noise that affects the ESP32 sensor.
Review the ESP32 sketch using the MQTT client library, set WiFi and broker credentials, publish soil humidity updates to a topic, and subscribe to a control topic with a threshold.
Finish the first iteration by implementing the manual pump control in the terrarium node-red flow on the ESP32.
Subscribe to the soil humidity topic and use a function to switch the pump on or off at 500. Throttle updates and publish only changes, with a live humidity gauge.
Recaps the ESP32 soil humidity sensing setup and motor control, with a breadboard circuit, MQTT publishing to the soil humidity topic, and a control topic-driven pump on/off.
Demonstrate voltage sensing with two voltage dividers to monitor motor and MCU voltages, including resistor configurations, simulations, tolerances, and future telemetry and alerts.
Review the completed Node-RED and ESP32 circuit, focusing on a voltage divider and resistor values chosen via a simulator to protect the ESP32 while measuring motor and USB voltages.
Review the ESP32 sketch that measures two voltages, motor and MCU, via a voltage divider, applies a correction factor, and publishes results to the Kitty and Broca.
Review the second version of the Node-RED flow for the ESP32 project, wire topics for MCU and motor voltage, and display formatted readings on the voltages dashboard.
Recap the Node-RED and ESP32 project, review controller, sensors, and dashboard gauges, then plan to log data to Google Sheets with Node-RED flow, including date, time, humidity, and pump state.
Extend the node red flow to log terrarium telemetry from the ESP32 into a Google Sheet. Update records on motor state changes or at one minute to track humidity.
Learn to install and configure the Google Sheets node in Node-RED, including Google Drive APIs, credentials setup, and spreadsheet ID handling to read or append data in flows.
Set up a Google sheet for a node-red and ESP32 project by creating a Google Cloud project, enabling Drive and Sheets APIs, generating service account credentials, and sharing the sheet.
Update the Node-RED flow to write sensor data to Google Sheets, configure credentials and spreadsheet id, format as a comma-delimited string, and throttle updates to once per minute.
Test and deploy the updated Node-RED and ESP32 flow for motor control, verify data in Google Sheets, fix undefined values, and plan a dashboard threshold control for soil humidity.
Updated December 2022 to support Node-Red version 3
In December 2022, we added a new section with eight lectures that cover Node-RED version 3.
With these lectures, you will learn how to upgrade your Node-RED instance to version 3 and use the most important new and updated features.
Updated June 2022 to support Node-Red version 2.2.2+ and Node.js 16.
More details about this update: We have added ten new lectures that show you how to update Node-Red to version 2.2.2, and Node.js to version 16, as well as how to use several of the new nodes that come with Node-Red 2.
There's also a lecture showing you how to complete this project without having to set up an actual terrarium so that you can learn without the mess.
This course teaches you how to design and build an automated control system using Node-RED and the ESP32.
This course will guide you through the construction of an automated control system. The deliverable is a Terrarium controller.
Along the way, you will learn a great deal about useful technologies such as the Node-Red programming environment and MQTT.
This course is perfect for makers familiar with the ESP32 and interested in learning how to use it alongside Node-RED.
Node-RED is a lightweight graphical programming tool. You can use it to join various hardware and software components and create applications such as the automated terrarium controller in this course.
Node-RED is used in a range of settings. Makers create home automation applications, and organisations use it to automate their factory floors, among many other possibilities.
The ESP32 is a powerful low-cost microcontroller with built-in Wi-Fi that we can program with the familiar Arduino IDE. Its "call to fame" is that it makes it easy for anyone familiar with the Arduino to leverage their knowledge and create gadgets that need more memory and processing power than what the Arduino Uno can provide, in addition to Wifi and Bluetooth. All this at a lower price point.