
π BerrySonar
BerrySonar is a Linux-based C# application developed for the Raspberry Pi, designed to act as a DIY LIDAR-like systemβsimilar in concept to the object detection systems used in autonomous vehicles like Teslas. It uses trigonometry and an ultrasonic sensor rotated by a stepper motor to scan a 180Β° field, detect and display nearby objects. The data is transmitted securely to a Firebase Realtime Database for monitoring and analysis. The GUI of the application is served as a React based application called berry-sonar-view that is getting the LIDAR metadata in real time using Firebase real-time database and rendering the data in a sonar UI element that is drew and rendered dynamically in the browser
π Features
π§ LIDAR-like Scanning β Scans a 180Β° arc using a rotating ultrasonic sensor.
π Stepper Motor Rotation β Uses a 28BYJ-48 stepper motor to rotate the sensor precisely.
π§° Raspberry Pi-Controlled β All hardware is interfaced and controlled via GPIO pins.
βοΈ Firebase Realtime Database β Secure, cloud-based storage of distance and angle data.
π Secure Writes β Only the super-admin can write data.
π Read-Only Access β A restricted admin account can read data.
π§± Tech Stack
Programming Language: C# (.NET Core)
Platform: Linux (Raspberry Pi OS)
Cloud: Firebase Realtime Database
Security: Firebase Authentication & Realtime Database Rules
Communication: GPIO with PWM for motor control & timing for ultrasonic pulse detection
π© Hardware Requirements
π§ Raspberry Pi (any model with GPIO support; tested on Raspberry Pi 3/4)
π HC-SR04 Ultrasonic Sensor β For distance measurement
π 28BYJ-48 Stepper Motor with ULN2003 Driver Board β For rotating the sensor
πͺ Breadboard & Jumper Wires β For circuit connections *π 5V Power Supply β To power the motor and sensor
βοΈ Configuration
π₯οΈ Software Configuration
Driver dependencies
Install the required GPIO drivers using APT.
Download the release
Download the application from the repository Release section and run the application as sudo
π© Hardware Setup
π§± Required Hardware π§ π©
π 28BYJ-48 Electric Stepper Motor
π Tiny but mighty! This 5V stepper motor rotates the ultrasonic sensor to scan the surroundings.

βοΈ ULN2003A Stepper Motor Driver Board
π§ The brain behind the motor! Controls the motor's stepping sequence and power delivery.

π‘ HC-SR04 Ultrasonic Distance Sensor
π The βeyesβ of BerrySonar. Sends sound waves and listens for echoes to measure object distances.

π©π§° Hardware Configuration and Wiring

0 likes Β· 20 views Β· May 5, 2025
BerrySonar is a C# IoT app for Raspberry Pi that scans 180Β° using an ultrasonic sensor and streams real-time distance data to Firebase for cloud visualization.
Timeline
Apr 27, 2025 - May 3, 2025