Using a PC microphone in to measure AC current - Page 1
Forum section: electronics / projects

author: kapytanhook
author_rank: Newbie
timestamp: February 23, 2015, 01:50:04 pm
content: Hey guys,Long time programmer, big fan of EEVblog on Youtube, beginner at electronics design.I want to to cheaply measure 220v AC current, I dont need a very accurate or noise free measurement as i use software to gather many datapoints an average them out.My test setup looks a little like the image in the attachment.I am using a little 3 dollar USB audiocard, I have had limited success.I can measure pretty accurately when a attached TV is on or off or in standby etc.The problem, I have is that after a few hours (or less) my little UBS audiocard dies on me.I don't know why, but it seems related to peaks in the power usage (etc when a attached tv goes from standby to on)The soundcard readouts are all lower than they would be with a microphone plugged in.Still I suspect it might not pick up some of high frequency spikes, those in turn might break my card.Any idea how to make this more robust? I'd love to hear your input on this.

author: KM4FER
author_rank: Regular Contributor
timestamp: February 23, 2015, 02:26:53 pm
content: First, can you clarify what you mean by "USB audiocard dies". Does it totally die and you have to throw it in the trash or just power it off and on again or ?Could it be the hardware or software driver is performing some sort of noise compensation over a long period of time and thereby canceling out your signal? I've noticed something like this happening with my software defined radio project.earl...

author: kapytanhook
author_rank: Newbie
timestamp: February 23, 2015, 02:33:38 pm
content: Yeah I forgot to specify, the microphone in becomes a straight line, it seems to be pulled up high. As I plug the USB card inI hear a thump but it has no response to any input signal. The 5v speaker output on the same card still works and the mic in line still shows up in windows. It would seem that the analog to digital converter gets toasted somehow. Restarting the computer or card fixed nothing, mic line is toast.

author: kolbep
author_rank: Frequent Contributor
timestamp: February 23, 2015, 02:37:08 pm
content: The Soundcard gives out a biasing voltage (in order to power the usual Condenser element in cheap computer mics).Perhaps it is being shorted out (or being reverse-fed) this AC signal, which is overloading, and eventually killing / tripping something....Maybe you should try the line-in instead. Perhaps also adding a cap in series with your winding on the 'transformer' would remove any nasty DC

author: kapytanhook
author_rank: Newbie
timestamp: February 23, 2015, 02:46:19 pm
content: Thanks kolbep, I didn't know that could be an issue. I will put one in and see if the next card will last longer.I'm so happy these things cost nothing or I'd be poor by now.

author: Seekonk
author_rank: Super Contributor
timestamp: February 23, 2015, 03:02:43 pm
content: I would place some back to back diodes where the cap is to clamp anything over .6V at a minimum and a 1000 ohm resistor in series with the coil.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 23, 2015, 03:55:44 pm
content: Quote from: kapytanhook on February 23, 2015, 01:50:04 pmThe trimpot R is a voltage divider, the diodes clamp anything over +0.7v and under -0.7V, just choose R wisely, I would begin with R= 4.7k, but it really depends on the voltage you get out of the pickup coil/transformer, and that depends on the AC load current... so choose it wisely.

author: kapytanhook
author_rank: Newbie
timestamp: February 23, 2015, 05:07:14 pm
content: GeorgeOfTheJungle, for some reason I don't see your image, the link is dead to me. Mind to try again? I am really curious to see it.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 23, 2015, 05:11:14 pm
content: Quote from: kapytanhook on February 23, 2015, 05:07:14 pmYeah, I must have clicked in the wrong button, sorry :-)

author: kapytanhook
author_rank: Newbie
timestamp: February 23, 2015, 05:21:26 pm
content: Thanks for the cool GeorgeCAD drawing, I skipped the diodes myself since the signal should be well under 100mv, but seing how the card is breaking it wont hurt to try.To awnswer Kolbep's question, I dont have a proper line-in on the cheapo USB soundcards that I have a stack of.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 23, 2015, 05:41:46 pm
content: Quote from: kapytanhook on February 23, 2015, 05:21:26 pmIt's when you turn the AC load on/off that there's going to be current spikes, and then the diodes do their job.

author: kapytanhook
author_rank: Newbie
timestamp: February 25, 2015, 01:01:51 pm
content: Just a quick update in case anyone is interested. It does seem like the big dc spikes killed it before, I wired it as per Georges suggestion. I also added a tiny cap in series but it seems to not change much, it seems like the diodes do their thing just fine.The only thing worth mentioning to people that might want to do the same, lots of high frequency noise throws off the accuracy of the measurement. If possible make a FFThttp://en.wikipedia.org/wiki/Fast_Fourier_transformvector. Then only focus on the frequency range between 30 and 70 Hz.Everything works like a charm, no idea yet if it will keep working for months, we will see. Thanks everyone for your suggestions.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 25, 2015, 02:07:41 pm
content: Quote from: kapytanhook on February 25, 2015, 01:01:51 pmYou can put a low pass filterhttp://www.electronics-tutorials.ws/filter/filter_2.html...

author: Seekonk
author_rank: Super Contributor
timestamp: February 25, 2015, 02:34:58 pm
content: Your torroid looked like a file photo. If your transformer looks like that it has very poor low frequency response. Any minor HF spikes on the line will swamp the line frequency. I have some very small open frame power transformers with split bobbins. I cut off the 120V winding with an exacto knife and inserted a single turn for current sensing. Even that transformer saturated.

author: mikerj
author_rank: Super Contributor
timestamp: February 25, 2015, 05:31:38 pm
content: A current transformer requires a burden resistor to perform the current to voltage conversion, I don't see one in your design! Without a burden resistor the secondary voltage can be very high.