In my Raspberry Pi project, I need to measure a distance. To do that, I have an ultrasound sensor called "AJ-SR04M" (it is basically a waterproof HC-SR04 I believe).
Characteristics of the AJ-SR04M:
- Supply voltage: 5 V
- Working current: 30 mA
- Max. detection distance: 4.5 m
- Resolution: 0.5 cm
- Blind distance: 25 cm
As I already have other sensors (including a camera module) connected to the Pi, I fear the Pi might not be able to source the current required by the ultrasound sensor. That's why I purchased an external power supply board, the "Power MB v2".
Picture of the AJ-SR04M sensor:
Description of the wiring:
- Sensor's VCC is connected to the power supply board 5V output
- Sensor's TRIG is connected to the Pi GPIO 26 (output mode)
- Sensor's ECHO is connected to a voltage divider and then to the Pi GPIO 19 (input mode)
- Sensor's GND is wired with one of the Pi GND PINs and the power supply board GND
I have two questions:
- Is it okay to wire together the GND of all the devices as I did above? Will it work as expected?
- Since the Raspberry Pi GPIO PINs work with 3.3V, I had to build a voltage divider to convert the 5V output of the sensor to 3.3V. Assuming the left-most resistor on the breadboard is 2K ohm and the right-most resistor is 1K ohm, did I do right?