Idea:
This project is based on the Paintball game. The main idea is that each of the players wears the T-Shirt to which is attached a Raspberry Pi, a light sensor and color LEDs and takes the toy gun that contains a laser beam emitter. Every player has life points marked with LEDs and each hit he/she gets a life point is lost by turning off one of the LEDs until when all points are gone the player has lost.
Used/Integrated services:
Azure IoT Hub
Components (per player/device):
· 1x Raspberry Pi 2 Model B
· 1x Light sensor im120710017
· 1x Laser beam emitter
· 4x LED
· 4x Resistor 220Ω
· 1x Raspberry Pi Wi-Fi Dongle
· 1x Breadboard
Schematics and circuit diagram:
Pin Assignments:
Light sensor:
Electronic brick of light sensor is mainly used to detect the light intensity in the environment. The control board can get the current light intensity information via analog pins. Generally speaking, the resistance of photoresistor decreases with the increase of the light intensity.
Why this sensor?
1. Plug and play, easy to use. Compatible with the mainstream 2.54 interfaces and 4-Pin Grove interfaces in the market.
2. With use of M4 standard fixed holes, compatible with M4-standard kits such as Lego and Makeblock.
3. With switch to shift between analog and digital output. Able to read the specific light intensity information (analog) or the over-bright or over-dark information according to the threshold (digital). The adjustable potentiometer is used to set the light intensity threshold. With hysteresis comparator circuit for more stable digital output voltage.
4. Detecting direction can be rotated for better adaption
Specs:
Solution architecture:
This solution contains 3 projects:
1- The IoT project (UWP): The projects that runs on the Raspberry Pi
2- The dashboard project (UWP): The desktop application that starts the game and display the scores
3- Registering devices project (Console): This project adds devices to Azure IoT Hub
How to use:
1- First you need to register your device (each player get only one device):
In the LaserFight.AzureIoTHubRegister project, in the Main method add this line of code for each device you’ll be using for the game: AddDeviceAsync("<the device's id that will be given to the player>");
2- Run the LaserFight.ResultsDashboard and add players to the game
3- Run the LaserFight.PlayerDevice and start playing
After the game has finished check the running LaserFight.ResultsDashboard application for the players’ scores
Azure IoT Hub:
Azure IoT Hub is a fully managed service that enables reliable and secure bi-directional communications between millions of IoT devices and an application back end. One of the biggest challenges facing IoT projects is how to reliably and securely connect devices to the application back end. To simplify this scenario, Azure IoT Hub offers reliable device-to-cloud and cloud-to-device hyper-scale messaging, enables secure communications using per-device security credentials and access control, and includes device libraries for the most popular languages and platforms.
To learn more about Azure IoT Hub visit: https://azure.microsoft.com/en-us/develop/iot/get-started/
References:
· Light sensor:
o http://wiki.iteadstudio.com/Light_Sensor_Brick
· Azure IoT Hub:
o https://azure.microsoft.com/en-us/develop/iot/get-started/
o https://azure.microsoft.com/en-us/documentation/articles/iot-hub-csharp-csharp-getstarted/
Comments
Please log in or sign up to comment.