jermg77
Posts: 6
Joined: Tue Aug 14, 2012 4:06 pm

Help interfacing 13.8Vdc to GPIO

Wed Aug 15, 2012 5:37 pm

So, I'm nvery new at this stuff and am trying to get a grip on some basics. I'm looking to use my Rpi for sense a 13.8vdc source. Anyone care to point me in the proper direction?

Does this look like the way to go?

http://arduino.cc/playground/uploads/Le ... rduino.pdf

Thanks!

-jerm!

User avatar
Grumpy Mike
Posts: 931
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Help interfacing 13.8Vdc to GPIO

Wed Aug 15, 2012 6:26 pm

Yes either of those two circuits will do the job. Use the second one if you don't want any connection between the high voltage source and the Pi, otherwise you have to have a common connection of the ground between your high voltage and the Pi.

jermg77
Posts: 6
Joined: Tue Aug 14, 2012 4:06 pm

Re: Help interfacing 13.8Vdc to GPIO

Wed Aug 15, 2012 8:30 pm

Excellent.. While I'm asking elementary questions, can you steer me towards proper parts? The opto isolator is easy enough to find, but the resistors seem a bit hard for me to sort through..

I appreciate the help!

-jerm!

User avatar
Grumpy Mike
Posts: 931
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Help interfacing 13.8Vdc to GPIO

Wed Aug 15, 2012 9:26 pm

Just look for 1/4 W axial resistors as cheap as you can find. This link has them sorted by price:-
http://uk.farnell.com/jsp/search/browse ... 1%2B203968

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12595
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Help interfacing 13.8Vdc to GPIO

Wed Aug 15, 2012 9:44 pm

where the pullup resistors (R3 & R4) are tied to "Arduino 5V", tie them to 3V3 instead, the PI uses 3V3 input levels, and doesn't appreciate 5V levels.

jermg77
Posts: 6
Joined: Tue Aug 14, 2012 4:06 pm

Re: Help interfacing 13.8Vdc to GPIO

Sat Aug 18, 2012 4:44 pm

ok, so I've built this (to the best of my ability). I used the transistor version solely because Radio Shack does not stock any optoisolators (you should have seen the blank stare on the employee's face when I asked.. sigh..)

So, having built this, and again being very new to it, I figured prior to attaching it to my Rpi, I would connect first to the 13.8v source and measure what comes out the other end. I don't see much... maybe 2mV. The main question is, what SHOULD I be seeing here?

My other question is, when attached to the 13.8v source, I can no longer see that voltage... it is reduced at the source to under 2mV. Is this right? Is it because the circuit, not being terminated to the Rpi is incomplete?

Thanks!

-jerm!

-jerm!

User avatar
Grumpy Mike
Posts: 931
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Help interfacing 13.8Vdc to GPIO

Sat Aug 18, 2012 5:19 pm

The main question is, what SHOULD I be seeing here?
A very small voltage because the 13.8V turns on the transistor so it conducts electricity and so reduces the voltage between the emitter and collector to effectively zero. So it looks like it is working fine.

When you remove the 13.8V from the base you should see 3.3V between the collector and emitter. Note that you should be pulling up to 3.3V not 5V as was mentioned before.
The ground on the 13.8V must be connected to the ground on the Pi.

Return to “Interfacing (DSI, CSI, I2C, etc.)”