This Sample Appliaction get the data of celsius, pressure and humidity data from BME 280 sensor on Raspberry Pi(Raspberry Pi 2 Model B). After receved it, the application push the data to Azure IoT Hub.I also configure the Stream Analytics and PowerBI on Azure separatelly.As a result, we can confirm the data on PowerBI dashboard.
And also, I put the PIR motion sensor, camera and LED on RasPi. So if something had moved in front of motion sensor, it detected and turn on the LED and automatically take the phone of front of the camera. After take the photo, it upload the image to Azure Storage Blob.
After uploaded the image, it send the URL to Cognitive Services as Face API and Emotion API. After received the result of analysis data, it showes the result to standard output as follow.
-
- Need to create Azure IoT-Hub, Azure Storage on Azure.
-
- Need to get the access key for both above services.
-
- You need to create and get the Subscription ID of Cognitive Services.
-
- Get the source code from GitHub
-
- After get both access keys and subscription IDs, Please Edit the property files?
-
- Build the Application
-
- Confirm the build binary
$ cd RaspberryPi-To-Azure-IoT-Hub/target/
$ ls
-
- Copy the file to Raspberry Pi by scp
$ scp RaspberryPi-To-Azure-IoT-Hub-1.0-SNAPSHOT.jar [email protected]:/home/pi/
-
- SSH Login to the Raspberry Pi
$ ssh -l pi 192.168.1.100
-
- Execute the Application on Raspberry Pi
$ sudo java -jar RaspberryPi-To-Azure-IoT-Hub-1.0-SNAPSHOT.jar
LED | Raspberry Pi |
---|---|
anode (+) | registor (Ω) |
cathode (-) | Grand |
registor | GPIO 1(pin12) |
There is no need to connect "5.0 VDC Power (pin2)" in this time.
BME 280 | Raspberry Pi |
---|---|
VIN | 5.0 VDC Power (pin2) |
GND | Ground(pin6) |
SCK | GPIO 9 SCL1(I2C:pin5) |
SDO | Ground(pin6) |
SDI | GPIO 8 SDA1(I2C:pin3) |
PIR Motion Sensor | Raspberry Pi |
---|---|
+DC Voltage | 5.0 VDC Power (pin2) |
Output | GPIO 4(pin16) |
GND | Ground(pin6) |
###Pleaase note : For PIR motion sensor, you need to adjst the default sensor setting.
- I changed the Retriggering setting from "Low" to "High" by change the jumper pin. Please refer to the Testing a PIR of https://learn.adafruit.com?
- There is two yellow adjuster on the PIR Motion sensor. One is Sensitivity Adjust and the others is Time Delay Adjust. Please adjust by using yellow adjuster for your environment ?