Server migration complete, Welcome to version 2.1.1



Welcome, Guest.
Please login or register.
Forgot your password?

+-Site Stats

Total Members: 15697
Latest: ejrich83
New This Month: 15
New This Week: 1
New Today: 1
Total Posts: 128620
Total Topics: 15828
Most Online Today: 57
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 41
Total: 42

12v car power to gpio input - opto isolator?

Started by n8huntsman, January 11, 2019, 01:00:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Im running an rpi with pi cap on my RZR Offroad utility vehicle. Im going to pull a +12v wire from the brake light circuit to control a gpio input.

I think I need an opto isolator like this circuit:
It needs to be pretty tough because of all the bouncing around it will experience so Id like to find a breakout board thats already made. If not I can make it but would rather not.
Has anyone found something like that?
Will I need the debouncing cap?
Am I missing a simpler solution?


I think what you are describing would work, here's another example without the debouncing cap:

The only other thing that I can think of would be a relay, but I'm not sure that is simpler and it could be bouncing around when offroad. :) You may be able to find a small pre-made board with an opto isolator on it on sparkfun somewhere.  I saw several when googling for a solution but didn't look at the details on them.


I've looked over there and this is the closest thing I can find:
Not sure if it would work or not; because the extra transistors are confusing me.  The schematic is here:

I'm leaning towards just building it myself on a proto-board and using a couple 6N137 opto's.  I need at least two inputs to control the falcon player.


I've done up a quick schematic that is similar to the one you linked to, but with revised values. - the home of da_Tester and other handy stuff


Is your circuit 24v (+12v and -12v) or is that -12v intended to be a ground?

The more I stare at the spark fun gizmo above I think it would work.  Looks like it designed to use the GPIO's as outputs not inputs.  Not sure if it would work the other way around.



I think this would work.  Probably add a 560Ω resistor to the GPIO to protect it in case, for whatever reason, it turns itself into a 3.3v output while the opto is pulling it to ground, as recommended on the RPI forum.
Is there any downside to the GPIO being pulled high and my 12v circuit pulling it low?  False triggering or anything?  How about debouncing diodes?  Anyone know if I need it?


You can certainly add a resistor (1K) between the output of my circuit above and the pi's GPIO pin.

The input to the opto is 12V.  I just marked them as + and - but can see how that can be confusing. - the home of da_Tester and other handy stuff

Support FPP

+- Recent Topics

FPP 7 Kubernetes Error by Jlwright325
Today at 11:11:59 AM

FPP Install on Raspberry Pi Zero W by k6ccc
March 21, 2023, 05:53:50 PM

FPP install script on Ubuntu, no video by AlexanderMedia
March 21, 2023, 09:37:23 AM

DMX to pneumatic solenoid by JerryPlak
March 20, 2023, 01:03:53 PM

Libre SBC with oled by mel4853
March 19, 2023, 12:24:34 PM

Limitations on Video file size? by darylc
March 19, 2023, 02:53:52 AM

F16v3 External Power Connector by darylc
March 16, 2023, 05:25:46 PM

FPP on PC HDMI Output by AlexanderMedia
March 15, 2023, 01:17:55 PM

Orange Pi One and external DS3231 RTC on rtc1 by Arti G
March 13, 2023, 09:29:28 AM

FM transmitters by Poporacer
March 12, 2023, 10:54:39 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod