This repo contains the EagleCAD source files for the PCB design of the Soil Power Sensor. The Soil Power Sensor is a iteration on the design of CurrentSense by Lab11(https://github.com/lab11/CurrentSense).
The bill of materials is available digitally at https://octopart.com/bom-tool/UpNyCD2G or as csv in hardware/Soil Power Sensor.csv
.
There are two buttons not listed in the BOM for the esp32 BOOT
and EN
. These are cheaply available from amazon. Look for one with a 6mm by 6mm form factor.
Generate the BOM from the schematic editor (Tools -> Generate Bill of Materials...
) and use the view Order.
- Order PCB, the included gerber files were generated for JLCPCB
- Order components from the BOM.
- Solder surface mount components, excluding the following
- Wio-E5
- Screw Terminals
- Pin headers
- Solder remaining through hole components.
- Solder the AAA battery clips on the bottom of the board.
- Solder a jumper wire from
J6
to the positive input power on the Wio-E5.
The Wio-E5 module comes pre-installed with LoRa AT command firmware with hardware write protection enabled. Before you are able to flash the device the read protection must be cleared using STM32CubeProgrammer using a ST-Link debugger. We prefer to use the STLINK-V3MINIE due to its small form factor and low cost.
- Start
STM32CubeProgrammer
- Connect the device and ST-Link device.
- On the right panel configure the
Port
toSWD
- On the Wio-E5 module, hold
BOOT
, press and releaseRST
, then releaseBOOT
. You are now in the bootloader. - In
STM32CubeProgrammer
press connect. It will give aError: Data read failed
popup. This is expected. - Go to Option Bytes tab.
- Under Read Out Protection change
RDP
toAA
. - Press apply. You should get a
Option Bytes successfully programmed
popup. - Press disconnect.
- Unplug and plug back in the soil power sensor.
- Flash firmware with
pio run -t upload
.
Before powering on the board shorts to ground on any of the supply rails.. The continuity test on a multimeter may initially beep for a short period of time due to bypass capacitors. TP4
may display a resistance value due to internal capacitance. Ensure it is not close to zero.
Then, power the device through the USB-C terminal and flash with firmware that enables all the peripherals. Verify the voltages at the test points match what is shown in the table.
TP6
is used to used to connect the battery to the Wio-E5 module.
Test point | Signal | Voltage |
---|---|---|
TP1 |
REF+1V65 |
+1.65V |
TP2 |
REF+3V3 |
+3.3V |
TP3 |
+3V3 |
+3.3V |
TP4 |
-3V3 |
-3.3V |
TP5 |
VCC |
5V |
TP7 |
VUSB |
5V |
TP8 |
VBAT |
N/A |
In the firmware repo run the unit tests for both stm32
and esp32
projects with the following commands from the respective folders:
pio test -e tests -i test_sdi12
The test test_sdi12
is ignored since it relies on external hardware that might not be connected. All tests should pass.
Serial wire debug (SWD) port for stm32. To load the bootloader, hold BOOT
, press and release RST
, then release BOOT
. Then you should be able to connect to the device.
UART TX and RX pins to connect to the esp32 bootloader. Intended to be use with a USB to UART converter and esptool.py
.
Jumper J5
selects the power source, either VUSB
from the USB-C terminal or VBAT
from the 4 x AAA
batteries on the backside of the board. The jumper can also be used to power the board directly from a DC power supply.
The soil power sensor has multiple measurement configurations. The most common use case is Common GND which gives single ended measurements with low-side sensing.
Jumper | Bridged |
---|---|
JP1 |
No |
JP2 |
No |
JP3 |
No |
Resistor | Value |
---|---|
Rsense1 |
DNP |
Inputs Voltage
, Current
, GND
are all independent from each other, therefore the most modular configuration. Use this mode when you want to measure a voltage/current difference that is not relative to GND
. The GND
connection must be connected to the common ground of the measured device.
Jumper | Bridged |
---|---|
JP1 |
Yes |
JP2 |
No |
JP3 |
Yes |
Resistor | Value |
---|---|
Rsense1 |
0 ohms |
The negative terminals of Voltage
and Current
are tied to ground. Both measurements will be relative to ground. Connect common ground to the negative terminals or GND
terminal.
Jumper | Bridged |
---|---|
JP1 |
Yes |
JP2 |
Yes |
JP3 |
Yes |
Resistor | Value |
---|---|
Rsense1 |
Any |
The configuration uses a on-board resistor for RSENSE1
. The resistor is chosen based on the desired range of input measurements. The board uses a high-side current measurements.
Links for generating production files and BOM for JLCPCB
The Soil Power Sensor board design files are licensed under the Solderpad Hardware License (wraparound license of Apache License).
- John Madden - jmadden173