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.

Voltage sensing

Status
Not open for further replies.
Dear all,

How to sense mains voltage(230VAC) from micro-controller?

hi,
When you say 'sense' do you mean detect the presence of the 230Vac or the actual mains voltage.??

The common ways are to use a small mains to low voltage transformer or a suitable opto isolator, these will give safe isolation from the mains supply
 
Hi ericgibbs,

Yes,i would like to detect whether Mains is there are not by using controller. So kindly suggest me how to do this??

hi,
OK,, which is easiest for you use a miniature mains transformer or an opto-isolator.?

Do you have a small transformer, say mains to about 6V or 9V on the secondary.??
 
If you are powering the project from the mains, simply pick off the AC from the secondary side of the transformer with a voltage-divider.
 
24v is perfectly safe. You can connect the transformer secondary "either way around."
You need to pick-off about 4v5. The input of the microcontroller is almost infinity so 47k lower resistor and 220k for the top resistor going to the 24v secondary (AC) voltage. Tap off the mid-point.
 
Last edited:
You will need to call one lead of the secondary of the 24v transformer 0v and the other lead 24v. The 0v lead must be connected to the ground or earth or 0v of the microcontroller project.
The 0v of the microcontroller project is actually 0v DC and the 0v line of the transformer is 0v AC. But this does not affect the circuit. It is just clarifying the two 0v's.
 
Last edited:
Hi,
My transformer secondary is 24V..so i need to take from that using voltage divider?? is it safe??

hi samson,
Before you start building the detector, a couple of important questions.

Is the 24V transformer already used to power any part of the project.?

How do you plan to use the PIC to detect the mains signal, ADC, Digital input or Interrupt.??
 
Hi Ericgibbs,

Yes ,the 24V transformer is used in battery charging circuit,stepping down 230V to 24V. I would like to take instant voltages of secondry AC and i will operate mosfets. I will take these inputs as ADC for controller.
 
Hi Ericgibbs,

Yes ,the 24V transformer is used in battery charging circuit,stepping down 230V to 24V. I would like to take instant voltages of secondry AC and i will operate mosfets. I will take these inputs as ADC for controller.

hi,
The battery charger will most likely have a full wave rectifier bridge on the 24V secondary.

When you say a 24V transformer I am assuming a single secondary, not a centre tapped transformer.

Look at this image for one option, the section in the dotted rectangle is the divider, [ignore the rest of the circuit] connected across the secondary.

The signal will be a full wave rectified 50Hz , with a peak of ~5V, is this the type of waveform your MCU program can use.???
 
Hi,

That waveform will get after rectification only..Right??? But i would like to sense the voltages before rectification...can it be possible?? May be i will get negative voltages also?? can i give negative voltages to controller??
The option which you have given is good. Will this work if i connect like that??
 
Hi,

That waveform will get after rectification only..Right??? But i would like to sense the voltages before rectification...can it be possible?? May be i will get negative voltages also?? can i give negative voltages to controller??
The option which you have given is good. Will this work if i connect like that??

hi,
Which type of MCU are you using.??

Most will not ADC a negative voltage, to test the negative half cycle you would have to offset the sine wave to 2.5Vdc and allow a swing of 2.5V above and below the 2.5V offset. The way I have shown it is before the 24V rectifier and it gives a signal for the positive and negative half cycles of the mains. [which you want]

It would be good idea to say what the program and the rest of the circuit is going to do, in that we way can help.
 
Hi Ericgibbs,

Can you please tell me how to offset the sinewave to 2.5V. Am new to this.

My actual project is battery charger. I would like to sense the mains voltage to operate relay for mains mode and battery mode. And second purpose of sensing the mains is: In positive half cycle i need to operate one mosfet and in negative half cycle i need to operate another mosfet for charging a battery.. This charger is a single stage battery charger..
 
Dear Ericgibbs,

The waveform which you showed is the reference voltage of Positive and negative half cycles of the secondary voltages. But am having doubt, how can we sense in that waveform in which half cycle we got that positive voltages(Whether in Positive half cycle or negative half cucles of secondary voltage)?? Do you understand my query?? Please help me..I need to operate two different mosfets based on the Positive and Negative half cycles of secondary voltages..
 
Hi Ericgibbs,

Can you please tell me how to offset the sinewave to 2.5V. Am new to this.

My actual project is battery charger. I would like to sense the mains voltage to operate relay for mains mode and battery mode. And second purpose of sensing the mains is: In positive half cycle i need to operate one mosfet and in negative half cycle i need to operate another mosfet for charging a battery.. This charger is a single stage battery charger..

hi samson,
What you are planning for the MOSFET control is 'zero crossing' detection of the mains cycle with 'sensing' of the positive or negative half cycle..

One way to do this is use half wave detection of the cycle, this will give a 5V pulse during the positive half cycle.

The method is then used to detect the rising and falling edges of this pulse, using the PIC, detecting the edges in this way will enable you to control the required MOSFET.

If you want to consider this let me know, I can suggest a circuit.
 
Last edited:
Dear Ericgibbs,

Thanks for your reply..

Yes,am planning to do the zero crossing detection...but,i dn't how to sense the +ve and -ve half cycle ..kindly help me with circuit if you have
 
Status
Not open for further replies.

Latest threads

Back
Top