IoT on Your Raspberry Pi

Running the IoT Device

From the Raspberry Pi SunIOT directory, start the software by typing:

sudo python SunIOT.py

Your results should look like Listing 5.

Listing 5

SunIOT.py Output

-----------------
SunIOT
SwitchDoc Labs
-----------------
-----------------
Scheduled Jobs
-----------------
Jobstore default:
    blinkLED (trigger: interval[0:00:05], next run at: 2016-10-17 20:50:45 UTC)
    readSunLight (trigger: interval[0:00:10], next run at: 2016-10-17 20:50:50 UTC)
    tick (trigger: interval[0:01:00], next run at: 2016-10-17 20:51:40 UTC)
-----------------
Press Ctrl+C to exit
SunLight Sensor read at time: 2016-10-17 20:50:50.742733
    Vis:             261
    IR:              257
    UV Index:        0.02
SunLight Sensor read at time: 2016-10-17 20:51:00.741888
    Vis:             269
    IR:              279
    UV Index:        0.05
SunLight Sensor read at time: 2016-10-17 20:51:10.743216
    Vis:             262
    IR:              258
    UV Index:        0.03
SunLight Sensor read at time: 2016-10-17 20:51:20.740935
    Vis:             261
    IR:              257
    UV Index:        0.02

I turned on a light on the sensor between the first and the second readings to make sure the sensor was reading correctly. Notice that there's not much UV light inside SwitchDoc Labs! No way to get a suntan here, but I wonder what the sensor would read inside a tanning bed.

Conclusion

Now that the IoT sensing device is built and tested, I'm ready to add other sensors (not quite sure which, yet; I have so many choices!).

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content