![esp32-fritzing esp32-fritzing](https://draeger-it.blog/wp-content/uploads/2019/04/aufbau_schaltung_esp32_cam_ftdi_modul.png)
![esp32-fritzing esp32-fritzing](https://www.electronics-lab.com/wp-content/uploads/2018/10/bazaar938881_esp32cam0.jpg)
how often and how much current is passed through electrodes of the rain board.How strong the electrolysis will be depends on three different factors:
Esp32 fritzing serial#
To view the time series chart of the analog rain sensor we print the analog and digital value to the serial output and with a short delay of 200 milliseconds we pause the script at the end before the loop is executed again.ĭue to the current flow and the contact with water, the rain sensor will build rust from electrolysis that damages the sensor and makes the sensor inaccurate. Then I read also the digital value, with the build in function digitalRead() and store the digital value in the variable rainDigitalVal that has the following values: In the loop function I create the variable rainAnalogVal as integer and read the analog value from the analog pin with the build in function analogRead(). Also I have to set the digital pin as input because I want to read values at these pin. In the setup function I set the baud rate of the serial connection to 9600 that have to match to the serial output setting of the Arduino IDE to print the values. If you use an ESP8266 or ESP32 microcontroller uncomment the lines of code and comment the definition of the Arduino pins. They are included in the script but commented. In my case I use the pin A1 for the analog connection and D2 for the digital connection of the Arduino microcontroller as you see in the fritzing sketch of the Arduino Uno.įor the ESP8266 NodeMCU and WeMos D1 Mini and also for the ESP32, the definition of the analog and digital pins differ. The first step of the Arduino script is to define the analog and the digital pins that connect the microcontroller and the control board.