This is a small ultrasonic sensor created during MakeZürich for the #BicycleParking challenge. The goal is to detect if a bicycle parking spot is occupied using an ultrasonic distance sensor.
The built using TTGO Lora32 board and a HC-SR04 sensor. PlatformIO is us used to develop and flash the firmeware for the board and data is transmitted to The Things Network
- Install PlatformIO
- Create a The Things Network (TTN) Account https://account.thethingsnetwork.org/
- Create a TTN Application
- Register a device
- Use ABP authentification method and replace the needed values in main.cpp
- Create a decoder in TTN
function Decoder(bytes, port) {
var decoded = {};
decoded.occupied = !!bytes[0]
decoded.distance = bytes[1]
decoded.rack = bytes[2];
return decoded;
}
- Connect the HC-SR04 sensor to the TTGO board 5V-VCC,GND-GND,23-TRIG,19-ECHO
- Flash Firmeware
Distributed under the MIT License. See LICENSE
for more information.