IoTAssignment 2
IoTAssignment 2
IoTAssignment 2
However, as a chip, the ESP8266 is also hard to access and use. You must
solder wires, with the appropriate analog voltage, to its pins for the simplest tasks
such as powering it on or sending a keystroke to the “computer” on the chip. You
also have to program it in low-level machine instructions that can be interpreted by
the chip hardware. This level of integration is not a problem using the ESP8266 as
an embedded controller chip in mass-produced electronics. It is a huge burden for
hobbyists, hackers, or students who want to experiment with it in their own IoT
projects.
It’s fairly simple to use but requires careful timing to grab data. The only real
downside of this sensor is you can only get new data from it once every 2 seconds,
so when using the library, sensor readings can be up to 2 seconds old.
const char *ssid = "Public"; // replace with your wifi ssid and wpa2 key
const char *pass = "public1234";
const char* server = "api.thingspeak.com";
WiFiClient client;
void setup()
{
Serial.begin(115200);
delay(10);
dht.begin();
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
void loop()
{
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
{
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Celcius, Humidity: ");
Serial.print(h);
Serial.println("%. Send to Thingspeak.");
}
client.stop();
Serial.println("Waiting...");
Conclusions:
In this way, we have designed and implemented environmental parameters
like humidity and temperature monitoring IoT system which keeping records on
Cloud using Thingspeak- IoT cloud platforms successfully.