rbx sonar assembled

The Sonar Brick is based on the popular HC-SR04 Ultrasonic Sensor. It is 3.3V compatible, and measures from 2cm to 400cm.

ultrasonic hc sr04

Parts list

HC-SR04 Ultrasonic Sensor 1
4-pin JST XH connector (male) 1
M2 self-tapping screw 4


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.

rbx sonar circuit 01

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.

rbx sonar circuit 02


Print out the parts of the enclosure on a 3D printer.

rbx sonar 3dview

Sit the module on the back piece.

rbx sonar assembly 02

Align with front piece, and secure with 4 x M2 screws.

rbx sonar assembly 02

Line up three 2x1 brickbases on a faceplate, two rows apart. Surround the brickbases with a few other bricks to assist in alignment.

rbx sonar assembly 03

Add two drops of superglue on each brickbase and mount the module. Press and hold for 60s.

rbx sonar assembly 04

The finished module:

rbx sonar assembled