I want to use my Raspberry Pi to turn on and off a 12V current for a certain amount of time. I've read a lot on this forum and I've understood that the 5V GPIO Pin is... Not GPIO, meaning that I cannot turn it on and off.

I am not an electronics expert, but I've already learned how to use GPIO to control stuff like Led, or simply closing circuits, using this tutorial (french) : http://blog.idleman.fr/raspberry-pi-06-utiliser-le-gpio-et-interagir-avec-le-monde-reel/

But now I need to transform 5V current into 12V current for about 8 seconds.

I have a Rasberry Pi 3 Model B V 1.2.

I also have this relay : https://www.velleman.eu/downloads/29/vma406_a4v02.pdf

My question is : Could I use GPIO ports to open / close the relay safely ? I imagine plugging the relay into the 5V pin and using another 3.3V GPIO pin to control it.

If I can't do this with Raspberry, I'd like to try with Arduino, so any advice is welcome.

3 Answers 3


It may work, if I had to guess I'd say it would work.

There should be no problem powering the relay from a Pi 5V pin (and a Pi ground pin).

It will be quite safe to connect a Pi GPIO to the relay signal pin.

The only question is whether a Pi GPIO high (3V3) will be enough to be seen as high by the relay logic. A lot of devices see the minimum high as 70% of the device voltage. In this case the device is being powered from 5V and 70% of 5V is 3V5. That is slightly above the Pi GPIO 3V3.

You will have to try.


There is no such thing as "12V current" or "5V current" and you can NOT control a relay from a Pi (or an Arduino for that matter), neither can you "transform 5V current into 12V current".

You can use a relay to switch 5V, 12V or even mains voltages.

There are large numbers of relay modules, which consist of a relay and some electronics to switch this from a logic level. Most such modules can be controlled by the Pi, although there are some poorly designed "Arduino" modules which need 5V control.

It is also possible to control a 5V relay from the Pi using a transistor - see https://elinux.org/RPi_GPIO_Interface_Circuits

  • Thank you for the link ! Also, sorry for the wrong terms, I'm a web developper, not an electronics guy. I'm learning, though. So with this relay, do you think I could use a transistor ? I'm not too familiar with that kind of stuff, explanations would be truly appreciated. velleman.eu/downloads/29/vma406_a4v02.pdf
    – Nico
    Jun 4, 2018 at 9:58
  • @Nico I might follow a link in a question, but it is unrealistic to expect anyone to download a pdf file then read it to find out what you are using, so I provided a generic answer which should enable you to decide if it is suitable.
    – Milliways
    Jun 4, 2018 at 10:05
  • The PDF is three pages long including one page with a picture of the relay, I provided it so that people more qualified than me can help me understand what I have to do. I also provided it so that people don't have to ask what relay I am using.
    – Nico
    Jun 4, 2018 at 10:22

Most of us use off-the-shelf solutions such as PiMoroni Automation Hat or AdaFruit FeatherWing non-latching relay. I've used both to switch 12V water pump from my Pi. If you don't use the standard solutions, you will need to be careful about the relay triggering voltage. Arduino relays trigger at 5V. Pi Relays trigger at <3.3V. The confusing thing to watch out for is that some relays are marketed as "3V relays", which sounds like they should work with the Pi but the reality is that they often do not given the lack of quality control on cheap relays.

The relay in your PDF will likely only work with an Arduino since it has the 05VDC lettering on it.

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.