element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
On the Line
  • Challenges & Projects
  • Design Challenges
  • On the Line
  • More
  • Cancel
On the Line
Projects Green Brain - distributed greenhouse control platform
  • News
  • Projects
  • Forum
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join On the Line to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: saramic
  • Date Created: 20 Jun 2026 1:44 PM Date Created
  • Views 44 views
  • Likes 1 like
  • Comments 0 comments
  • On the line design challenge
  • On The Line
  • arduino uno q
  • greenhouse
Related
Recommended

Green Brain - distributed greenhouse control platform

saramic
saramic
20 Jun 2026
Green Brain - distributed greenhouse control platform

TL;DR

A distributed CAN bus sensor network for a greenhouse, built around Arduino Nano nodes, an Arduino UNO Q hub, and a Python Flask dashboard. Two of the three nodes reliably report temperature and humidity. One has a wiring fault. There was a water cannon. It did not work. LabVIEW almost parsed the JSON.

Introduction

Plants and kids are nice additions to the homeliness of a home. Sometimes you take the kids on holidays and the plants die. The Green Brain is a smart greenhouse monitoring system to stop that happening.

To keep in tune with the On the Line industrial theme I dived into CAN bus — the Controller Area Network protocol used in automotive and industrial control systems — to connect a multi-node sensor network to an Arduino UNO Q as the central host. Throw in some temperature and humidity sensors, a water cannon Gun (it seemed like a good idea at the time), and a LabVIEW dashboard, and you have a design challenge.

System Architecture

 Arduino Nano     Arduino Nano     Arduino Nano
  Node 1 ⚠️       Node 2 ✅        Node 3 ✅
  DHT11           DHT11            DHT11
  MCP2515         MCP2515          MCP2515
     │                │                │
     └────────────────┴────────────────┘
              CAN bus (500 kbps)
                      │
              ┌────────────────┐
              │  Arduino UNO Q │
              │  STM32 FDCAN   │  ← CAN hub via WCMCU-230
              │  RouterBridge  │  ← IPC to Linux side
              │  Python Flask  │  ← REST API + dashboard
              └───────┬────────┘
                      │ :8080
              Browser / LabVIEW

Each Arduino Nano node reads a DHT11 temperature and humidity sensor and broadcasts an 8-byte CAN frame every ~2.5 seconds. The UNO Q’s STM32 co-processor receives those frames via its hardware FDCAN peripheral and exposes them to the Linux side via RouterBridge — the designed IPC mechanism for the UNO Q. A Python Flask app polls the STM32 and serves a live dashboard.

The CAN frame protocol packs node ID, temperature (×10, big-endian uint16), humidity (×10, big-endian uint16), status flags, a sequence counter, and an XOR checksum into 8 bytes — the fixed maximum for classic CAN.

The Journey

Part I — CAN bus introduction

First steps: Arduino Nano nodes with MCP2515 CAN transceivers, DHT11 sensors, and a loopback test. The first real wiring lesson arrived early — MOSI goes to MOSI, not MISO. I had been doing too much UART recently.

Part II — Dev setup

Getting the UNO Q into the picture. The STM32 and Linux sides of the UNO Q communicate via RouterBridge — you cannot bypass it to access the UART directly because the arduino-router service owns it as root with Restart=always. PlatformIO for the Nano nodes, a Python Flask app on the Linux side, and mise to glue the deploy pipeline together.

Part III — Water Cannon Chaos

I promised a water cannon so I had to deliver, if only for a forum post. The pump motor produced enough EMI to move the servo controllers even with no code driving them — the signal pins were acting as antennas. Water also leaks through electrical tape. And vinyl tubing. The Omega temperature probe did work nicely as a tube holder though.

image

Part IV — Nodes Well That Ends Well

The most educational part. Getting three nodes onto a bus uncovered four separate problems: a cold solder joint that read CANSTAT=0x00 instead of 0x80, a faulty MCP2515 module on node 1, duplicate node IDs from a careless flash causing CAN ID collisions, and a flat delay(2000) keeping all nodes locked in sync so node 3 always lost arbitration and eventually hit bus-off.

The fixes: a CANSTAT diagnostic before setBitrate, unique NODE_IDs, staggered transmit timing (delay(2000 + NODE_ID * 300)), and bus-off recovery via the EFLG register. Node 1’s wiring fault was never fully resolved.

Part V — LabVIEW visualisation

LabVIEW was new territory. The HTTP Client GET VI reached the Flask REST API without trouble. Parsing the JSON response with Unflatten From JSON requires building an array-of-clusters constant that exactly mirrors the JSON structure — outside-in, array shell first, cluster inside, typed constants with matching labels. I hit a type mismatch error (0xFFFA4723) and ran out of time to track down which field was wrong.

image

What shipped

  • Two nodes reporting live temperature and humidity to a web dashboard White check mark
    • You don't have permission to edit metadata of this video.
      Edit media
      x
      image
      Upload Preview
      image
  • STM32 FDCAN hub via RouterBridge to Python Flask White check mark
  • CAN bus arbitration, error detection, and bus-off recovery in firmware White check mark
  • HTTP GET from LabVIEW reaching the REST API White check mark
  • Twisted pair CAN bus wiring in an actual greenhouse White check mark

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

What didn’t

  • Node 1 — wiring fault still unresolved, CANSTAT=0x00 in loopback Wrench
  • Water cannon — EMI from the pump motor, servo interference, water everywhere Sweat drops
  • K-type thermocouples — late shipment, never arrived in time
  • LabVIEW JSON parsing — type mismatch with array-of-clusters, one field wrong somewhere
  • Soil moisture sensors — YL-69 sensors acquired, never wired up
  • Computer vision / plant detection — still a dream

Lessons learned

CAN bus is unforgiving about setup. It handles arbitration and error detection in hardware — but the hardware needs clean wiring, unique IDs, and firmware that can recover from error states. A flat delay() in every node is enough to synchronise them and drive the highest-ID node into bus-off within minutes.

Measure before you guess. A two-line CANSTAT register read before setBitrate immediately told me whether the problem was wiring (0xFF), CS/SCK (0x00), or chip (still 0x00 in loopback). Without that I would have re-soldered the same joint three times.

The RouterBridge constraint is real. The UNO Q’s architecture — Linux MPU talking to STM32 MCU via a root-owned UART service — means you cannot bypass it. Once I understood that, the Python + RouterBridge path was actually clean and well-supported. Fighting the architecture costs time.

Pump motors and servos are enemies. No amount of power rail isolation stopped the EMI from the pump reaching the servo signal pins once the mechanical assembly was complete. A proper ferrite + shielded cable solution was the right answer; running out of time was the actual answer.

Don’t leave the build until the last week. I had time to build the stands and boards well in advance. I used it anyway.

Next

  • Fix node 1’s wiring fault
  • Add K-type thermocouple nodes via MAX6675
  • Finish LabVIEW JSON parsing (Flatten To JSON debug to find the type mismatch)
  • Soil moisture sensors on the bus
  • Plant the plants Seedling

Source

https://github.com/saramic/green-brain

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube