FarmBot / farmbot-arduino-firmware

Arduino firmware that executes g-code like commands over a serial line to move the FarmBot and operate the tool mount
MIT License
421 stars 197 forks source link

Soil Moisture sensor #117

Open ConnorRigby opened 5 years ago

ConnorRigby commented 5 years ago

ICP-10111.pdf

The new soil sensor has an ICP-10111 i2c device required to measure temperature and pressure.

New GCODES could look something like F85 P<sensor type> for reading a sensor. and R85 P<sensor type> V<sensor value> for the report from the firmware.

Types would be: 0 - temperature 1 - pressure

We may also need to add new params for Celsius and Fahrenheit.

param name param number param value example
SENSOR_TEMPERATURE_UNITS 224 0 for Celsius 1 for Fahrenheit F22 P224 V0

read temperature ( Celsius )

F85 P0
R85 P0 V20.33

read pressure ( kpa?)

F85 P1
R85 P1 V101.35

I've only lightly tested the sensor but sending 0x68, 0x25 to i2c address 0x63 resulted in 2 bytes for temperature, 4-1 bytes for pressure.

bonus points

The sensor also exposes calibration values. Maybe we need to implement this as well?