0
\$\begingroup\$

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 Raspberry Stackexchange 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 turn on / off a 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 of the Raspberry and using another 3.3V GPIO pin to "activate" some sort of switch...

I really have no electronics background so don't hesitate to start from scratch.

\$\endgroup\$
1
\$\begingroup\$

There may not be enough current available on the pins 2&4 "GPIO" (actually power pins). The Velleman relay should draw less than 100mA when on.

The +5V is drawn directly from the USB port with a resettable fuse in series. Looks like a 2A fuse on yours (which means it might trip at 1.5 or 1.3A at elevated temperature). The current is also limited by what the USB can supply. So if you look at those two limits and take the smaller you may get some idea.

There is insufficient information on the Velleman to determine if it will work reliably from a 0V/3.3V signal. No specification and no schematic.

I would guess it might work well enough for you but that's a guess. If you hook it up correctly it shouldn't hurt anything, but you may not be able to tell if it is marginal.

\$\endgroup\$
0
\$\begingroup\$

In general if you need to switch a relay on and off and the Raspberry Pi can't provide enough power for your situation, use a simple TTL relay driver or something similar (you can look up a schematic).

This allows you to control your relay using the logic from your controller without exceeding the current rating of the GPIO port. The transistor allows you to get extra output current from your external supply while still letting you to control it with lower voltage/current at the input (GPIO).

\$\endgroup\$
  • 1
    \$\begingroup\$ There are many boards available for very cheap. "Relay module" might be a good search term. \$\endgroup\$ – wiebel Jun 5 '18 at 8:52

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.