A soil moisture sensor version 1. Built on top of Nordic nRF5 SDK 15.
Download Nordic SDK16.0 and install it at the project root.
Segger Embedded Studio SES is recommended to use for developing. Start SES and open basilika_pca10040.emProject
at the root level.
Compile and flash the project to your board using SES.
A relay moisture sensor bought from SparkFun SEN-13322 is used for measuring of moisture in soil. Power Supply: 3.3V...5V Output voltage signal: 0...4.2V (depends on provided voltage) Consumption: 35mA
BCP56T Series, 80V, 1A NPN medium power transistor, to control the moisture sensor.
8/10/12-bit resolution, 14-bit resolution with oversampling Full scale input range (0 to VDD) Each channel can be configured to select AIN0 to AIN7 pins, or the VDD pin.
NRF legacy layer for a clock driver.
Real time counter driver.
nRF52 DK | NPN Transistor | Moisture Sensor |
---|---|---|
P0.30 | base | |
P0.03 | S | |
GND | GND | |
VDD | collector | |
emitter | VCC |
The formula is used to calculate the output voltage:
result = [V(P) - V(N)] * gain/reference * 2^(resolution - m)
where
- V(P) : the voltage at input P
- V(N) : the voltage at input N
- gain : the selected gain
- reference : the selected reference voltage
- /config - Project configuration settings
- /interface - Analog and Digital Drivers