|
DHT-22FLAT |
x 1 | |
|
LDR-3535CNZ V310-M0VB0L0LEDESTAR
|
x 1 | |
|
ESP8266 4MB WIFI 开发板 |
x 1 | |
|
Breadboard 830 Point Solderless PCB Bread Board MB-102 MB102 Test Develop DIY |
x 1 | |
|
0797580016Molex
|
x 1 |
|
arduino IDEArduino
|
|
|
ThingSpeakThingSpeak
|
Smart weather station
Step into the future of weather monitoring with our Smart Weather Station. This innovative device combines advanced sensors and cloud-based platforms to provide a comprehensive solution for collecting, analyzing, and sharing real-time weather information.
Key Features:
Precision Sensors:
Equipped with high-precision sensors, our Smart Weather Station captures accurate data on temperature, humidity, atmospheric pressure, wind speed, and more. Get real-time insights into the ever-changing weather conditions with unparalleled accuracy.
Seamless Connectivity:
Connect to the station effortlessly via wireless technology, ensuring hassle-free integration into your digital ecosystem. Whether you're at home, in the office, or on the go, stay informed about local weather conditions with ease.
Cloud-Based Analytics:
Leverage the power of cloud-based platforms for in-depth data analysis. Our Smart Weather Station not only collects data but also employs sophisticated analytics tools to provide meaningful insights, trends, and forecasts for a comprehensive understanding of local weather patterns.
User-Friendly Interface:
Access the weather data through an intuitive and user-friendly interface, whether on your computer, tablet, or smartphone. Stay informed with easy-to-understand visuals and customizable notifications tailored to your preferences.
Real-Time Sharing:
Share real-time weather updates effortlessly with friends, family, or the broader community. Enhance community awareness, plan outdoor activities with confidence, and contribute to a network of weather enthusiasts.
#include <DHT.h> // Including library for dht
#include <ESP8266WiFi.h>
String apiKey = "0F6JN171PZJU8SGT"; // Enter your Write API key from ThingSpeak
const char *ssid = "dekut"; // replace with your wifi ssid and wpa2 key
const char *pass = "dekut@ict2023";
const char* server = "api.thingspeak.com";
const int LDR_PIN = A0; // Define the analog pin connected to the LDR
const int rainSensorPin = D2; // Digital pin connected to the rain sensor
#define DHTPIN 0 //pin where the dht11 is connected
DHT dht(DHTPIN, DHT11);
WiFiClient client;
void setup()
{
Serial.begin(115200);
delay(10);
dht.begin();
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
}
void loop()
{
int ldrValue =analogRead(LDR_PIN); // Read the LDR value
Serial.print("LDR Value: ");
Serial.println(ldrValue);
int sensorValue = analogRead(rainSensorPin); // Read the analog value from the rain sensor
float voltage = sensorValue*(3.3/1023); // Convert analog value to voltage (adjust for your VCC)
// Use a calibration factor based on your specific sensor and environment to convert voltage to rainfall in mm
float rainFallMM = voltage * 100; // Example calibration factor: 100 mm/V
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server,80)) // "184.106.153.149" or api.thingspeak.com
{
String postStr = apiKey;
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr +="&field3=";
postStr += String(ldrValue);
postStr +="&field4=";
postStr += String(rainFallMM);
postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" Voltage (V): ");
Serial.print(voltage, 2); // Display voltage with 2 decimal places
Serial.print(" Rainfall (mm): ");
Serial.println(rainFallMM, 2); // Display rainfall with 2 decimal places
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Celcius, Humidity: ");
Serial.print(h);
Serial.print("ldrValue: ");
Serial.print(ldrValue);
Serial.println("%. Send to Thingspeak.");
}
client.stop();
Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates
delay(1000);
}
Smart weather station
- Comments(0)
- Likes(1)
- Vic Jan 16,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Vic
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
124 0 0 -
DIY Laser Power Meter with Arduino
172 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
162 0 2 -