Searching \ for 'Simplest way to drive LED from mains 230V' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=led
Search entire site for: 'Simplest way to drive LED from mains 230V'.

Truncated match.
PICList Thread
'Simplest way to drive LED from mains 230V'
1998\10\21@082202 by - Underwater Acoustics Group

flavicon
face
This is a little different from the discussions which have been going on
recently- I don't need to power a circuit from the mains, but a simple
isolated logic level input.  My feeling is that it would be best to drive
the LED in an opto-isolator from a stepped down mains supply, but I'm not
sure what the easiest way is to do it.

Simplest would seem to be a resistor, series diode, and zener, to give some
protection to the LED, with maybe a capacitor and bleed resistor in
parallel to stop the LED flashing at 50Hz- is this worth pursuing, or is
there a better method?  The application is to pick up the status of a
lightswitch from the mains switched live connection, then use a PIC and
some other inputs to decide whether to switch the light on or not (via a
solid state relay).  The PIC will be supplied from a conventional
transformer-based psu, to keep it all isolated.

Thanks,

Nigel

1998\10\21@091218 by cousens

flavicon
face
Nigel Orr- Underwater Acoustics Group wrote:
> This is a little different from the discussions which have been going on
> recently- I don't need to power a circuit from the mains, but a simple
> isolated logic level input.  My feeling is that it would be best to drive
> the LED in an opto-isolator from a stepped down mains supply, but I'm not
> sure what the easiest way is to do it.
>
> Simplest would seem to be a resistor, series diode, and zener, to give some
> protection to the LED, with maybe a capacitor and bleed resistor in
> parallel to stop the LED flashing at 50Hz- is this worth pursuing,

Yes
Though 15ma 220v = 3.3 watts waste heat, a .22uf cap will give you 15ma
bridge rectified, as mentioned before use mains rated cap and
a series resistor as fuse/inrush limiter.
after the bridge a 5v6 zener 10uf cap and a 220 ohm to your led
(max approx 18ma)

Peter Cousens
email: spam_OUTcousensTakeThisOuTspamher.forthnet.gr  phone: + 3081 380534
snailmail:  Folia, Agia Fotini, Karteros, Heraklion  Crete, Greece.

Is it true that they have, on the new version of windows
managed to increase the MTBF from 95 to 98 minutes ?
(That's why they called it 95)

1998\10\21@093245 by Harrison Cooper

flavicon
face
HCPL-3700, around $4, takes the AC input, gives a TTL (open collector)
signal.  Internally, its a bridge circuit, with a opto-coupler.  I've
used them for years.  I am now, trying to figure out if I can use a PIC
direct to the AC lines, without blowing the PICs due to transients and
such.  But for a one or two appliction, and room is not an issue, I
would recomend this part.

1998\10\21@095445 by paulb

flavicon
face
Nigel Orr- Underwater Acoustics Group wrote:

> This is a little different from the discussions which have been going
> on recently- I don't need to power a circuit from the mains, but a
> simple isolated logic level input.  My feeling is that it would be
> best to drive the LED in an opto-isolator from a stepped down mains
> supply, but I'm not sure what the easiest way is to do it.

 Actually, I think it's *very* little different, as does Peter Cousens.

 I suggest the simplest is a 220nF AC mains-rated capacitor with a 330
ohm ¸ watt resistor in series (noting that this should be chosen for
fusing characteristics as per previous discussion...) feeding the LED in
the optocopupler directly with a diode paralleled across this in the
opposite direction.  This will drive the LED with 15mA pulses at 50Hz.

> with maybe a capacitor and bleed resistor in parallel to stop the LED
> flashing at 50Hz

 I *can't* see why you want to stop the LED flashing.  You poll the PIC
input from the optocoupler about 4 or 6 times per cycle (i.e., every 4ms
or so) and if it fails to register the LED flash for 50mS, you conclude
the power is off.

 Far better and cheaper than adding integrating capacitors and so on;
the principle is to keep the circuit *simple* (1 capacitor, 1 resistor,
1 diode and 4N25) and do the integration in software.  But most likely,
if you use the internal pullup feature of the PIC, you will need only a
few mA for the opto and a 47nF mains capacitor (alter series resistor to
1k ohm ¹ watt) should do fine.
--
 Cheers,
       Paul B.

1998\10\21@103150 by - Underwater Acoustics Group

flavicon
face
At 23:50 21/10/98 +1000, you wrote:
>  Actually, I think it's *very* little different, as does Peter Cousens.

Two solutions suggested so far are not different at all- the third, from
Harrison Cooper, suggesting the HCPL-3700, seems to be exactly what I need,
though I'd looked through catalogues several times and managed to glance
past it each time... however, he did say:

>>such.  But for a one or two appliction, and room is not an issue, I
>>would recomend this part.

Why "if room is not an issue"?  The part is an 8-pin DIL.

>  I *can't* see why you want to stop the LED flashing.  You poll the PIC

OK, I could do it in software- and using the very integrated HP device,
I'll have to!

>the principle is to keep the circuit *simple* (1 capacitor, 1 resistor,

I like to keep software simple too- it's easier to debug hardware ;-)

But I agree, it's easy in this case to poll the port, or use an
interrupt-driven check.

Thanks for all the suggestions- if anyone can beat the HCPL-3700 component
count of 1 (!), do let me know!

Nigel

--
Nigel Orr                  Research Associate   O   ______
       Underwater Acoustics Group,              o / o    \_/(
Dept of Electrical and Electronic Engineering     (_   <   _ (
    University of Newcastle Upon Tyne             \______/ \(

1998\10\21@105245 by Rob

flavicon
face
On Wed, 21 Oct 1998, Nigel Orr- Underwater Acoustics Group wrote:

>
> Thanks for all the suggestions- if anyone can beat the HCPL-3700 component
> count of 1 (!), do let me know!

Read the data sheet for the 3700 first.  I use it in my application, but
you need a pull-up resistor and capacitor too.

Rob

>
> Nigel
>
> --
> Nigel Orr                  Research Associate   O   ______
>         Underwater Acoustics Group,              o / o    \_/(
> Dept of Electrical and Electronic Engineering     (_   <   _ (
>      University of Newcastle Upon Tyne             \______/ \(
>

1998\10\21@134430 by Peter L. Peres

picon face
imho, the 5 V power supply circuit from 220 V discussed previously will do
fine, and why do you wish to filter the LED drive when a capacitor in
parallel with the phototransistor will have much more effect. You need to
put a diode in anti-parallel with the LED and use 2 resistors and a series
capacitor as described for the 5 V power supply.

Peter

1998\10\21@164122 by Russell McMahon

picon face
If you don't want isolation (and you should :-)) - a 1 megohm
resistor with catch diodes at the "cold" end will tell you what the
mains is doing very well. At Vpeak of ~400 volts current is 400uA
which is well within any diodes specs. The resistor MUST be mains
rated (SFR16 etc aren't). The incorrigibly brave will tell you that
the PIC's inbuilt diodes are adequate for this application.

A cheap and useful alternative to an opto is to pass the mains lead
through a small toroid plus a "dropping element" in series to provide
a small current flow to provide drive and as many turns as are
required on the output side of the toroid to drive your PIC. The
series element on the mains side of the toroid can be purely
capacitive.

When the mains drives some load when turned on (which was not the
case in this application as originally described) the toroid primary
(one turn) can be in series with the load.

In all cases be aware of the need to insulate the primary wire
adequately :-) - and ideally protect toroid surface to prevent wire
damage long term (insulated toroids are available).

   regards

               Russell McMahon



-----Original Message-----
From: Harrison Cooper <.....hcooperKILLspamspam@spam@ES.COM>


>HCPL-3700, around $4, takes the AC input, gives a TTL (open
collector)
>signal.  Internally, its a bridge circuit, with a opto-coupler.
I've
>used them for years.  I am now, trying to figure out if I can use a
PIC
>direct to the AC lines, without blowing the PICs due to transients
and
>such.  But for a one or two appliction, and room is not an issue, I
>would recomend this part.
>

1998\10\21@164941 by Steve Smith

picon face
Try a constant current source and half wave diode I use a circuit that can
accept any input from 5v DC to 230V AC to drive an opto at 2.5mA at 230v and
.6 - .7 at 5v

Constant current pnp transistor (mpsa 92 VCEO 300V) 2 diodes in the base and
two 470K resistors in parellel to bias the diodes and a 560R (I think ) in the
emmitter collector to led in series with the opto coupler and 100R100u cap
across the leds and resistor. Half wave rectify the mains before you start
with a 1n4007 in series with 220R to take out voltage spikes.
230v is the very top of the voltage supply and 5v is the very minimum and a
opto has to be selected with a low current led (SHF610-2)  Circuit works well
down to about 24v but the bias current in the diodes is very low at 5v and the
foward voltage starts to collapse a lower value  R is used to turn on the
diodes if used at this level.

Note. Appling a megger to this circuit stops the transistor working....

Cheers Steve......

1998\10\21@170846 by Reginald Neale

flavicon
face
Harrison asked:

>I am now, trying to figure out if I can use a PIC
>direct to the AC lines, without blowing the PICs due to transients and
>such.

Yes, you can. The main issue is safety. If it's a circuit that requires a
human interface, there's no good way to make it non-hazardous. Contact me
off-list if you need more info.

Reg Neale

1998\10\22@112016 by - Underwater Acoustics Group

flavicon
face
At 10:50 21/10/98 -0400, you wrote:
>Read the data sheet for the 3700 first.  I use it in my application, but
>you need a pull-up resistor and capacitor too.

Pull-up resistor on the output?  Can't I just use port B pullups (dragging
the relevance back to the _PIC_list!)
Capacitor?  As suggested by someone else, I can do a little polling to
check mains presence, and in the same way find the crossing point, if I
wish to do dimming ;-)

One other question- the threshold voltage in the 3700 is 6V- I know from
looking at disconnected mains wiring, there can easily be a few volts
there, read with a voltmeter.  Anyone have capacitance figures for standard
T&E, used in the UK for most mains wiring?  I'm thinking I might need a
series resistor to increase the threshold if there is likely to be more
than 6V at 2mA on a 'disconnected' wire, relative to neutral.

(The UK wiring system is normally based around the ceiling light fitting-
lighting supply comes in on one cable, and another carries Live, Switched
Live and Earth to the switch.  As a result, there is usually a run of maybe
5-10m in the average room with live running parallel to switched live.
This isn't a problem normally, as the lamp will keep the induced voltage
down to effectively zero, but if a bulb blows, I don't want the system to
falsely switch on power.)

Not sure if I've made that very understandable...

Nigel
--
Nigel Orr                  Research Associate   O   ______
       Underwater Acoustics Group,              o / o    \_/(
Dept of Electrical and Electronic Engineering     (_   <   _ (
    University of Newcastle Upon Tyne             \______/ \(

1998\10\22@120143 by Rob

flavicon
face
On Thu, 22 Oct 1998, Nigel Orr- Underwater Acoustics Group wrote:

> At 10:50 21/10/98 -0400, you wrote:
> >Read the data sheet for the 3700 first.  I use it in my application, but
> >you need a pull-up resistor and capacitor too.
>
> Pull-up resistor on the output?  Can't I just use port B pullups (dragging
> the relevance back to the _PIC_list!)

I've had to use the external resistors and cap for proper operation.
Besides, isn't the pullup on Port B for output only?

> One other question- the threshold voltage in the 3700 is 6V- I know from

The threshold voltage for turn-on is 4.23V when used with a AC input.  Of
course you need to put a limiting resistor on the input side to reduce the
current to a level where ytou don't burn the device out.

Read the last page of the data sheet!  It shows a sample circuit,
equations for the resistor values and so on.  Remember to figure the
power dissipation in the rsistor and choose accordingly.  If you don't
understand it, please e-mail me.

Rob


>
> Nigel
> --
> Nigel Orr                  Research Associate   O   ______
>         Underwater Acoustics Group,              o / o    \_/(
> Dept of Electrical and Electronic Engineering     (_   <   _ (
>      University of Newcastle Upon Tyne             \______/ \(
>

1998\10\23@080036 by - Underwater Acoustics Group

flavicon
face
At 11:59 22/10/98 -0400, you wrote:
>> Pull-up resistor on the output?  Can't I just use port B pullups (dragging
>> the relevance back to the _PIC_list!)
>
>I've had to use the external resistors and cap for proper operation.
>Besides, isn't the pullup on Port B for output only?

>From Page 45 of the data book for the 16C7X:
"The weak pull-up is automatically turned off when the port pin is
configured as an output"

So, input only.

And why is the cap required?

>The threshold voltage for turn-on is 4.23V when used with a AC input.  Of
>course you need to put a limiting resistor on the input side to reduce the
>current to a level where ytou don't burn the device out.
>
>Read the last page of the data sheet!  It shows a sample circuit,

I've read it- it still seems to imply that the device can be connected up
directly to up to 280Vrms, and additional series resistors will only
increase the threshold voltage.  What am I missing here?

>understand it, please e-mail me.

Looks like I don't...
--
Nigel Orr                  Research Associate   O   ______
       Underwater Acoustics Group,              o / o    \_/(
Dept of Electrical and Electronic Engineering     (_   <   _ (
    University of Newcastle Upon Tyne             \______/ \(

1998\10\23@175247 by paulb

flavicon
face
Nigel Orr- Underwater Acoustics Group wrote:

> From Page 45 of the data book for the 16C7X:
> "The weak pull-up is automatically turned off when the port pin is
> configured as an output"
> So, input only.

 I am inclined to wonder why one would confuse weak pull-ups with
outputs - but perhaps someone has been using 8051s!

>>understand it, please e-mail me.
> Looks like I don't...

 I am tempted here to reminisce of Ne-2s and LDRs in black heatshrink
(with a piece of acrylic rod in the middle).  Threshold = 95V, resistor
= 120k or so.
--
 Cheers,
       Paul B.

1998\10\25@224204 by Rob Zitka

flavicon
face
At 12:56 PM 10/23/98 +0100, you wrote:
>>Read the last page of the data sheet!  It shows a sample circuit,
>
>I've read it- it still seems to imply that the device can be connected up
>directly to up to 280Vrms, and additional series resistors will only
>increase the threshold voltage.  What am I missing here?

No, it can't.  Current limiting resistors must be used.  The circuit is a
bridge diod circuit inside.  If you don't believe me, take one and hook it
up to the line voltage and tell me what happens! :)

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...