I've got a Pimoroni Display-O-Tron 3000 and a HC - SR04 ultrasonic sensor. I want to use the Display to output the distance that the ultrasonic sensor reads. However, the DOT 3000 uses all the 5v pins. How can I get the vcc of the HC-SR-04 onto 5v, does it even need to go on the pi's 5v or can use a 6v battery and a resistor?

According to this, I shouldn't connect it to a 3v3 pin otherwise I might undervolt it:

I can't give you guys a picture, otherwise I would have, but the display-o-tron uses up the first 26 of 40 pins on the Pi. I am using a Pi 2, I am fairly new to electronics so please explain it understandably.


The HC-SR04 specifications say it needs a voltage between 4.5 and 5.5.

Using 6V will likely destroy the sensor.

You need to split off the 5V supply from the Pi, for that you need 5V and a ground. To operate the sensor you also need two GPIO, one (OUTPUT) for the trigger and one (INPUT) for the echo.

You can get ground from pins 30, 34, and 39 on the Pi2. GPIO 5 and 6 are available on pins 29 and 31. You just need female to female Dupont jumper wires to connect those pins to the sensor (but see echo pin note below).

For the 5V supply I would strip one end of a female to female Dupont jumper wire. I would solder the stripped end to the underside of the Pi to one of the 5V pins.

Please note that the sensor echo pin will be 5V which will eventually kill a Pi GPIO as they are only rated for 3V3. You need to drop the echo pin voltage from 5V to 3V3, perhaps by using a pair of resistors as a voltage divider.

| improve this answer | |
  • Is there anything I can do without soldering, maybe a breadboard or something like that, would i be able to increase the voltage from a 3v3 pin to 5v? – ChK Jan 31 '16 at 14:29
  • The simplest would be to power the sensor from an external power supply of the correct voltage. You would still need to link the sensor ground, the power supply ground, and the Pi ground, but that wouldn't require soldering. Do you have an accessible 3V3 pin? You could buy a boost converter to raise it to 5V. E.g. ebay.co.uk/itm/272041588474 – joan Jan 31 '16 at 14:39
  • Great! Thanks for your help! @joan Just confirming, I could use an external power supply, right? – ChK Jan 31 '16 at 14:57
  • Yes, an external power supply will be fine. – joan Jan 31 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.