RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

GPIO - Level Shifter for Pi Bot

Wed Oct 15, 2014 8:40 pm

Thoughts, comments and clarification of value of R1 in attached ckt. diagram for use with Pi GPIO output as a level shifter.

The way I read the diagram R1 varies between 4k and 7k as the voltage applied is varied between 5V and 30V. Is that correct?

I am making plans to build a GPIO breakout board for the Pi B+ and intend to use two (2) SN7407 ICs to make available 12 buffer circuits (3.3V to 5V level shifter) for connection with motor controllers, servo controllers, sensors, and other bells / whistles I will be cobbling in the future as the Pi bot gets built-out over time.

In addition to the level shifter for GPIO outputs, I intend to include a number of voltage dividers on the breakout board to protect the Pi GPIO inputs.

The above circuits, along with other Pi GPIO protection circuits, can be found at:
< http://elinux.org/RPi_GPIO_Interface_Circuits >

Thank you for any thoughts and comments you may share.

P.S. I cannot seem to attach the file of the circuit diagram referenced above -- it can be found at the elinux webpage sighted above. My apologies, it appears that this forum does not accept Open Office files - so it goes - cheers

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: GPIO - Level Shifter for Pi Bot

Wed Oct 15, 2014 9:55 pm

The way I read the diagram R1 varies between 4k and 7k as the voltage applied is varied between 5V and 30V. Is that correct?
its not critical at all as long as you don't go lower than 1K with a 30V supply

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: GPIO - Level Shifter for Pi Bot

Wed Oct 15, 2014 11:05 pm

its not critical at all as long as you don't go lower than 1K with a 30V supply
Thanks Simon

It occurred to me later in the day that sometimes resistor values that include a decimal are written with a K (kilo) or M (mega) used in place of the decimal -- for example in this case the value 4.7 k is written a 4k7. I guess doing so makes it easier to read.

Either way it will work based on your advice.

Thanks for taking the time to help.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: GPIO - Level Shifter for Pi Bot

Thu Oct 16, 2014 8:47 am

Out of curiosity, If you are designing a board from scratch, why not go for Opto-Isolated inputs instead of level shifters?
Doug.
Building Management Systems Engineer.

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: GPIO - Level Shifter for Pi Bot

Thu Oct 16, 2014 3:50 pm

Doug - easy answer, because I never thought of it, I did not know they existed. I was trained in electronics ~ 45 yrs ago and I have not had a chance to stay current.

That said, I would appreciate any links that would help me plus-up my knowledge. I am planning the breakout board and learning as I go - slow and deliberate is the way forward for me.

Thank you for putting me on to Opto-Isolated inputs and for taking the time to comment.

Cheers,

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: GPIO - Level Shifter for Pi Bot

Fri Oct 17, 2014 1:57 pm

RussellPiBot wrote:Doug - easy answer, because I never thought of it, I did not know they existed. I was trained in electronics ~ 45 yrs ago and I have not had a chance to stay current.

That said, I would appreciate any links that would help me plus-up my knowledge. I am planning the breakout board and learning as I go - slow and deliberate is the way forward for me.

Thank you for putting me on to Opto-Isolated inputs and for taking the time to comment.

Cheers,
Well the opto-isolator or opto-coupler is the ultimate protection, there is no electrical connection between the signal and the output.

Opto-isolators are available as a single pair on one chip or with multiple built into the same chip. This tutorial should cover most of the details.

This image shows it well.Image.

Other options are i2c based chips, which can expand your inputs and outputs by adding a variety of potential functions on a communication bus, giving you the facility to connect many different chips to the same two GPIO pins.

SPI is also available but is quite a GPIO pi intensive option.
Doug.
Building Management Systems Engineer.

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: GPIO - Level Shifter for Pi Bot

Sun Oct 19, 2014 1:45 pm

Other options are i2c based chips, which can expand your inputs and outputs by adding a variety of potential functions on a communication bus, giving you the facility to connect many different chips to the same two GPIO pins.
Doug - thanks for the tutorial links. After reviewing the information I believe (subject to change as I learn more) I would prefer to use i2c, as it appears more versatile to my newbie eye.

Thanks again for taking the time to help up this steep learning curve.

Return to “Automation, sensing and robotics”