This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.
This is a basic example and you may need to adjust the code based on your specific sensor and wiring.Fi, and ThingSpeak.
This is a basic example and you may need to adjust the code based on your specific sensor and wiring.
#include
#include
#include
#include
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* server = "api.thingspeak.com";
unsigned long channelId = your_channelId;
const char* writeAPIKey = "your_writeAPIKey";
Adafruit_MCP9808 tempsensor;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
ThingSpeak.begin(client);
tempsensor.begin();
}
void loop() {
float pH = analogRead(A0);
ThingSpeak.setField(1, pH);
int x = ThingSpeak.writeFields(channelId, writeAPIKey);
if (x == 200) {
Serial.println("Channel update successful.");
} else {
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
delay(5000);
}
item below using.
1.temperature probe NTC 10k ,
2.Liquid PH Value Detection Detect Regulator Sensor Module 3. EC probe
my E_mail mantrahealing@gmail.com
Thank you very much.