Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Adrienne Braganza Tacke
Published © GPL3+

Visual Proximity Alert with HC-SR04, RGB LED, and Pi 4

Build a visual proximity alert using an ultrasonic sensor and RGB LED.

BeginnerFull instructions provided1 hour210

Things used in this project

Hardware components

Raspberry Pi 4 Model B
Raspberry Pi 4 Model B
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
You'll need 12 total jumper wires, not 12 packs!
×12
Raspberry Pi Power Supply
×1
Flash Memory Card, MicroSD Card
Flash Memory Card, MicroSD Card
×1
Resistor Pack
You'll need a total of 5 resistors: 1 - 1K Ohm, 1 - 2K Ohm, 1 - 100 Ohm, and 2 - 10 Ohm
×1

Software apps and online services

Raspberry Pi Imager
Viam Platform
Viam Robotics Viam Platform

Story

Read more

Schematics

Full proximity alert wiring diagram

This shows the completed wiring diagram for the proximity alert. It shows how to wire the ultrasonic sensor, RGB LED, and Raspberry Pi together via a solderless breadboard.

Ultrasonic sensor wiring diagram

This shows the ultrasonic sensor wire diagram in isolation.

RGB LED wiring diagram

This shows the RGB LED wire diagram in isolation.

Code

Proximity Alert (Viam module) GitHub repo

This is the GitHub repo for the proximity alert module used in this project. You can customize your own module or make changes to this one by using this repo as a starting point.

Credits

Adrienne Braganza Tacke
1 project • 3 followers
Developer Relations at Viam
Contact

Comments

Please log in or sign up to comment.