Skip to content

Instantly share code, notes, and snippets.

@jenschr jenschr/HiGrow_basics.ino
Last active Jul 22, 2019

Embed
What would you like to do?
Very basic Arduino example for testing the HiGrow board based on ESP32, DHT11 and a capacitive moisture sensor
/*
* Very basic Arduino example for testing the HiGrow board based on ESP32, DHT11 and a capacitive moisture sensor
*
* Details on the hardware and how to use it can be found on:
* http://flashgamer.com/blog/comments/higrow-esp32-moisture-and-temperature-sensor#capacitive
*/
#include "DHT.h"
#define DHTTYPE DHT11
const int LEDPIN = 16;
const int DHTPIN = 22;
const int SOILPIN = 32;
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
}
void loop() {
int waterlevel = analogRead(SOILPIN);
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();
float hic = dht.computeHeatIndex(temperature, humidity, false);
Serial.print("waterlevel: ");
Serial.print(waterlevel);
Serial.print(" humidity: ");
Serial.print(humidity);
Serial.print(" temperature: ");
Serial.print(temperature);
Serial.print(" hic: ");
Serial.println(hic);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.