maretodoric
Posts: 21
Joined: Wed May 01, 2019 12:59 pm

Is it possible for RaspberryPi 3 B+ to power a 6V device

Wed Nov 13, 2019 12:25 pm

So just as the title says. I have a 6V device that i would like to attach to raspberry pi, and i would like to know could i power this fine with a 5V GPIO pin or combine something?

What i want to connect is remote for my garage door and simulate key press on remote using raspberry pi relay or GPIO pins, I'll figure that one later after i figure out how to supply power to remote without batteries. Remote is working by using two coupled 3V button batteries. Two batteries are connected in series therefore it should provide 6V to remote.

Basically they are connected something like this
Image

trejan
Posts: 2473
Joined: Tue Jul 02, 2019 2:28 pm

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Wed Nov 13, 2019 1:30 pm

I expect it'll run fine with 5V as it has to account for the batteries running down. Check the voltage on the button contacts before wiring it to the Pi. If it is > 3.3V then you can't connect it directly to the Pi GPIOs.

maretodoric
Posts: 21
Joined: Wed May 01, 2019 12:59 pm

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Wed Nov 13, 2019 4:14 pm

Great, thanks for the info! :)

emma1997
Posts: 972
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Wed Nov 13, 2019 6:52 pm

maretodoric wrote:
Wed Nov 13, 2019 12:25 pm
What i want to connect is remote for my garage door and simulate key press on remote using raspberry pi relay or GPIO pins,
Best way to activate keys is with MOSFETs like 2n7002. Cheap and available everywhere. Old tech bipolar transistors (ie 2n3904) also work but require extra components. The point is this allows low voltage output like Pi pin to activate higher voltage (5v,6v,12v,etc) key signal. A relay can also do this but draws thousands of times more power, limited life, and need a transistor to drive it anyway.

There are generally two types of key circuits: matrix and digit input. Matrix type need transistors used as analog switch. Input type keys, which is probable for garage remote, work by simply grounding which is also easy to do with a transistor. As mentioned by Trejan if the key is input type 3.3v or less the Pi pins may connect direct without a transistor.

I use these tricks all the time with devices like X10 keypads and TV remotes. Usually controlled by Arduino but sometimes Pi or even a PC.

JohnsUPS
Posts: 185
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 1:22 am

I have contemplated doing this myself, but my solution was to connect an optoisolator across the switch of the remote. This way, all that needs to be done is to drive the LED of the optoisolator from a GPIO pin.
Any general purpose opto should work, so long as the current requirements of the LED are not too great. Also, look for an opto with a CTR of 100% or better.

maretodoric
Posts: 21
Joined: Wed May 01, 2019 12:59 pm

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 2:25 pm

Thanks for the input.
I've been researching optoisoloators but that would require me to remove a button from a remote and solder the optoisolator, right? At this point i was thinking of connecting wires to the button contacts itself and insure connection by maybe using glue gun or some kind of wax.

I also still have to figure out what are the positive and what are the negatives of the button. Since button on a remote is tactile push button with 4 pins and on the circuit itself doesn't seem to be marked what is what.

emma1997
Posts: 972
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 2:47 pm

Optoisolators are an excellent solution where high voltages or long wires are involved. I would not be concerned with sensitivity as the output current is very low, microamp or nanoamp range. I've been able to use as high as 10k to drive the LED with 3n28 which is about the crummiest/cheapest there is.

IMO opto is overkill where a simple transistor will do. With opto or BJT it will be necessary to find which of the contacts are negative and positive. Another advantage for MOSFET, aside from cheaper and fewer components, is not necessary to find +/- as they are 'bidirectional'.

Also note that real analog switch (cd4016,cd4066,etc) would work but more expensive and requires more connections. There are typically many solutions for things like this but generally one of them is better than others. A lot depends on what's in your junk box and how much effort willing to be spent.

Then of course there's always the software element.

PS I should have mentioned that the bidirectional comment only worked with matrix keypads. For digital input type keys (probably the case here) the source always goes to ground. So if it don't work in one direction just reverse it. True for both FET and BJT.
Last edited by emma1997 on Thu Nov 14, 2019 8:04 pm, edited 1 time in total.

User avatar
rpdom
Posts: 17542
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 2:55 pm

With those sort of buttons you'll find that the pins are in pairs. If you look at the switch so that the pins are on either side, the top two pins are joined together and the bottom two pins are joined. When you press the button it joins the top pair to the bottom pair.

(poor diagram follows)

Code: Select all

   ---
1-|   |-2
  |   |
3-|   |-4
   ---
Pins 1&2 are always connected.
Pins 3&4 are always connected.

Press the button and 1&2 are both connected to 3&4.

Four pins makes the switch more stable to mount than two would.
Unreadable squiggle

emma1997
Posts: 972
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 3:11 pm

In my experience the 4pin so call 'tact' buttons are less common for this type device. Cheap remotes usually have elastomer keypads with contacts being PCB traces like in todays other thread on the subject. We don't know exactly what type here but probably the same. A good photo like the one in the other thread would make that plain.

I would add that the tact button type is orders of magnitude more reliable and longer life. Many times more expensive though.

User avatar
rpdom
Posts: 17542
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 4:12 pm

It depends on the number of buttons. My garage door remote has one button. It's easier to use a physical button than to design a whole membrane pad for just the one.
Unreadable squiggle

emma1997
Posts: 972
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 4:20 pm

Reviewing posts I see now that as usual you were more on top of things. Yes, the best remotes do use those tact type, specially if there's only one or two. Elastomer don't shine until number of buttons gets up there like the one in todays other thread.

BTW for matrix type (probably not the case here) plus/minus is only important with bipolar transistor or optoisolator. With 2n7002 polarity won't matter. You only need to wire source and drain from top to bottom pairs in rpdoms diagram. Gate to Pi pin and don't forget common ground.

As mentioned before if one sw contact is ground then only need to wire Pi pin directly to the other contact. Maybe a low value resistor in series for protection but not absolutely required.
maretodoric wrote:
Thu Nov 14, 2019 2:25 pm
Since button on a remote is tactile push button with 4 pins and on the circuit itself doesn't seem to be marked what is what.

danjperron
Posts: 3519
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 5:08 pm

Why not using a simple step down DC/DC regulator like the MP1584. The enable Pin could be directly connected to the GPIO on the PI and the output could be set exactly at 6V.

The enable threshold is ~1.5V. This perfect for the PI.

https://www.dx.com/p/dc-4-1-26v-to-0-8- ... 73958.html

I'm using that device to power On/Off my Pi with a camera for time lapse. A RTC enabled the DC/DC converter and when the picture taken the Pi shutdown by disabling the same enable pin of the chip.

trejan
Posts: 2473
Joined: Tue Jul 02, 2019 2:28 pm

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 5:30 pm

danjperron wrote:
Thu Nov 14, 2019 5:08 pm
Why not using a simple step down DC/DC regulator like the MP1584. The enable Pin could be directly connected to the GPIO on the PI and the output could be set exactly at 6V.
Why complicated it with extra hardware? It should be fine being directly powered from the 5V rail on the Pi.

User avatar
Burngate
Posts: 6343
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 6:37 pm

emma1997 wrote:
Thu Nov 14, 2019 2:47 pm
... Another advantage for MOSFET, aside from cheaper and fewer components, is not necessary to find +/- as they are 'bidirectional'.
That seems unlikely, as most I've come across have a diode across source-drain
2N7000 diag.png
2N7000 diag.png (1.47 KiB) Viewed 857 times

emma1997
Posts: 972
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Is it possible for RaspberryPi 3 B+ to power a 6V device

Thu Nov 14, 2019 7:58 pm

Yes, that seems to be the case, at least according to theory. However in my experience that parasitic diode does not seem to cause a problem emulating keys in a battery operated remote. Maybe the low voltage doesn't interfering with such a small DC offset since the key scan signal is low. All I can say is when using NPN the polarity only worked one way but with MOSET it worked either way.

JFET are truly bidirectional but the requirement for negative turn off voltage will be trouble here.

In this case the signal is most probably digital input type not matrix so 2n7002 definitely needs to have source, like emitter of a bipolar, to ground. I should go back and make that clear.

BTW those MP1584 modules are crazy cheap. About 50 cents each on Ebay ( https://www.ebay.com/itm/5PCS-MP1584-3A ... SwX~9dUQFx ) or half that on Ali. Very useful but using the Pi supply is definitely the way to go for replacing battery in a remote like here.

It's possible to run the Pi itself off one but only lower power models with no additional attachments. 3amps is typical Chinese humor. With that tiny inductor maybe half that or less in reality. Worked with my Pi3b+ and Zero but got 'lightening bolt of death' with 3b and 4b under heavy load. Better to spend a few cents more and use the LM2596 ones to be safe.

The small red one jondallimore and rin67630 discussed in the other thread does actually put out over 2a and has much lower idle current but costs almost a whole dollar! lol

Return to “Advanced users”