Agnes Anna AjoSamia FizaJoita Singhasnigdh sinha
Published © GPL3+

"SmartStick — An Ultrasonic Blind Stick Using Raspberry Pi P

Every day, millions of visually impaired people struggle to navigate safely. Our project SmartStick is a low cost smart blind stick that use

IntermediateFull instructions provided2 hours4
"SmartStick — An Ultrasonic Blind Stick Using Raspberry Pi P

Things used in this project

Hardware components

Pi Adaptor
Breadboard Mates Pi Adaptor
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Raspberry Pi Zero
Raspberry Pi Zero
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1

Software apps and online services

Thonny
MicroPython
MicroPython

Hand tools and fabrication machines

nothing

Story

Read more

Custom parts and enclosures

Smart blind stick

Schematics

Smart blind stick

Code

Smart blind stick

MicroPython
from machine import Pin, time_pulse_us
import utime

# ── Pin Setup ──────────────────────────────────────
TRIG = Pin(0, Pin.OUT)   # Ultrasonic Trigger → GP0
ECHO = Pin(1, Pin.IN)    # Ultrasonic Echo   → GP1
BUZZ = Pin(15, Pin.OUT)  # Buzzer Positive   → GP15

# ── Distance Thresholds (in cm) ────────────────────
DANGER_DIST  = 30   # Very close  → fast beep
WARNING_DIST = 80   # Medium close → slow beep

# ── Get Distance Function ──────────────────────────
def get_distance():
    TRIG.low()
    utime.sleep_us(2)
    TRIG.high()
    utime.sleep_us(10)
    TRIG.low()
    duration = time_pulse_us(ECHO, 1, 30000)
    if duration < 0:
        return None
    distance = (duration * 0.0343) / 2
    return round(distance, 2)

# ── Buzzer Beep Function ───────────────────────────
def beep(on_time, off_time):
    BUZZ.high()
    utime.sleep_ms(on_time)
    BUZZ.low()
    utime.sleep_ms(off_time)

# ── Main Loop ──────────────────────────────────────
print("Blind Stick Started...")

while True:
    dist = get_distance()
    if dist is None:
        print("No object detected")
        BUZZ.low()
        utime.sleep_ms(200)
    else:
        print("Distance:", dist, "cm")
        if dist <= DANGER_DIST:
            beep(on_time=100, off_time=100)
        elif dist <= WARNING_DIST:
            beep(on_time=200, off_time=500)
        else:
            BUZZ.low()
            utime.sleep_ms(200)

Credits

Agnes Anna Ajo
1 project • 0 followers
Samia Fiza
1 project • 0 followers
Joita Singha
1 project • 0 followers
snigdh sinha
1 project • 0 followers
Thanks to Umesh Dutta .

Comments