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