IoT Raspberry Pi project built on Microsoft IoT Core platform in Visual Studio Community 2015 using a tilt sensor and LEDs. One LED lights up based on if the tilt sensor senses tilt (on if yes, off if no). Another LED lights up periodically to signify a check if there is tilting or not. If at those checks the tilt sensor is tilting, then that will be recorded as a tilt. After a certain number of tilts, the third LED will light up to signal a notification is being sent to Azure Event Hub.
- Raspberry Pi 2 Model B v1.1
- Tilt Sensor (ex. Keyes KY-020)
- Windows 10 IoT Core
- Windows UWP App on Pi
- Windows UWP IoT Extension
- Azure IoT Hub
- Azure Stream Analytics Job
- Azure Event Hub
- Azure Logic App
- Office 365
-
Create a Stream Analytics Job with input from the IoT Hub and output to the queue with the query
SELECT * INTO [tiltsensoroutput] FROM [tiltsensorinput] WHERE IotHub.ConnectionDeviceId LIKE 'TiltSensor'
-
Create a Logic App to trigger on new message in the queue and send to email, SMS with twilio, or to do whatever you'd like!
- Download all of the files in the repository
- Open the solution in Visual Studio
- Update the local_settings.cs file with your device connection string and save it
- Change the run mode in Visual Studio to Remote Machine
- Update the IP Address of the Remote Connection
- (Option A). If the Remote Connection window appeared after step 4, update the IP address with your IoT device IP address
- (Option B) Otherwise, double click on Properties in the Solution Explorer and update the Debug section with your IoT device's IP address
- Nuget packages may need to be restored and project may need to be built or rebuilt and few times.
- Run the project on the Remote Machine
- Follow the instructions here to begin a PowerShell connection to the device (have patience here)
- Use the commands here to set the startup project
- For this project, you will need to find the name of the project after it has been deployed to the device by using
IotStartup list headless
- Then, use the command
IotStartup startup headless [Task1]
and paste in the name of the project for[Task1
]
- For this project, you will need to find the name of the project after it has been deployed to the device by using