open-horizon-services / service-liquid-prep

3 stars 4 forks source link

Update esp-now-gateway, mesh-bluetooth-toggle & mesh-bluetooth with option to update pin number #70

Closed playground closed 1 week ago

playground commented 10 months ago

To accommodate the PlantMate sensor, we need to listen on pin 36. While you're at it, I had updated https://github.com/Liquid-Prep/LiquidPrep-Hardware/pull/27 to pass the capacitance value to the esp-now-gateway, can you also pass capacitance value to express server via websocket?

image

ESP32 - Plantmate Moisture Sensor Test Code:

 * Planmate Moisture Sensor Micro USB adapter to ESP32 PIN connection:
 * 1. GND to GND
 * 2. ID (N/A)
 * 3. D+ to GPIO36
 * 4. D- to GPIO36
 * 5. VCC to 3.3V

#define AOUT_PIN 36 // ESP32 pin GPIO36 (VP)
void setup() {
Serial.begin(9600);
}
void loop() {
int value = analogRead(AOUT_PIN); // read the analog value from sensor
Serial.print("Moisture value: ");
Serial.println(value);
delay(500);
}

image

image