BerrySonar: DIY LIDAR System Development

Teodor Moldoveanu

πŸ“ 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.
sudo apt install gpio -y || sudo apt install wiringpi -y && sudo apt install libgpiod-dev -y

Download the release

Download the application from the repository Release section and run the application as sudo
sudo -i && ./BerrySonar

πŸ”© 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
Like this project

Posted 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.

GitHub - CSharpTeoMan911/ThetaFTP
GitHub - CSharpTeoMan911/ThetaFTP
CSharpTeoMan911/WeatherPrediction
CSharpTeoMan911/WeatherPrediction
CSharpTeoMan911/2_Large_Networks_With___DHCP___VOIP___TELNET___…
CSharpTeoMan911/2_Large_Networks_With___DHCP___VOIP___TELNET___…

Join 50k+ companies and 1M+ independents

Contra Logo

Β© 2025 Contra.Work Inc