/BikeParkingSensor

Ultrasonic occupancy sensor for the MakeZürich #BicycleParking challenge

Primary LanguageC++MIT LicenseMIT

Table of Contents

About The Project

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.

Built With

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

Getting Started

Prerequisites

Installation

  1. Create a TTN Application
  2. Register a device
  3. Use ABP authentification method and replace the needed values in main.cpp
  4. 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;
}
  1. Connect the HC-SR04 sensor to the TTGO board 5V-VCC,GND-GND,23-TRIG,19-ECHO
  2. Flash Firmeware

License

Distributed under the MIT License. See LICENSE for more information.