Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital inline dimmer power supply

Status
Not open for further replies.

kybert

New Member
Hi,

I need to create a 5V supply for a PIC from a mains 240vac 50hz supply.

Its a lamp dimmer circuit, so the supply line will be inline with the bulb that is being controlled.

This means that when designing the power supply, it needs to have a wide input voltage and still maintain the correct output for the PIC.

I guess the PIC should make sure the controlled 'dim' state does not drop below a certain average voltage so the PIC can always remain powered.

Does anyone have any existing circuits for this? I looked at using a resistive transformerless supply, but ended up with a resistor that needed to dissapate 10W so would like to use a capacitive solution instread.

I am competent with high voltages, so understand the risks involved with live supplies and no isolation etc..

Any help would be great on this. I guess someone must have a circuit for this as there are many inline digital dimmers out there already.
 
Last edited:
That sounds strage. Is this for school or something, because If I wanted a 5v stabilized supply for an IC this is not how i'd do it. I would reccommend using a step-down transformer and a 5v regulator. check google for some circuits.
 
I think you have it backwards - the greatest voltage drop will be when the lamp is fully on. But not to worry about that. consider 2 lamps plugged in to the same outlet (i.e. in parallel). Turning a second lamp on won't cause the other to dim unless your wiring is really substandard.

for a transformerless supply, look for an ap note on the Microchip site. It's pretty easy to follow.
 
The lamp is already wired in the house. The only access point to the wiring for the lamp is the existing switch on the wall. So, i have to derive the power supply with the bulb in series to any electronics that will be required to control the voltage to the bulb.

Hence, i need a transformerless supply that can work over the full dimable range.

It's not for school, im a software guy that likes to do a bit of hardware every now and then.
 
Last edited:
kybert said:
The lamp is already wired in the house. The only access point to the wiring for the lamp is the existing switch on the wall. So, i have to derive the power supply with the bulb in series to any electronics that will be required to control the voltage to the bulb.

Hence, i need a transformerless supply that can work over the full dimable range.

It's not for school, im a software guy that likes to do a bit of hardware every now and then.
hi,
What voltage and current do you want the PIC mains psu to supply?
 
I want it to supply enough current to power 10 leds (If=2mA leds running at 1mA to save power), a PIC controller, and the supporting circuitry for the triac, so i'd guess in total, 30mA should be enough on the 5V line.
 
kybert said:
I want it to supply enough current to power 10 leds (If=2mA leds running at 1mA to save power), a PIC controller, and the supporting circuitry for the triac, so i'd guess in total, 30mA should be enough on the 5V line.

hi,
I will post a drawing in the next 24hrs, showing how to make such a psu.

Are you experienced enough to work with mains powered, non-isolated devices?:eek:

I have to ask.
 
Im fine working with live electronics, i use MCD and RCD protectors and im carfull!

Am i right in assuming that 10mA will be enough to fire a triac via a
MOC3020(?) and power a pic?
 
kybert said:
Im fine working with live electronics, i use MCD and RCD protectors and im carfull!

Am i right in assuming that 10mA will be enough to fire a triac via a
MOC3020(?) and power a pic?

hi,
Look thru these examples, READ the warning messages.

http://home.clear.net.nz/pages/joecolquitt/txless.html

**broken link removed**
**broken link removed**

**broken link removed**
http://www.aaroncake.net/circuits/supply5.asp

Allow more than 10mA, say total about 40mA if you triggering a triac, some require 30mA.

From the above examples, you should find a suitable psu.

IF IN DOUBT ASK!
 
Use a mains adaptor, I'm pretty sure you can get regulated units, failing that, use a 9V unregulated unit with an LM7805 on the output.
 
I cant use a mains adaptor, its inline with the bulb ina standard domestic house lighting circuit, the dimmer replaces the switch on the wall.
 
That's even worse, since it probably won't work on the lowest brighness setting.

What's the power consumption?

You could use a lithium battery that should last years if it doesn't use much power.
 
Why serial, and where are these LEDs in relation to the existing light. Is this the lower floor of a 2 storey house? An all concrete apartment? There are remote controlled LED replacement lights available.
 
The lamp is already wired in the house. The only access point to the wiring for the lamp is the existing switch on the wall.
Usually the neutral wire also passes through the switch box on it's way to the lamp. At least it does in North America, isn't it the same in the UK?
Below is an ap note for a 120VAC 60Hz dimmer which could be adapted for 240V 50Hz use with a few component changes:
https://www.electro-tech-online.com/custompdfs/2007/10/40171a.pdf
 
Hi,

In the UK, its usual to only have a 3 core wire in the switch housing. The wire carries LIVE into the switch, and the live return comes out of the switch directly to the bulb. The 3rd conductor is the earth.

The whole idea here is that the existing wiring need not be aultered; simply replace the switch with the circuit (the yellow box in the drawing).

Therefore, i assume that the control circuit would need to ensure that at the lowest dim setting, there is still enough voltage to supply the PIC.
 

Attachments

  • lamp.JPG
    lamp.JPG
    2.4 KB · Views: 285
kybert said:
Hi,

In the UK, its usual to only have a 3 core wire in the switch housing. The wire carries LIVE into the switch, and the live return comes out of the switch directly to the bulb. The 3rd conductor is the earth.

The whole idea here is that the existing wiring need not be aultered; simply replace the switch with the circuit (the yellow box in the drawing).

Therefore, i assume that the control circuit would need to ensure that at the lowest dim setting, there is still enough voltage to supply the PIC.

Can I ask what exactly you are trying to do?:)
Whats the relationship between the dimmer and the PIC, in your design ?
 
Im simply trying to replace an existing light switch with a dimmer switch;

However, instead of the off-the-shelf dimmer switches avaliable that use a variable resistor to control the dim amount, i would like to use a PIC.

I have tested the dimmer circuit and the PIC code used to dim a bulb, but deriving power inline with a bulb is causing me a few concerns.
 
Because, in addition to controlling the triac firing angle, the PIC will also control 10 LEDs in a bargraph format, indicating the current dim position.

1 LED lit indicates the lamp has been dimmed to its minimum value (off).

10 LEDs lit indicates the lamp is at full brightness.

The LEDs will be PWM controlled to reduce power consumption still further.
 
kybert said:
Because, in addition to controlling the triac firing angle, the PIC will also control 10 LEDs in a bargraph format, indicating the current dim position.

1 LED lit indicates the lamp has been dimmed to its minimum value (off).

10 LEDs lit indicates the lamp is at full brightness.

The LEDs will be PWM controlled to reduce power consumption still further.

Hi kybert,
I dont want to sound like a smart a*rse, but wont the actual lamp you are controlling tell you how dim the light is?;)

The bog standard light dimmers that control a triacs firing angle are quite efficient, minimal power wastage?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top