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

If an optocoupler only drives small currents it only needs small current in the diode according to the CTR (Current Transfer Ratio). If for example an optocoupler has a CTR of 25% a diode current of 4 mA gives an output current of 1 mA which is sufficient for LS-TTL inputs. As long as the frequency of the signals is below a few kHz allmost any coupler will work.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de 
HTML mails will be forwarded to /dev/null.
Reply to
Peter Heitzer
Loading thread data ...

Irrelevant if the rPi is burnt up in trying to design your own interface.

I would design it to the requirements. I don't think we know what they are currently.

--

Rick
Reply to
rickman

If I wanted to sense a mains voltage as input to a Pi, could I use opto-couplers, safely? If so, how?

Presumably, I'd need to rectify the mains, smoothy it, then drop the voltage, maybe via a resistor and zener diode, before applying to a opto-coupler. Would that work? Is there a device which would achieve all that on its own?

I'm presently using mains relays to provide a logic signal to the Pi, and that works well enough, but is a bit bulky.

Cheers, Tony

Reply to
Tony van der Hoff

I would use a small mains relay (one with a mains-voltage coil), and sense the switch contacts.

Failing that, I'd transform it down to around 5v RMS before doing anything else.

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
http://www.nckc.org.uk/
Reply to
Alan Adams

Yes, an opto is a reasonable way to do that. I don't know you need to do all those steps. The opto *is* a diode. All you need to do is limit the current to a safe level that won't blow out the diode. But maybe I don't understand what you are trying to sense? Do you want to have the

60 Hz signal or are you looking for the presence of the AC power?
--

Rick
Reply to
rickman

Suitably rated ones yes. I looked at mains isolation for my heating system monitoring using an 8 IO/Switch 1-wire chip. Optos was one method I think I discounted those as it starts to get complicated running an LED on mains AC, 5 mA @ 230 V is over a watt per channel to get rid of and you have 50 Hz signal rather than a nice clean on/off indication.

There is a dedicated isolation chip out there, outputs a conditioned on/off signal. Very neat, low external component count, would need a PCB making though.

Guess what I ended up with... Mainly because I already had suitable relays and DIn rail for them from the previous heating system. Just needed a box.

--
Cheers 
Dave.
Reply to
Dave Liquorice

It depends on how much power you want to waste. Resistor/LED will waste a lot of power. A small 5v USB charger with the 5v being used as the sense (via resistor divider) will also waste power, but I've seen them used. As will a mains powered relay.

The energy efficient way to do it is to use a high voltage series capacitor and resistor and possibly a diode to protect the LED from reverse bias.

See this page:

formatting link

and read this thread on the forums from ages ago:

formatting link

Gordon

Reply to
Gordon Henderson

an

I can tell you are not a bean counter. Getting $100 past a bean counter is easier than $200, even if you say it'll save you 10 hours work at $20/hr...

This is true, my impression is that this interface box will physically push buttons on a real CD machine of some sort to select the required disc/track.

--
Cheers 
Dave.
Reply to
Dave Liquorice

Thanks, Gordon; those articles (especially the second link) look just the job. I'll start experimenting!

Reply to
Tony van der Hoff

Just don't touch the live side...

Gordon

Reply to
Gordon Henderson

Too late...

Reply to
Tony van der Hoff

All kidding aside, that is the down side of this circuit, the high and dangerous voltage inside the unit. These days most electronics has an external power pack which provides a low voltage to low power electronics like this. Some wall warts are really just AC transformers and can provide a low voltage AC signal to drive the sensing circuit as well as power the unit. Then there is no hazard from high voltage AC even with the unit open.

--

Rick
Reply to
rickman

Yes, you're right to preach caution. I recall the days of working on live-chassis TVs. I also used to repair SMPSUs in VDUs. You need to be careful.

We're quite spoiled these days, aren't we.

Reply to
Tony van der Hoff

Not always )-:

I was building a small 1U system last year and it had an open-frame PSU... And I had the lid off. It was propped under my desk and without thinking I reached into it to lift it up to check a module I'd plugged into it and grabbed something inside the PSU. I think it was the rectifier that took the 230v AC. That's the worst shock I've had. Hand an arm really felt weird for an hour or so.

Gordon

Reply to
Gordon Henderson

When I was a kid I played with parts from old TVs. I was doing something with a power transformer that had a 500 VAC winding. I reached behind the couch to unplug it and then grabbed the circuit and actually got burnt! Seems I had pulled the wrong plug... a lesson from the school of hard knocks.

--

Rick
Reply to
rickman

In comp.sys.raspberry-pi message , Thu, 27 Nov 2014 14:42:55, Tony van der Hoff posted:

You should first say what sort of sensing you need. Do you want to sense just whether it is on or off, or do you want to sense whether the voltage is within EU or other applicable specification, or above or below that, or perhaps within the range that the equipment in use can accept, or do you instead want to find the actual value (and if so to what accuracy?)? What sort of response time do you need?

--
 (c) John Stockton, near London.                Mail ?.?.Stockton@physics.org 
  Web   - FAQish topics, acronyms, and links.
Reply to
Dr J R Stockton

Once when I was a teenager, I picked up an open-frame linear supply providing 300vdc. My fingers curled under the edge and hit the bus. The next thing I knew, I felt like I'd been hit by a bat, and the power supply was about 20 feet away on the other side of the room!

That's how I learned about the value of bleeder resistors--and thinking about where my fingers were going. ;-)

--
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon
Reply to
Michael J. Mahon

And it's good to learn how to work safely around high voltages. We're turning into voltage wimps. ;-)

--
-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon
Reply to
Michael J. Mahon

Not sure where I read about it, perhaps Pop' 'Tronics in the '67-7x era: An old lab or high-school electronics lab prank involved charging an axial lead tubular capacitor up to a couple hundred volts or so, holding it carefully by the body, and tossing it to someone else, while yelling, "Hey, [insert name here]!"

--
Robert Riches 
spamtrap42@jacob21819.net 
(Yes, that is one of my email addresses.)
Reply to
Robert Riches

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.