Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water. Hi all, I own a SP-110 Apogee sensor. I am working the sensor with DOIT ESP32 Devkit Board V1. Could anyone please check the code and see if the code is done correctly? Do I need to include any library in the code? Thanks in advance. Rgds, Storm
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
/* code read Apogee SP-110 Solar Radiation Sensor output to the serial terminal. * RED wire: Data line, connect to ESP32 Devkit Board (30 Pin) ADC pin (pin 4) * WHITE and CLEAR/BARE wire: Connected to GND */ const int Analog_pin = 4; int sensorValue = 0; float voltage = 0; void setup() { Serial.begin(115200); } void loop() { sensorValue = analogRead(Analog_pin); // change this to the correct analog pin you're using voltage = (sensorValue * 3.3) / (4095.0); //convert bits to volts (12 bits) //ESP32 ADC bit can be (9 bits/10 bits/11 bits/12bits), //if the ESP32 ADC bit is not been configure then usually is in 12 bits float ShortwaveRadiation = voltage * 5.0; //Apogee SP-110 has calibrated output of 5.0 W/m2 per mV Serial.print ("Voltage: "); Serial.println(voltage); Serial.print(" mV; \n"); Serial.print ("Shortwave Radiation: "); Serial.println(ShortwaveRadiation); Serial.print(" W/m2\n"); delay(1000); } |
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Websites store cookies to enhance functionality and personalize your experience. You can manage your preferences, but blocking some cookies may impact site performance and services
Essential cookies enable basic functions and are necessary for the proper function of the website.
CleanTalk offers effective spam protection and website security solutions to enhance user experience.
Service URL: cleantalk.org (opens in a new window)
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
WooCommerce is a customizable eCommerce platform for building online stores using WordPress.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
SourceBuster is used by WooCommerce for order attribution based on user source.
You can find more information in our Cookie Policy and Privacy Policy.