One web request from your sketch, charts you can open anywhere
Send Arduino and ESP32 sensor data to a website
Your Arduino sketch can print a reading to the serial monitor. To see it on your phone, keep a history and get an email when the board goes quiet, have it send each reading to SensorConsole as a web request. An ESP32 or ESP8266 does this in about a dozen lines using the standard HTTP client that comes with the board package. The address accepts plain HTTP, so even boards that cannot do encrypted connections work out of the box.
What you can monitor
- Any value a sketch can read: temperature, humidity, soil moisture, light, distance, pressure, gas, current and more
- Several values in one request, each drawn as its own chart
How to connect Arduino and ESP32 online
- Create a generic push device In SensorConsole, choose Connect a sensor, pick Generic/DIY push, and copy the token from the device page.
- Paste the sketch below Replace the Wi-Fi name, the Wi-Fi password and YOUR_TOKEN. Adjust the sensor pin and the reading function to match your wiring.
- Upload and check the serial monitor A reply of 200 means the reading was stored. It shows on the device page straight away.
- Send every 5 minutes or slower Each device accepts one request every 10 seconds, and a history point is saved every 5 minutes. A faster request gets reply code 429.
#include <WiFi.h>
#include <HTTPClient.h>
const char* WIFI_NAME = "your-wifi-name";
const char* WIFI_PASSWORD = "your-wifi-password";
const char* TOKEN = "YOUR_TOKEN";
const int SENSOR_PIN = 34; // use an ADC1 pin (32 to 39), ADC2 stops working with Wi-Fi on
const int DRY_VALUE = 2900; // reading in dry air, measure your own
const int WET_VALUE = 1300; // reading in a glass of water, measure your own
void connectWifi() {
WiFi.begin(WIFI_NAME, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
}
int readMoisturePercent() {
long total = 0;
for (int i = 0; i < 10; i++) {
total += analogRead(SENSOR_PIN);
delay(20);
}
int raw = total / 10;
return constrain(map(raw, DRY_VALUE, WET_VALUE, 0, 100), 0, 100);
}
void sendReading(int moisture) {
HTTPClient http;
String url = String("http://sensorconsole.com/ingest-generic-push.php?token=")
+ TOKEN + "&soil_pct=" + moisture;
http.begin(url);
int code = http.GET();
Serial.print("Server replied: ");
Serial.println(code);
http.end();
}
void setup() {
Serial.begin(115200);
connectWifi();
}
void loop() {
if (WiFi.status() != WL_CONNECTED) {
connectWifi();
}
sendReading(readMoisturePercent());
delay(300000); // one reading every 5 minutes
}
YOUR_TOKEN is the device token shown on your device page after you create a generic push device.
Use cases
Soil moisture and air temperature from boards around the plot, all on one page.
Temperature and humidity with an email if the board stops reporting.
Wake, send one reading and sleep again with ESP32 deep sleep.
Questions about Arduino and ESP32 and SensorConsole
Can an Arduino Uno send data to a website?
A classic Uno has no network connection. Use an ESP32 or ESP8266, which are programmed from the same Arduino editor, or a board with Wi-Fi built in such as the Uno R4 WiFi or the Nano ESP32.
Do I need HTTPS?
No. The sensor address accepts plain HTTP so small boards can use it. If your board supports HTTPS you can use https in the same address.
How often can my board send?
One request per device every 10 seconds at most. History is saved once every 5 minutes per device, so sending every 5 minutes is plenty for most sensors. Faster requests still update the live value and the daily lowest and highest.
How many values can I send at once?
Up to 20 per request. Every name you send becomes its own chart. Use letters, digits, underscores, dots or hyphens, up to 40 characters.
Are my readings kept?
Yes. History is kept for as long as your account exists, one point every 5 minutes per device, plus daily lowest, highest and average from every reading. You can download it as a CSV file.
Guides
How the data gets there
Arduino or ESP32 sketch → HTTP request → SensorConsole