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.

Understanding AC Circuits

Status
Not open for further replies.

dirtbiker1824

New Member
HTML:
O--|<----/\/\/\/\/\-----
   Diode		\
	    12KΩ	/
			\
		  12KΩ	/	
			\
			/		
			|
			|
120v			|---------(Gnd of Mcu)
60Hz			|	 |
			\	 |
			/	 _
			\	| |
		   1KΩ	/	| |
			\	| |	
			/	| |	
			|	 _
			|	 |	
			|	 |
O-----------------------|--------|(Analog Pin of MCU)

I have the above circuit set up and for some reason the 1000 ohm resistor blew, along with my arduino board. Why did the 1K resistor blow since most of the power should have been disipated in the larger 12K resistors. I am using 1/4 watt resistors. I'm trying to use my arduino to plot the voltage of an AC signal, eventually I want to use it to trouble shoot AC-DC converters to determine the correct size smoothing capacitor to use. The voltage divider is to drop the 120 down to 4.8 so my arduino can read it.
 
We'll start with the fact that 120 V AC mains peaks at 170 V.

It also goes to -170 V.

However, what killed the 1k resistor and the Arduino was the path from Ground of the MCU to one side, the lower one on your circuit diagram, of the mains supply.

Mains supplies are at nearly earth voltage on one wire, and the full voltage on the other supply. While measuring mains is a risky business at the best of times, you are better to measure voltages to ground. Then you earth your 5 V supply and measure relative to that. If you want to measure relative voltages, measure the voltage of the live wire and the neutral, and calculate the difference between them.

You should have a 10 k resistor from the analog pin to ground, another 10 k resistor from the analog pin to +5 V and then a resistor of 390 k to the point that you are measuring. That will make the analog input swing from about 0.33 to about 4.67 V over the mains cycle.
 
Ok please bare with me as I am new to AC. So the 120 isn't peak voltage its RMS? Even still if it is 170volt the two 12K reistors should have dropped the current to about 7mA if the 1K resistor was bypassed. 7mA is not enough to damage the Arduino and the 1/4 watt resistor. Also the voltage divider should have still dropped the voltage down to 6.8 volt which also shouldn't damage the Arduino and resistor. Before I hooked the arduino up everything worked fine I was reading about 5 Volt across the 1K. I figured the arduino would just act as another resistive load parallel with the 1K which wouldn't damage anything. As fare as the negative voltage, the Diode should have taken care of that (I think).
I guess my questions are, how was there enough power to burn up the 1/4 watt resistor and Arduino
When you say measure between earth and the the line you mean hook the Aarduino to the 3rd ground prong and just take the readings off of 1 AC line?
lastly why would it swing between .33 and 4.76 Volts?
Thank you very much for helping
 
Last edited:
You should measure the voltage between each pin of the mains and the ground of the Arduino.

I think that connecting to the lower connection on the diagram would have been enough to blow things.

When you say measure between earth and the the line you mean hook the Aarduino to the 3rd ground prong and just take the readings off of 1 AC line?

Yes.

why would it swing between .33 and 4.76 Volts?

The two 10 kΩ resistors in series between +5 V and ground will produce a midpoint of 2.5 V and the impedance will be 5 kΩ.

+/- 170 V into 390 kΩ gives +/- 0.435 mA which gives a swing of +/- 2.18 V around the 2.5 V level.
 
Code:
O--|<----/\/\/\/\/\-----
   Diode		\
	    12KΩ	/
			\
		  12KΩ	/	
			\
			/		
			|
			|
120v			|---------(Gnd of Mcu)
60Hz			|	 |
			\	 |
			/	 _
			\	| |
		   1KΩ	/	| |
			\	| |	
			/	| |	
			|	 _
			|	 |	
			|	 |
O-----------------------|--------|(Analog Pin of MCU)

I have the above circuit set up and for some reason the 1000 ohm resistor blew, along with my arduino board. Why did the 1K resistor blow since most of the power should have been disipated in the larger 12K resistors. I am using 1/4 watt resistors. I'm trying to use my arduino to plot the voltage of an AC signal, eventually I want to use it to trouble shoot AC-DC converters to determine the correct size smoothing capacitor to use. The voltage divider is to drop the 120 down to 4.8 so my arduino can read it.

Hi there,

You calculated the rms voltage at the AD pin to be 4.8vrms but that is rms, not peak. The peak will be about 1.4 times greater which is 6.72v peak which is too much for the uC chip.

That still doesnt explain why the 1k resistor blew out however, as with the values you have shown that should not have happened. With the 12k and 12k resistors in series with the 1k the max power the 1k would have seen would have been about 12mw, which is well under the 250mw rating of the resistor.
This means of course that something else must be wrong with the actual real life circuit. Perhaps the two 12k resistors are not really 12k but are really much lower in value. That's about the only way that 1k can blow unless the input voltage is much higher than you think it is.
This means you should check the resistance of the two 12k resistors with an ohm meter and might as well check the (next) 1k you plan to use.

You can test this resistor circuit out first by connecting only the resistors and diode and dont connect the uC chip yet. Measure the voltage across the 1k and make sure it is really what you think it should be.
Also, because the peak is really 170v and at high line it may goes as high as 200v, you should use different resistors in place of the two 12k resistors. Two 20k resistors should do the trick, with a max output across the 1k resistor of about 4.9v even at high line. You might also incorporate a zener or some other protection against high voltage spikes on the line.

Another item you should add is a reverse connected diode across the 1k to clamp short lived but significant reverse voltages. It may seem strange why we would want to add this diode, but during turn on (and other times too) a high voltage negative input with a fast rise time could cause the input diode to conduct for a short time due to its capacitance. This voltage would appear to the uC chip as a reverse polarity voltage spike which of course could kill the chip. Alternately, a small value capacitor or depending on the required response time of your application an even larger value cap to smooth out the pulsing dc as well as shunt these spikes to ground.
 
Last edited:
The circuit as drawn is wrong and dangerous, as you have found out.

You should be using a transformer to give isolation from the mains supply, a 120 to 6volt transformer would be ideal.

Uses a full-wave bridge rectifier rather than half wave then the smoothing capacitor requirements will be smaller.

You will still need some voltage divider as athe peak value of 6v is about 8.4 volts. The divider will give you some opportunities to juggle with the voltage scaling.

Also, if you are trying to "plot the voltage of the AC signal" the halfwave rectified signal will look a bit odd.

JimB
 
I think that if you had put a 1 k resistor between the leg of the mains that you used, and ground of the MCU, with no connection to the other leg of the mains or to an input of the MCU, the 1 k resistor would have blown. The current that blew the 1 k resistor cannot have come through the 12 k resistors, or they would have blown.

A transformer is a good idea. I suggest getting a 230 V input transformer, with a 3 V output. It will be more linear than a transformer that is run at its rating.

Also, I would not fit a rectifier. If you want to measure a waveform, the rectifier will just get in the way. The MCU is plenty fast enough to measure the waveform as it changes. You can use a couple of resistors and a capacitor to produce a mid point at 2.5 V, and connect one side of the transformer to that, while measuring the other side, so that you can measure the positive and negative swings.

You may still need a voltage divider. An unloaded transformer will produce more voltage than its rating by an amount called the "regulation". On a small transformer that will be as much as 40%. There is also the RMS to peak ratio of √2, so the peak voltage that I would expect is:-

3 * 120 / 230 * 1.4 * √2 = 3.1 V

so that is more than the range that you have if you are centred on 2.5 V.
 
Thank you all for the help. Maybe I screwed something up when I moved the circuit from one breadboard to another with the uC because I measured 4.8 volts across the 1K before I hooked up the uC on a separate bread board.

As far as using a trasnformer I'm trying to stay clear of that. I just recently learned abut zener diodes and I plan to make a full wave rectifier, but replacing two of the regular diodes with 12V zeners and use that as my DC power just like the image below, except the left two diodes I replaced with 12 v zeners.
**broken link removed**
I made a test circuit and I am left with some more questions. I have, coming from the AC line, 1.5K resistor going into one half of the diode bridge then going back into the AC line. On the other side of the Diode bridge I have a 1K resistor in parallel with a 1000uF cap. I figure this will give me about a .1 V ripple, I know this number will change once I put my actual circuit in place. The thing I don't understand is I'm measuring 77mA of current at 121V rms in the AC side, but only 13mA of current at 11.7V DC going through the Capacitor and resistor. The 77mA is measured with a multimeter in AC setting and the 13mA is measured in the DC setting. From what I learned in school current is supposed to be constant in a closed loop but as I have never learned about zener diodes I'm not sure if this is still the case. Does this make sense to anyone?
 
Last edited:
As far as using a trasnformer I'm trying to stay clear of that.
Why?
I just recently learned abut zener diodes and I plan to make a full wave rectifier, but replacing two of the regular diodes with 12V zeners and use that as my DC power just like the image below, except the left two diodes I replaced with 12 v zeners.
This cannot end well.

Have you ever heard the saying "a liitle knowledge is a dangerous thing" ??

All I can say is that you are running a lot of risk by not using a transformer to give isolation from the mains.

And the bridge rectifier with 12v zener diodes? are you going to connect that to the 120v mains and expect to get 12v DC?
I dont think so!

JimB
 
Hello again,

Another point is that if you want to connect directly to the mains then use one 12k resistor on the 'hot' side and the other 12k resistor on the 'neutral' side. Of course we already decided that these resistors would have to increase in value for the circuit to work properly, so perhaps two 20k resistors one on each side of the line. At least that way you get a little isolation from the direct line.
 
Another point is that if you want to connect directly to the mains then use one 12k resistor on the 'hot' side and the other 12k resistor on the 'neutral' side.

And this would result in the microprocessor sitting at 60v above ground potential!

USE A TRANSFORMER!

JimB
 
Hello,

Yes, that's right. There's only a danger if you are not aware of it or you dont know how to deal with it.

Offline power supplies are nothing new, they've been around as far back as i can remember. There are recommended practices that go along with that kind of technology, but it's still quite popular today for light current applications.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top