Sonar Proximity Audio Alert for Robot
Purpose
This project uses a sonar sensor attached to a robot controlled with a bluetooth module to check distance from the edge of the robot to an obstacle in its path and alerts the user with increasingly louder audio output as it gets closer to the obstacle.
Program
Import programlab4
Sonar Proximity Audio Alert for Robot
Connections
Connections for Pololu MOSFET H-Bridge Module:
H-Bridge | mbed | Motors | External Power Supply |
---|---|---|---|
PWMA | p21 | ||
VMOT | 5V | ||
AIN2 | p19 | ||
AIN1 | p20 | ||
STBY | Vout | ||
BIN1 | p15 | ||
BIN2 | p14 | ||
PWMB | p22 | ||
GND | GND | GND | |
VCC | Vout | ||
AO1 | Left Wheel + Lead | ||
AO2 | Left Wheel - Lead | ||
BO2 | Right Wheel - Lead | ||
BO1 | Right Wheel + Lead |
Connections for the HC-SR04 Ultrasonic Sonar Sensor:
Sonar | mbed | External Power Supply |
---|---|---|
VCC | 5V | |
TRIG | p6 | |
ECHO | p7 | |
GND | GND | GND |
Connections for Adafruit Bluefruit LE UART Friend - Bluetooth Low Energy Module:
Adafruit BLE | mbed |
---|---|
GND | GND |
VIN | VU |
RTS | nc |
CTS | GND |
TXO | p27 |
RXI | p28 |
Connections for Speaker with 2N3904 Amplifier
Speaker | 2N3904 NPN General Purpose Amplifier | mbed |
---|---|---|
+ | Vout | |
- | Collector | |
Emitter | GND | |
Base | 220-1k Resistor in Series to p23 |
Video Demonstration
Please log in to post comments.