How to connect ultrosoniq sensor to a raspberry Pi - aconex-atm/atm-sensor GitHub Wiki
http://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi
HC-SR04 the signal output from the sensor is 5v, It needs us to convert into 3.3V so not to damage our Pi.
How it works: calculate the time it takes to reflect ultrasound waves between the sensor and a solid object.
a ultrasonic sensor consists of one or more ultrasonic transmitters(a speaker), a receiver, and a control circuit.
Connections
- sensor_VCC -> BROWN wire-> positive rail
- sensor_GROUND-> yellow wire -> nagative rail
- Pi GPIO 5v(pin 2) -> green wire -> positive rail
- Pi GND( pin 6) -> black wire -> negative rail
- Pi (GPIO 23, pin 16) -> white wire -> blank rail -> Red wire -> sensor TRIG
- sensor ECHO -> orange wire-> blank rail -> 1K resistor -> 2K resistor -> negative rail
- space between 1k and 2k (same rail) -> blue wire -> Pi GPIO 24 pin 18