{"id":21,"date":"2026-03-22T16:57:32","date_gmt":"2026-03-22T16:57:32","guid":{"rendered":"https:\/\/christoph-hoerth.de\/?page_id=21"},"modified":"2026-04-09T19:55:27","modified_gmt":"2026-04-09T19:55:27","slug":"electronics-firmware","status":"publish","type":"page","link":"https:\/\/christoph-hoerth.de\/?page_id=21","title":{"rendered":"Electronics &amp; Firmware"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5-1024x576.png\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5-1024x576.png 1024w, https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5-300x169.png 300w, https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5-768x432.png 768w, https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5-1536x864.png 1536w, https:\/\/christoph-hoerth.de\/wp-content\/uploads\/2026\/03\/grafik-5.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Control Electronics &amp; Pinout<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The wall is controlled by an ESP8266-based NodeMCU microcontroller running custom firmware. The controller handles pump scheduling, LED dimming, water level monitoring, and serves a web interface for configuration \u2014 all accessible over WiFi without physical access to the unit.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Microcontroller<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The brain of the system is an ESP8266 NodeMCU (Wemos D1 Mini compatible pinout). All outputs operate at 3.3V logic level. The firmware is written in Arduino C++ and supports OTA (over-the-air) updates, meaning the software can be updated remotely without touching the hardware.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Pin Assignment<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Pin<\/th><th>GPIO<\/th><th>Function<\/th><th>Component<\/th><\/tr><\/thead><tbody><tr><td>D3<\/td><td>GPIO0<\/td><td>Pump control<\/td><td>Fafeicy 3.3V 1-channel relay module<\/td><\/tr><tr><td>D5<\/td><td>GPIO14<\/td><td>LED channel 1 (PWM)<\/td><td>MOSFET module (diymore)<\/td><\/tr><tr><td>D6<\/td><td>GPIO12<\/td><td>LED channel 2 (PWM)<\/td><td>MOSFET module (diymore)<\/td><\/tr><tr><td>D1<\/td><td>GPIO5<\/td><td>Ultrasonic TRIG<\/td><td>AJ-SR04M water level sensor<\/td><\/tr><tr><td>D2<\/td><td>GPIO4<\/td><td>Ultrasonic ECHO<\/td><td>AJ-SR04M water level sensor<\/td><\/tr><tr><td>D4<\/td><td>GPIO2<\/td><td>Buzzer<\/td><td>KY-006 passive buzzer<\/td><\/tr><tr><td>A0<\/td><td>ADC<\/td><td>Reserved<\/td><td>Moisture sensor (future use)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Power Distribution<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The system uses three separate DC power supplies. Each of the two LED strips runs on its own dedicated <strong>24V<\/strong> supply \u2014 the supplies that came with the strips \u2014 with each strip switched independently via its own MOSFET module. Keeping the supplies separate avoids interference between channels and simplifies fault diagnosis. The pump and the Mini360 DC-DC buck converter share a single <strong>12V<\/strong> supply. The buck converter steps the 12V down to 3.3V, fed directly into the VIN pin of the NodeMCU, bypassing the onboard regulator entirely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Initial attempts to power the NodeMCU via the 5V VIN pin resulted in insufficient current delivery to the MOSFET modules \u2014 the LEDs glowed faintly rather than switching properly. Using the buck converter resolved this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An important lesson from the build: <strong>wire gauge matters significantly at low voltages<\/strong>. Thin signal-grade wiring caused visible LED flickering under load. All power-carrying connections were therefore rebuilt using AWG 18 wire. The Grove connector carrier cables were assembled by hand using AWG 18 cores rather than standard thin Grove cable stock \u2014 this eliminated the flickering significantly.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Pump Control<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pump is switched via a diymore MOSFET module which bridges the 3.3V logic output of the ESP8266 to the 12V load side. The firmware supports three operating modes: manual on\/off, interval-based automatic watering with configurable hours\/minutes\/seconds, and schedule-based watering with up to 8 daily trigger times. A pre-wetting mode delivers short bursts before the main watering cycle to counter hydrophobic fleece behaviour after extended dry periods \u2014 essential after the wall has been dry for more than a few hours.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>LED Control<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two independent LED channels allow the light output to be split or staged across the wall. Both channels support PWM dimming via dedicated diymore MOSFET modules. The firmware implements a full daily light schedule with configurable ramp-up and ramp-down times, peak brightness windows, and a hard maximum PWM cap of 40%. The 3V\u20135V logic to 12V\u201324V switching capability of the MOSFET modules makes them well suited for driving LED strips directly from microcontroller pins.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Water Level Monitoring<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A first attempt at water level monitoring used an AJ-SR04M ultrasonic sensor mounted in the tank lid. In practice, the sensor proved unsuitable for this setup: operated at 3.3V, its blind zone of approximately 20 cm made it unable to measure above roughly 40% fill level in the 34 cm tall tank. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The replacement will be a VL53L0X time-of-flight laser sensor. It offers millimetre resolution, no relevant blind zone, and runs natively at 3.3V via I2C &#8211; fitting directly into the existing sensor mounting hole in the tank lid with a PG13.5 adapter. The main uncertainty is whether the clear brown iron-chelate nutrient solution reflects the 940nm laser reliably at the water surface. A floating ping-pong ball in a guide tube is planned as a fallback reflector if direct surface measurement proves unreliable. The firmware calibration and daily logging logic remains unchanged.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Connectivity &amp; Remote Management<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The controller connects to the local WiFi network and exposes a web interface on port 80. All settings \u2014 watering schedules, LED timing, pre-wetting parameters \u2014 are configurable through the browser interface without touching the hardware. Firmware updates are delivered over-the-air (OTA) via a dedicated update endpoint. For a wall mounted in a hard-to-reach position, OTA capability is not a convenience feature \u2014 it is a necessity.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Components Used<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Component<\/th><th>Function<\/th><\/tr><\/thead><tbody><tr><td>ESP8266 NodeMCU<\/td><td>Main controller<\/td><\/tr><tr><td>diymore MOSFET module 3V\/5V \u2192 12V\/24V, 22A<\/td><td>Pump &amp; LED switching<\/td><\/tr><tr><td>Fafeicy 3.3V 1-channel relay module with LED<\/td><td>Pump control (alternative)<\/td><\/tr><tr><td>Mini360 DC-DC buck converter 4.75\u201323V \u2192 1\u201317V<\/td><td>12V to 3.3V for NodeMCU<\/td><\/tr><tr><td>VL53L0X time-of-flight laser sensor<\/td><td>Water level measurement<\/td><\/tr><tr><td>KY-006 passive buzzer<\/td><td>Acoustic alerts<\/td><\/tr><tr><td>Grove connector carrier<\/td><td>Modular wiring<\/td><\/tr><tr><td>AWG 18 wire (custom Grove cables)<\/td><td>Power distribution \u2014 critical for stable LED operation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Greenwall Control \u2014 Custom Firmware for Automated Living Walls<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This firmware runs on an ESP8266\/ESP32 microcontroller and manages all core functions of an automated vertical green wall: irrigation, LED grow lighting, and water tank monitoring \u2014 entirely self-contained, accessible via a local web interface over WiFi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The irrigation system supports both interval-based and schedule-based watering cycles. A dedicated pre-wetting mode addresses the hydrophobic behaviour of dry fleece pockets by running short water bursts with absorption pauses before the main cycle begins \u2014 preventing runoff and ensuring even substrate saturation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LED lighting follows a fully configurable daily schedule with smooth fade transitions between dim and full brightness phases, simulating natural light conditions for the plant community.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Water consumption is tracked via ansensor with a multi-point calibration system. All settings are stored persistently on-device and the firmware supports over-the-air (OTA) updates, so the controller never needs to be physically accessed after installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The interactive demo below reflects the actual web interface running on the device.<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/christoph-hoerth.de\/wp-content\/uploads\/greenwall_demo.html\" \n           width=\"100%\" height=\"900\" frameborder=\"0\"\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Control Electronics &amp; Pinout The wall is controlled by an ESP8266-based NodeMCU microcontroller running custom firmware. The controller handles pump scheduling, LED dimming, water level monitoring, and serves a web interface for configuration \u2014 all accessible over WiFi without physical access to the unit. Microcontroller The brain of the system is an ESP8266 NodeMCU (Wemos &#8230; <a title=\"Electronics &amp; Firmware\" class=\"read-more\" href=\"https:\/\/christoph-hoerth.de\/?page_id=21\" aria-label=\"Read more about Electronics &amp; Firmware\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_kadence_starter_templates_imported_post":false,"footnotes":""},"class_list":["post-21","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/pages\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":15,"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/christoph-hoerth.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}