The Sonar Brick is based on the popular HC-SR04 Ultrasonic Sensor. It is 3.3V compatible, and measures from 2cm to 400cm.
Parts list
Type | Quantity |
---|---|
HC-SR04 Ultrasonic Sensor | 1 |
4-pin JST XH connector (male) | 1 |
M2 self-tapping screw | 4 |
Circuit
Solder the JST XH connector to the sensor module. Desolder the pin header, or cut off the pins with a cutter, leaving just enough at the ends for soldering. Connect the yellow wire to the TRIG pin, and the white wire to the ECHO pin. Red wire connects to VCC, and black wire to GND, by convention.
Print out the two halves of the wire connector on a 3D printer, and encase the solder joints with the wire connector using a bit of hot glue.
Enclosure
Print out the parts of the enclosure on a 3D printer.
Sit the module on the back piece.
Align with front piece, and secure with 4 x M2 screws.
Line up three 2x1 brickbases on a faceplate, two rows apart. Surround the brickbases with a few other bricks to assist in alignment.
Add two drops of superglue on each brickbase and mount the module. Press and hold for 60s.
The finished module: