Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

230V AC to 5V DC push button interfacing

Status
Not open for further replies.

tomerbr

Junior Member level 2
Joined
May 6, 2008
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,478
Hi,

I am designing a system to control fan speeds.
The selection of the speeds will be done using an MCU that will select the correct output to the fan.

The selection is done by a single push button, each press changes the speed.

This logic is working using a push-button connected directly to the MCU and the 5V supply.

In the final system, the push button will send a ~230V AC pulse instead of a 5V DC pulses.

I need to interface this into my 5V MCU.

My idea is to use a diode bridge and a voltage devider like in the attched schematic.

Will it work?

Thanks,
Tomer
 

Attachments

  • AC-DC-push.JPG
    AC-DC-push.JPG
    28.6 KB · Views: 165

Hi,
Will it work?
no way!

* the push button short circuits mains input. In worst case the pushbutton explodes and causes fire...in best case the mains fuse trips.
* There is only one connection to the microcontroller. Impossible to work.
I didn't check further..

Klaus
 
Will it work?

I like your fuse blower switch.

In any case, the lack of isolation from the 230V primary is a serious issue. Depending on your country, mains plugs can be reversed and the neutral/ground might actually be 230V. Plus there are failure cases where neutral isn't neutral any more, and you have 230V on that wire which connect to your output "ground". Wanna kill yourself? Stay away from mains voltage, you don't know what you are doing.
 
Last edited:
Hi,

You'll need a proper power supply for your design. An offline flyback is a good option for low-power applications. You can buy a duly rated one off the shelf.

Now taking a look at the right hand side of your schematic, assuming that the LHS is not what it is, that is not the way to implement a voltage divider. You just short-circuited resistor R1.
 
You are right, the previous schematic had a mistake.

This is the correct schematic.

As for powering the MCU, I do have a flyback converter directly from the AC mains to the 5V supply.
My only issue is to translate the AC pulse from the push button.

Will the new circuit work?

In open state the GPIO is pulled low with R2, when the button is pressed - the GPIO should sense a voltage via R1, I will set R1, R2 values to produce around 5V through them.

As for isolation, the DC part is installed inside the fan without any human access. is it still necessary?

Thank,
Tomer
 

Attachments

  • AC-DC-push.JPG
    AC-DC-push.JPG
    29.2 KB · Views: 150

Hi,

If you have a flyback converter already then you would not need the bridge rectifier that you still have. You can use the output DC to generate and feed the pulse to the MCU with your switch.
 

Hi,

This logic is working using a push-button connected directly to the MCU and the 5V supply.

In the final system, the push button will send a ~230V AC pulse instead of a 5V DC pulses.

why are you changing the switch from a nice, safe, working 5V switch and circuit
to an untested, not so safe 230V switch and circuit?

How are you changing the voltage/power to the fan to execute the speed change?

One switch can only go one way - increase speed or decrease speed
have you considered adding a second switch so one increases speed while the other decreases speed?
 

I will clarify,

The 5V switch was just to test the logic.
I cannot use it as the switch is dictated to me as 230V.

That is why I am changing it and that is why I cannot use the flyback to feed it.

So I ask, will it work or not?
What are the risks?

Thanks for the help
Tomer
 

Hi,

It may work. But it's not safe.
The bridge rectifier does not prevent dangerous voltage to be fed to the microcontroller side.
As soon as you touch anything of the microcontroller electronics - even GND - you risk to get an electric shock.

--> Use a relay, a tiny transformer or an optocoupler for galvanic isolation.
Thousands proven circuits are available online.

Klaus
 
Hi,

It may work. But it's not safe.
The bridge rectifier does not prevent dangerous voltage to be fed to the microcontroller side.
As soon as you touch anything of the microcontroller electronics - even GND - you risk to get an electric shock.

--> Use a relay, a tiny transformer or an optocoupler for galvanic isolation.
Thousands proven circuits are available online.

Klaus

Thanks for that.
I will design the circuit as you suggested and upload it here for review
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top