Things used in this project


Code snippet #1Arduino
<p>#include "DHT.h"<br>//#define CAYENNE_DEBUG         // Uncomment to show debug messages<br>#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include </p><p>#define DHTPIN 8     // what digital pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321</p><p>#define VIRT_TEMP V1
#define VIRT_HUM V2</p><p>// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "your toker";</p><p>DHT dht(DHTPIN, DHTTYPE);
unsigned long prev_DHT_refresh, interval_DHT_refresh = 1000;</p><p>void setup()
  Cayenne.begin(token);</p><p>  dht.begin();
}</p><p>void loop()
{;</p><p>  getDhtValues();</p><p>}</p><p>void getDhtValues() {
    unsigned long now = millis();
  if (now - prev_DHT_refresh > interval_DHT_refresh) {
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    float h = dht.readHumidity();
    // Read temperature as Celsius (the default)
    float t = dht.readTemperature();</p><p>    // Check if any reads failed
    if (!isnan(h) && !isnan(t)) {
      Cayenne.virtualWrite(VIRT_HUM, h);
      Cayenne.celsiusWrite(VIRT_TEMP, t);
    prev_DHT_refresh = now;
Code snippet #9SH

while [ true ]; 

do filename=-$(date -u +"%d%m%Y_%H%M-%S").jpg
/opt/vc/bin/raspistill -o $SAVEDIR/$filename
sleep 3600;



Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

ESP8266 NodeMCU WiFi IoT Garage Door Opener Relay with Cayen
  • 13
  • 2

In this project, we will use an ESP8266 with Cayenne to control a Garage Door Opener.

Water Softener
  • 176
  • 5

Full instructions

Sweeping frequency magnetic hard water conditioner

Simple Obstacle Senor With Arduino
  • 61
  • 2

Full instructions

I am Gonna show you how to make a Simple obstacle sensing system with cheap parts like IR led and Photo diode.

Know the Temp of Your Home From Anywhere with Arduino Cloud!
  • 1,027
  • 9

Full instructions

Ever wanted to know the temperature of your home from somewhere? Here's an easy way to do it with Arduino Cloud and the Yun Shield!

IoT Water Control and Monitor Using NodeMCU & Cayenne
  • 4
  • 1

I'll try to create IoT water control and can be monitoring using Cayenne.

Test Your Internet Speed Using a Raspberry Pi + Ubidots
  • 275
  • 4


Use your Raspberry Pi to measure any internet connection speed with Ubidots.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog