#cloudgames2022
Use the Opla IoT Kit and a couple sensors to make a smart bike computer!
The On-board screen is used to show readings from the ultrasonic sensor, the speed and the ambient. Button 1 displays the temperature, humidity and pressure, Button 2 displays the ultrasonic sensor readings and Button 3 displays the speed. All this data is also shown on the mobile phone.
USING THE IOT CLOUD.
First of all create a new "thing" on IoT Cloud. You will be presented to this screen:
We will start by creating some variables.
- Temperature (float) (Refresh periodically every one second)
- Humidity (float) (Refresh periodically every one second)
- Pressure (float) (Refresh periodically every one second)
- Light (int) (Refresh periodically every one second)
- Speed (int) (Refresh on change)
- Distance (int) (Refresh on change)
It should look something like this:
Now its time to attach a board. Plug in your board (for this project I'm using a MKR 1010 WiFi board) and follow the on-screen instructions.
Once the board is attached, connect it to your wifi (The wifi connection has to be a hotspot from a mobile phone).
Now, enter the sketch tab and open the code on the full editor. Then paste the code from this project.
It should look like this:
What we are going to do now is delete the ThingPropierties.h tab because its contents are implemented into the code. Now you are ready to upload it into the board!
BUILDING THE DASHBOARD
Now that the board is programed we have to build the dashboard!
Open the Dashboard tab and build a new dashboard.
Press the add button then things and select the Thing we created.
It should look like this:
Now you can change to mobile layout and rearrange the dashboard. Mine looks like this:
HARDWARE CONNECTIONS
Now that all the software is done we can move to the sensors.
The connections for the HC-SR04 Ultrasonic Sensor:
- GND TO GND
- VCC TO 5V
- TRIG TO PIN5
- ECHO TO PIN4
The connections for the GPS Module:
- GND TO GND
- VCC TO 5V
- RX TO TX
- TX TO RX
Thats all! Slide a battery in the battery slot on the IoT carrier and it should start working!
Thanks to Arduino for sending me an Opla IoT kit! And thanks to the Arduino discord for all the help!
Comments