I recently handle a part of my team project which is hand sanitizer part came up with the idea of using a raspberry pi to power and control the hand sanitizer system. It's nothing large scale, but I want it to automatically spray out to the hand.

So far I have a raspberry pi 4, and mini submersible water pump

But my question is how are they supposed to connect to my pi? Do they connect to it via wires to the breadboard? Do I buys ones with a USB end to connect to my pi? I've read that the pump should be 5V. Can I connect to my pi? Do they have to specifically be for Rpi, or can I use any 5Volt sensors or pumps?

  • You've not provided enough details for a useful answer. Edit your question & add specs on the submersible pump for 1. Voltage, 2, Current. In general you will need to turn the pump ON or OFF using a transistor or a relay. If you don't have a pump yet, you will need to select that, and you will need an external/separate power supply for it.
    – Seamus
    Nov 15, 2021 at 8:08

1 Answer 1


They do not have to be specifically for a raspi. Also, an rpi4 will work, but it is waaay overkill. The same project an be done with a pi zero. With sensors, if they are 5v you need a level shifter. I recommend a 3.3 volt sensor as level shifters are not requierd for 3.3v components. The 74LVC245 level shifter will work for the sensor (If you choose for a 5v model). You can buy the shifters on ebay, amazon, or other such sites. As for the pump, you ought to use a transistior with a seperate 5v power source. You can find the pinout for the shifter online if you are confused. (I trust you have some knowledge abut wiring and elecronics; if not, this project, which you want to undertake, is not for you.)

  • Perhaps I'm missing something, but the OP seems to be asking about connecting a pump - not sensors.
    – Seamus
    Nov 15, 2021 at 22:33
  • I told him he needs to rig the pump with a transistor and a seperate 5v power supply. I gave him an answer for the sensor too if he wants it. The sensor part is just more complex, so it took longer. When I said he would need experience, I was actually referring to the pump. That is harder to set up than the sensor. Nov 15, 2021 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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