update: improve documentation and restructure code for modular hardware integration, add CAN communication to HAL, and update KiCad layouts

This commit is contained in:
2026-01-23 22:02:14 +01:00
parent 1de40085fb
commit 0c0b62e2ed
18 changed files with 486 additions and 219 deletions

View File

@@ -5,21 +5,38 @@ draft: false
description: "a description"
tags: ["sensor"]
---
# Sensors & Pumps Module
This functionality is now provided by dedicated modules that can be connected to the MainBoard.
# Sensors
The board can address up to 16 sensors, with an A und B sensor per plant.
The A sensor is always used, the B sensor is optional and use is suggested for larger planters.
The moisture sensing functionality is handled by a dedicated **CAN bus-based Sensor Module**. This modular approach allows for better scalability and reduces electrical interference by moving the measurement logic closer to the sensors and using digital communication.
The sensor itself are just two spikes with a defined distance. They can be bought readymade or simply be done DIY with two long nails (use galvanized or non rusting ones)
## Sensor Module (CAN bus)
The standard sensor module features its own **CH32V203 RISC-V microcontroller**, which handles the measurement of soil moisture and communicates the results back to the MainBoard via the CAN bus.
The Sensor is switched via multiplexer chips to a 555 oscilator circuit that uses he the earths resistance for charging and discharging a small capacitor. The ESP simply counts how often the charge pulse was seen.
While this sensor can be easily influenced since it runs in lower uA - mA range, due to the frequencys of several khz for normal moist plants, it is still very resistant, eg a 50hz failure signal from a nearbly power circuit would barely be registered.
Since the Sensor is changing polarity between charging and discharging, corrosion due to organic battery effects is minimized, also it prevents errors due having build a battery (You can easily charge a planter to several V if you do not change polarity).
* **Capacity:** Supports up to 16 sensors (typically 8 plants with an A and B sensor each).
* **Reliability:** Digital communication via CAN bus ensures data integrity even over longer cable runs and in electrically noisy environments.
* **Addressing:** The A sensor is always used; the B sensor is optional and suggested for larger planters to provide a better average of the soil moisture.
## Sensor Hardware
The sensors themselves remain simple and cost-effective:
* **Design:** Two spikes with a defined distance.
* **DIY Friendly:** Can be bought readymade or easily made with two long nails (galvanized or stainless steel suggested to prevent rusting).
## Measurement Principle
The new CAN-based sensor module uses a sophisticated measurement technique that replaces the outdated 555-oscillator and multiplexer design. By using a dedicated MCU for measurement:
* **Minimized Corrosion:** The system changes polarity between measurements, minimizing corrosion due to organic battery effects (electrolysis) and preventing errors caused by building up a DC voltage in the soil.
* **Interference Resistance:** The measurement is resistant to common failure signals, such as 50Hz hum from nearby power circuits.
* **Digital Accuracy:** The local MCU processes the analog signals and sends precise digital values to the MainBoard.
# Pumps
The board contains 8 low side switched pump outputs. The pumps are running directly from the battery without further voltage conversion, so ensure that the can survive the full voltage range of the battery.
The Pump module contains low side switched pump outputs. The pumps are running directly from the battery without further voltage conversion, so ensure that they can survive the full voltage range of the battery.
Each output can supply up to 3A continously.
The board will never switch more than one output concurrently, so there is no need to size the battery for higher maximum load.
An additinal extra out exists, that is switched, when any of the pump outputs is supposed to run.
An additinal extra output exists, that is switched when any of the pump outputs is supposed to run.
<!-- TODO: Add photo of the new modular Pump and Sensor boards -->
This allows for multiple possible setups
## Layout Central Pump