Connect with us

powering a micro controller from mains ac

Discussion in 'General Electronics Discussion' started by mellis, Dec 12, 2011.

Scroll to continue with content
  1. mellis

    mellis

    2
    0
    Dec 12, 2011
    hey i am working on a smart light switch project that will have a small microcontoller, touch lcd screen and wireless transceiver. i have pretty much figured out the rest of it but i'm somewhat stuck on the power system as even when the light is off i need the unit to remain powered even with the light off. I was thinking when the power to the light is on i could use the voltage drop of say a 30ohm resistor, a full wave rectifier and a boost converter but apart from that i'm somewhat stuck to how this could be powered since there will be no neutral line inside the switch box.

    any input would be extramly helpful :)

    Matt
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,220
    2,201
    Nov 17, 2011
    Hi Matt,
    you don't necessarily need neutral as long as your current requirements are small. The wire going from the switchbox to the lamp can serve as neutral since for small currents a lamp is a suitable conductor. So you could connect your circuit across the switch itself where you will see mains voltage (115 V or 230 V depends on where you live) as long as the switch is open. You could charge a battery from that voltage (after transformation, rectification etc,) to supply your circuit during the on time of the switch.
    Alternatively you could resort to a dual supply using mains if the switch is closed and your proposed resistor circuit if the switch is closed.

    Please be carefull as even the low power supply is directly connected to mains and therefore a potential danger for the life of any person touching it.

    Regards,
    Harald
     

    Attached Files:

  3. mellis

    mellis

    2
    0
    Dec 12, 2011
    thanks for your input harald, i really like the idea of the dual power supply the only problem i have currently is how i can use the resistor based side of it with low wattage bulbs 10-50w when i ran simulations of the circuit i couldn't find a resistor value that would give me a useful voltage on a wide range of wattage's.

    if you had any idea on how i could make this work it would be great.

    matt
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,220
    2,201
    Nov 17, 2011
    Hi matt,
    I don't think you will find a universal resistor for that purpose.

    Assuming the power consumption of your circuit is negligible compared to the bulb, you get

    I= Pbulb/Umains

    This current flows through resistor R giving a voltage drop of

    Uresistor = R*I = R*Pbulb/Umains

    Since varying R is not an option, you will have to design the step-up regulator instead such that it accomodates a wide range of input voltages. For example 1V @ P=30W up to 3.3 V at P=100W. That can be done.


    Regards,
    Harald
     
  5. duke37

    duke37

    5,364
    769
    Jan 9, 2011
    Could you use two zener diodes, back to back, instead of a resistor?
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,220
    2,201
    Nov 17, 2011
    Beware of safety concerns

    Duke:
    As long as the power does not exceed the rating of the zener diodes, this is not only suitable for different wattages of the lamp load but also protects the input of the step-up converter from overvoltage. You could use even a single zener diode, if your power requirements are small such that a capacitor can bridge one half wave of the mains. See image.

    Something nasty you could do to get rid of the step down regulator would be to bypass the switch with a small capacitor. Using Xc=1/(2*pi*f*C) you could select C such that the impedance is large enough so the lamp will not turn on (at least visibly), but small enough that standby current for your project is supplied via the step-up regulator.

    ! Potentially dangerous !
    However, any of the proposed methods is dangerous and potentially life threatening! Even if the switch is in the OFF position, there will still be the idle current of your circuit going to the lamp socket. In case someone touches the lamp - thinking it safe because the switch is off - there is a risk of electric shock due to the idle current. If you still want to continue this project, you should use it only if:
    a) the idle current is very small (50mA are deemed life threatening, so the idle current should stay way below that limit, say 1mA for example).
    2) the lamp in question is not easily accessible (e.g. ceiling lamp) and you possibly place a note of caution at the lamp.

    You have been warned. Continue at your own risk. I will not take any responsibility for any fatalities.

    A safe (and probably cheaper) solution would be to place a standard power supply (e.g. USB wall wart) somewhere and feed well insulated wires to your circuit.

    Regards,
    Harald
     

    Attached Files:

    Last edited: Dec 15, 2011
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-