PI/GPIO Protection


12 posts
by hardwired2001 » Sat Jan 05, 2013 10:27 am
Is there a simple circuit I can buy or make that will allow me to protect my pi from mistakes in physical computing. I.E putting 12 volts though the gpio pin's!
Thanks
Posts: 22
Joined: Tue Jun 12, 2012 5:11 pm
by pjc123 » Sat Jan 05, 2013 2:09 pm
A fuse or a short leash between your hands and your lab power supply.

But seriously, if what you are really looking for are basic GPIO protection circuits look here:

http://elinux.org/RPi_Tutorial_EGHS:GPI ... n_Circuits

There are many boards that people sell that offer protection, expansion and added features for the various pins on the pi, the Gertboard being one of the them. The "Add-ons for sale" section of this forum has a ton of boards for sale.
Posts: 910
Joined: Thu Mar 29, 2012 3:37 pm
by gordon@drogon.net » Sat Jan 05, 2013 6:52 pm
hardwired2001 wrote:Is there a simple circuit I can buy or make that will allow me to protect my pi from mistakes in physical computing. I.E putting 12 volts though the gpio pin's!
Thanks


There's Mike Cooks breakout board.... http://www.thebox.myzen.co.uk/Raspberry/Breakout.html and I've just jogged my mind that I did a PCB for it some time back, however due to some personal issues at the time it sort of got left on he back burner... Hm. Might publish it!

-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1543
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
by malakai » Sat Jan 05, 2013 7:19 pm
Might publish it!


+1 would love to get one. Still trying to get around to making that board.

I think one option if just using I/0 is the MCP20xx chips I don't know a lot but like the Gertboard they advertise that it puts something between your Pi and your components claiming that the IC's would blow before the Pi and the IC's are typically just a few dollars.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by hardwired2001 » Sat Jan 05, 2013 8:20 pm
I want to do the setup below, to be able to control 24 12volt LEDs, Instead of using the £30 board in the picture I was going to use 2xMCP23017 (I2C) 16-bit I/O Port Expander (£2.00) chained together (not that I actually know how to get one going at the minute, but hey that's that the pi is all about). As the software I am writing (step sequencer/mod tracker) will be running on the pi anyway I want to use the i2c interface on the pi.
What I am afraid of is 12 volts coming back through the MCP23017's when I complete the circuit, because quite frankly in the physical computing world I have very little idea what I'm doing! So I though if I just protect everything while I am learning what I'm doing then I wont blow up my lovely pi!
Attachments
advancedconnection.jpg
advancedconnection.jpg (11.29 KiB) Viewed 3302 times
Posts: 22
Joined: Tue Jun 12, 2012 5:11 pm
by gordon@drogon.net » Sun Jan 06, 2013 12:31 pm
hardwired2001 wrote:I want to do the setup below, to be able to control 24 12volt LEDs, Instead of using the £30 board in the picture I was going to use 2xMCP23017 (I2C) 16-bit I/O Port Expander (£2.00) chained together (not that I actually know how to get one going at the minute, but hey that's that the pi is all about). As the software I am writing (step sequencer/mod tracker) will be running on the pi anyway I want to use the i2c interface on the pi.
What I am afraid of is 12 volts coming back through the MCP23017's when I complete the circuit, because quite frankly in the physical computing world I have very little idea what I'm doing! So I though if I just protect everything while I am learning what I'm doing then I wont blow up my lovely pi!


The first issue is getting 24 outputs from the Pi - so solutions involve various GPIO expanders and the 23017 is one solution (you'll need 2), or the 23S017 another (SPI version of the same chip as used the the PiFace)

Another solution might be to use 3 x 74x595 shift registers. Arguably easier to interface to the Pi and simpler to send data to.

However once you've got that sorted, then you need to buffer the signals coming out of the gpio expanders into these, and the simplest might be to use 2 ULN2803 open collector driver chips.

Personally, although it needs one more chip, I'd probably go with the shift-register method - then you have 3 identical blocks which you can debug and test in-turn, if needed.

-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1543
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
by hardwired2001 » Mon Jan 07, 2013 11:17 pm
Thanks for your time everyone.
I think I will go with 2 x MCP23017 (as I already have them). Wire the LED's in serial, but I am going to bench the setup first using small standard LED's. I am also going to measure the current of the 12 volt LEDS to make sure the GND does not exceed the maximum current of the MCP23017's.
Thanks again.
Posts: 22
Joined: Tue Jun 12, 2012 5:11 pm
by gordon@drogon.net » Mon Jan 07, 2013 11:24 pm
hardwired2001 wrote:Thanks for your time everyone.
I think I will go with 2 x MCP23017 (as I already have them). Wire the LED's in serial, but I am going to bench the setup first using small standard LED's. I am also going to measure the current of the 12 volt LEDS to make sure the GND does not exceed the maximum current of the MCP23017's.
Thanks again.


So you plan to use the MCP23017 running at 3.3v to drive (or sink current from) these 12V LEDs directly?

It will end in tears. You need some sort of buffer from the MCP23017 to the device - hence the ULN2803's.

-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1543
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
by rurwin » Mon Jan 07, 2013 11:46 pm
And the 3.3V supply from the RaspPi can only supply 50mA.
User avatar
Forum Moderator
Forum Moderator
Posts: 2936
Joined: Mon Jan 09, 2012 3:16 pm
by hardwired2001 » Tue Jan 08, 2013 1:18 pm
I was planing to wire the +12volt in serial from a 12 volt port supply. I plan to wire up "-" to the MCP23017 and switch the polarity to input. As long as the current does not exceed 25mA (the per pin limit) I was hoping I could switch on the bulbs by completing the circuit. Not now though!
I was going to test it on small LED's first, one's the need resisters (1K)!

I didn't know that's the ULN2803 was/did!

Could I do this instead.

Connect my pi to my MCP23017's, connect them to 3 ULN2803A's or ULN2804's and power the bulbs from the +12volt power supply wired into pin 10 of the ULN280* and wire the negative in serial to the bulbs or pin 9 on the ULN280*.
I would like to use the MCP23017 as I have them already.
Tears is what I am trying to prevent!
Thank
Posts: 22
Joined: Tue Jun 12, 2012 5:11 pm
by gordon@drogon.net » Tue Jan 08, 2013 3:39 pm
hardwired2001 wrote:I was planing to wire the +12volt in serial from a 12 volt port supply. I plan to wire up "-" to the MCP23017 and switch the polarity to input. As long as the current does not exceed 25mA (the per pin limit) I was hoping I could switch on the bulbs by completing the circuit. Not now though!
I was going to test it on small LED's first, one's the need resisters (1K)!

I didn't know that's the ULN2803 was/did!

Could I do this instead.

Connect my pi to my MCP23017's, connect them to 3 ULN2803A's or ULN2804's and power the bulbs from the +12volt power supply wired into pin 10 of the ULN280* and wire the negative in serial to the bulbs or pin 9 on the ULN280*.
I would like to use the MCP23017 as I have them already.
Tears is what I am trying to prevent!
Thank


Yes. Use the 23017's to drive the 2803's and from there to the higher voltage devices. Do make sure that the total current going through the ULN2803's is under 500mA though - read and study the data sheets carefully.

-Gordon
--
Gordons projects: https://projects.drogon.net/
User avatar
Posts: 1543
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
by hardwired2001 » Mon Jan 13, 2014 12:57 pm
gordon@drogon.net wrote:
hardwired2001 wrote:I was planing to wire the +12volt in serial from a 12 volt port supply. I plan to wire up "-" to the MCP23017 and switch the polarity to input. As long as the current does not exceed 25mA (the per pin limit) I was hoping I could switch on the bulbs by completing the circuit. Not now though!
I was going to test it on small LED's first, one's the need resisters (1K)!

I didn't know that's the ULN2803 was/did!

Could I do this instead.

Connect my pi to my MCP23017's, connect them to 3 ULN2803A's or ULN2804's and power the bulbs from the +12volt power supply wired into pin 10 of the ULN280* and wire the negative in serial to the bulbs or pin 9 on the ULN280*.
I would like to use the MCP23017 as I have them already.
Tears is what I am trying to prevent!
Thank


Yes. Use the 23017's to drive the 2803's and from there to the higher voltage devices. Do make sure that the total current going through the ULN2803's is under 500mA though - read and study the data sheets carefully.

-Gordon


I know its been quite a long time since I posted looking for advice. Nevertheless I have finally got this all wired up for the first time,
To cut a long story short I just wanted to say thank you! Its up and running a looks really cool!

http://playpi.hardwiredonline.co.uk/view-page.php?id=7
Posts: 22
Joined: Tue Jun 12, 2012 5:11 pm