is it possible to send 5v output from raspberry pi?

My own experiments have shown that the GPIOs will take a bit of abuse. I've drawn 35mA from a single pin and "got away" with it for example.

I also did this:

formatting link

way back. Those LEDs are all on and all drawing about 10mA each - so that's 170mA going through the SoC - when the maximum recommended is 50mA.... (And yes, that Pi is still going to this very day :)

However I'd never abuse it like that for a production design.

Most 5v TTL is happy to be driven at 3.3v - it's the other way round that's a bigger issue - ie. 5v into the Pi - so use a divider or something like a buffer driven at 3.3v that's tolerant to 5v inputs - e.g. 74HCT244.

I do think the LM358 is a bit over the top for a simple 3.3 -> 5v conversion though, but maybe I'm just a fan of the uln2003/2803 too...

-Gordon

Reply to
Gordon Henderson
Loading thread data ...

Lots will and Fairchild FDV3xx range will along with FDN types and switch 1 to 2A comfortably. Sometimes they are referred to as Logic FETs as they have a zener of equivalent inside.

Many have Vgs of 1.8V and are well on by 3V

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk 
    PC Services 
 Click to see the full signature
Reply to
Paul

If just needing voltage level translation WITHOUT extra current drive look at Texas Instruments (TI) devices TXB0101/2/4/8 or TXS0101/2/4/8 for ability to translate and disconnect if either power rail drops multiple lines.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk 
    PC Services 
 Click to see the full signature
Reply to
Paul

I would go for something like a ULN2061 or equivalent, it is designed for the job and will turn on at about 2V.

--
Stuart Winsor 

Tools With A Mission 
 Click to see the full signature
Reply to
Stuart

Thanks for that info and advice.

I can just about get me brain round a resistive voltage divider.

I'm OK with digital circuits but rubbish with analog: I find LM358s very easy to use with their single supply rail and I have a copy of the SAMS IC-OPAMP Cookbook. They seem to be hard to damage, their open loop amplification can be nice for sharpening up slowly changing inputs if they're driving something digital and they are fairly cheap, particularly if you can use both channels.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

---- input voltage------+ | R1 R1 R1 | +------ output voltage --- | R2 R2 R2 |

---- 0v/Gnd ------------+-------------------------

output voltage is a fraction of the input volrage goverend by the ratio of the input voltage over the resistors.

Output voltage = input voltage * ( R2 / (R1 + R2))

So input is 5, output wanted is 3.3, the trick is to calculate suitable R1 & R2 to make sure they don't waste too much power (ie. not too low), and aren't affected by electrical noise (so not too high) and give enough drive current, if needed.

e.g. picking 2200? for R1, then R1 would be about 3900?

A zener diode in-place of R2 also works, but doesn't seem as common...

Lookup Schmitt Trigger. There are direct digital ICs to do that.

But yes, opamps can be quite robust...

Gordon

Reply to
Gordon Henderson

Thanks guys.. a lot of useful information. i'm just afraid to burn my cute rpi board... if i do this in some protoboard is there still a chance that i can burn it all ?

Reply to
Marcus Vinicius Brasizza

Schmitt triggers are quite nifty. You can build a square or triangle wave oscillator with a Schmitt trigger a resistor and a capacitor.

--
Bernard Peek 
bap@shrdlu.com 
 Click to see the full signature
Reply to
Bernard Peek

the usual reply might be that Pi's are cheap - however I note you're in .br where import taxes, etc. on electronics is stupidly high, so not an easy option.

Check your wiring, double check. Test outputs with an LED or 2 before connecting to the remote device. Test inputs with a local button, then put a voltmeter on the lines you're connecting to. Connect it up one connection at a time and test that connection as you go.

To help testing - setting output pins and reading input ones, you might want to fetch the wiringPi package - even if not programming in C or C++ which it's for, it has a command-line utility called 'gpio' that lets you do individual pin testing like that.

formatting link

Gordon - the author of the wiringPi package.

Reply to
Gordon Henderson

That's the problem... a single board (b+) can be 280$ (107 USD). too expensive. if i burn a thing like that my boss will kill me for sure... :(

but i think is not my case, because i'll just send the 5v out, so i'll just mesure with a voltimeter and i'll not connect anything at this time.

i'm a software developer that is trying to build things with raspberry pi.. so i'll develop pyton in this first project.

Thanks again.

Reply to
Marcus Vinicius Brasizza

On Wed, 26 Nov 2014 01:40:49 +0000 (UTC), Martin Gregorie declaimed the following:

No comment -- I've not studied any spec sheets.

So far as I'm familiar, that is the main design factor of an opto-isolator -- the power supplies are independent between the two sides..

One could probably scratch-build some using low-power LEDs on the 3.3V side, photoresistors or such on the 5V, and heat shrink tubing to form them into a transmitter/receiver pair.

But then, as I commented -- this is just for total paranoia, over using a 3.3V control signal to a transister or such that is fed from a 5V rail.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
Reply to
Dennis Lee Bieber

I tend to use opto-isolators salvaged from dead switch-mode PSUs. Even running the LEDs at suitable currents for GPIO they seem to be reliable.

Reply to
Dom

Marcus, when you have read all the information that helpful people have provided (some of them don't know what they're talking about but know some buzz words to say) you will be able to build something to do what you want. That is the easy bit.

The difficult bit is the systems engineering part.

What happens to the device being controlled if it is powered but the rPi is not powered?

What happens to the device being controlled if it is powered, the rPi is powered but the rPi is not running the software?

What happens to the lines during Linux bootup?

What happens if the rPi crashes?

Maybe it's OK just to switch the power off then on. But you should make sure that everything remains in some acceptable condition during boot, shutdown, crash, disconnected states. This may simply be by ensuring that all the inputs are pulled to a known voltage with resistors. Or more maybe needed.

The interfacing is trivial. Making it work well and do the expected is harder. Don't skimp on this bit!

Reply to
mm0fmf

If you are that unsure of yourself, you don't need to reinvent the wheel. There are numerous plugin boards available with I/Os which do just what you want. Why bother with it all if you can just buy it?

--

Rick
Reply to
rickman

Then why do *all* PLCs have opto-isolation on both inputs and outputs?

As a point of interest, if you use them you actually reduce the circuit complexity.

4 x Input - suitable series resistors -> optocoupler chip and add reverse shunt diodes = bomb-proof 4 x Output - series resistors -> optocoupler darlington chip and add protection diodes = direct drive to small/medium relay, and if you manage to screw it up all you need to replace is the opto.
--
W J G
Reply to
Folderol

Because they are often used in industrial settings where the things being controlled can be some distance away and only separate electrical feeds. This can generate many volts potential between the grounds of the two systems which can prevent a low level signal from working or even do damage. Total overkill for reading switches in the same box.

Another reason for using optos in PLCs is because the interface is often a current loop. These are floating circuits by definition and often are daisy chained.

Huh? A 3.3 volt I/O can read a switch with nothing but a pullup resistor. An opto will require two resistors along with the opto.

Great when working around bombs.

Or you could use a simple FET with a reverse diode for protection... or use a FET which has the diode built in. Add... well nothing if the input threshold is chosen appropriately. :)

Optos are fine and not hard to use. But they are not small and will still need an output driver for anything that needs some ummph... yes, ummph is a technical term. :P

Optoisolators are for... well, isolation. If you need that then an opto is the right part. If you don't need isolation then why add an unneeded part?

--

Rick
Reply to
rickman

I think we're nearly in agreement but using different words.

When you check a key's state, I would call that sampling or collecting the state of the key. If I understand you correctly, your strategy appears to do more sampling than mine. If you only collect key states or sample the key states at an interval greater than the bounce time, you don't need to do a second check of the key's state; just take the states you collected/sampled at face value.

HTH

--
Robert Riches 
spamtrap42@jacob21819.net 
 Click to see the full signature
Reply to
Robert Riches

Unless you have any possibility of noise creeping into the equation...

--

Rick
Reply to
rickman

Good point, for those situations that require noise immunity.

--
Robert Riches 
spamtrap42@jacob21819.net 
 Click to see the full signature
Reply to
Robert Riches

If a B+ Pi costs USD107 where this person is how much do you think an expansion board is going to be?

I agree that such an option is the easy way out but may not be financially viable. Building is also a lot more fun and very satisfying when it all works and does what you designed it to do.

There is plenty of information "out there" on how to interface a Pi to the real world. Personally I'd choose a suitably overated swiching transistor for the outputs and if the switches are in the same box as the Pi just wire them direct. I'd fit pull ups if the input GPIO line would be floating as is the case with a simple "push to make" button.

--
Cheers 
Dave.
Reply to
Dave Liquorice

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.