Can I combine voltage dividers and caps for multiple CT circuits?

I think your op.amp. is oscillating. Is it a particularly high performance one, and have you followed the pcb layout for it that the data sheet recommends? It may well be that the op.amp. requires some local supply decoupling.

I’m using the LM258A opamp from Fairchild (datasheet: LM258A-opamp.pdf (156.0 KB)). I’m not certain what constitutes a high-performance op amp (my understanding of op amps is pretty basic). I chose this device mainly because it needs only a single power supply and its power input and output characteristics meet my needs (I’m powering it with the 3.3V pin on my Arduino and need it to output 1.65V).

I’m not able to find anything in the datasheet about PCB layout (I’m still working on a breadboard though). I’ll look into local supply decoupling.

Thanks again.

The LMV358, the low voltage single supply version, has been used in the past, and I think that’s what was specified originally. You might be having problems because the supply voltage is very low for the LM358, even though it is specified down to 3 V.

The issue of the ‘no-load current’ has bothered me for some time now and I’ve gone to several other forums to discuss it and have not been able to resolve it. I am meeting with someone in the next couple weeks to help me troubleshoot it with an oscilloscope.

What I’ve found is that the power source drastically affects the readings. If I use my Macbook to power it, I get 0.03A reading at no-load. If I use a cell phone charger, I get around 0.3A, but if I switch to a dc barrel jack with a 5V wall wart, I get up to 0.7A. My uC is 5v.

I thought it had to do with ground, but I’ve tested connecting ground to earth ground, and get no change at all.

Also, I get this result using an Arduino Pro Mini, a through hole PCB and an SMT PCB. All get the exact same readings, so I doubt that it is the layout.

At any rate, I’ll post again once I use the oscilloscope.

If you search, you’ll find many mentions of noise, including a discussion of the merits of the various Arduino power sources.

I finally was able to use an oscilloscope. My 3.3V and 5V regulated supplies on the Arduino both seem kind of noisy, as does the op-amp output. I don’t think this is normal.

(Channel 1 is the op-amp output, Channel 2 is the 5V pin on the Arduino)

Adding a 100nF capacitor to the output of the op-amp dropped the noise down a bit.


I found that the times when the op-amp doesn’t seem to work coincides with a high-pitched squeal coming form the Arduino. This happened once when I was hooked up to the scope (I wasn’t able to get a screen shot) and there was a ton of noise on the op-amp output. In other words, the current readings are not thrown off simply because the caps are there when I turn everything on. Something is randomly happening in the Arduino (thinking back I noticed this squeal the first time I connected this particular Arduino to my computer). I may purchase another one, but in the mean time, I’m content with just paying attention to the squeal on power-up and restarting everything if I hear it.

I powered my op-amp with an external DC supply at around 9V and didn’t see any improvement in the op-amp’s output.

The squeal from the Arduino is worrying. It could mean that you are shorting something - and consequently damaged something - by connecting two places that shouldn’t be connected together. Is your computer earthed (if you have a 3-core mains lead, it probably is), is the 'scope earthed (it should be) .

With 150 mV p-p of noise on a 5 V supply, I’m not surprised you have problems. I see about 50 mV p-p on an emonTx running off my laptop.

My computer and the scope are earthed.

Do you suspect the voltage regulator in the Arduino could have been damaged by whatever is causing the squealing, and that that is causing the noise on the supply? (note I mislabelled the scope channels in my last post – Channel 1 is the op-amp output, 2 is the 5V pin).

I don’t know the details of the Arduino, so I cannot be certain - especially by remote control! But you do need to check the voltages between the various earths, it’s a common problem when you are connecting multiple items together.

Have you looked at the Arduino 5 V with everything that it’s possible to disconnect, including your op.amp etc, totally disconnected? If it’s rubbish then, you’re going to struggle to use the analogue inputs to measure anything much less than half a volt.

Also, try looking at the raw power without the Arduino (but if you can rustle up a resistor load that takes roughly the same current as the Arduino, with that connected. You should soon see whether it is the power supply or the Arduino that’s the source of the noise.

This is a 3.3V Due right? Where is the 5V coming from? Is the 5V used for anything? Does the 3.3V rail look just as noisy? Do they look better if you power it via the DC-IN jack (assuming you’re currently powering it via USB).

Here’s how the 5V (Green) and 3.3V (Yellow) rail look on my Due while it’s being powered via USB from my desktop computer.

You might want to consider enabling the 20MHz BW limit on the probes. The peak-to-peak measurement includes all those fine high frequency whiskers. Without that filter, my 200MHz scope sees a lot more noise (note the different y-scale as well):

That high frequency stuff probably doesn’t matter much. It’s probably too fast to impact on your readings, and depending how you’re probing, it may not be real anyway, i.e. it may be pick-up in the Arduino patch cables rather then exist in the actual signal.

Having said that, your Green trace is quite “thick” compared to mine. It’s not just the odd whisker that’s giving you a big reading which suggests your noise is fairly low frequency, so the BW Limit may not make much difference.

I’ll take a closer look at the Arduino itself disconnected from my system and at the power supply once I have access to the scope again. Thanks for the suggestions on what to look for Robert.

I’ve usually been powering the Arduino through the DC-IN jack with a 9VDC wall wart. I’ve checked my sketch’s output results while powered with a 12V battery and with the 5V USB supply and they are the same. Does this suggest my Arduino is having problems properly regulating the supply? In other words, if it was working properly, I wouldn’t need any filtering in my system?

Thanks @dBC for providing the scope screens for comparison. I had tried powering my op-amp with the 5V rail of the Due to see if that gave better results (3.3V is close to my op-amp’s minimum input power).

I’ll update once I have investigated more with the oscilloscope.

It looks like the 9VDC adapter I’m using to power my Arduino is pretty noisy. I’m not able to get any screen captures off of the oscilloscope, but it’s producing a signal similar to what I have shown in my scope screens in a previous post. It’s producing a peak-to-peak voltage of about 140mV.
When the Arduino is powered through USB, the 5V pin --disconnected from my breadboarded circuit – is still higher than what dBC showed in his scope screens. It’s producing about 90mV peak to peak.

I will try another power supply on the DC-in jack and see if that helps.

That is interesting. I can’t say I’ve ever checked on a Due, but on traditional AVR based Arduinos, that DC-in jack was usually the best way to get a clean 5V rail. All the ones I’ve looked at use regulators that are very good at rejecting noise on the DC-in jack, whereas when you power them via USB 5V they usually have nothing in the circuit and you’re at the mercy of whatever is at the other end of the USB cable.

When I get a chance I’ll power up my Due via the DC-in jack and see how it looks.

OK, I finally got around to doing that homework assignment I set myself. The attached pics are from my Due being powered by a 9V wall-wart via the DC-in jack.

  1. (Yellow) is the ~9V Vin from the wall-wart
  2. (Green) is the 5V rail
  3. (Blue) is the 3.3V rail

Looks like the moral of the story is you want to stay away from that 5V rail for anything ADC related. They use a DC-DC buck converter to generate it and you can see it’s very ripply. But they use a linear regulator for the 3.3V and it’s pretty clean.

Ouch!
Not knowing anything much about Arduinos, are they all created equal, or is there likely to be a variation between boards from different manufacturers?

Actually, that was measured on an official Arduino Due. I’m not sure if the clone market ever got into full swing with the ARM-based Due. Keep in mind though the Due is an entirely 3.3V only system. I’m not even sure why they generate a 5V rail, maybe to power external stuff? At any rate it looks like it’s not suitable for anything that ends up near the ADC inputs.

To answer your question though, at least on the AVR side of things (i.e. not the Due) I think there are clones and there are clones. The simplest of clones simply download all the design files and hit “print” so I’d expect them to be pretty close. Others “add value” by improving things, especially the power supply stuff, so then it comes down to how well they know their trade.

Judging by the number of choices here, I’d say that’s a yes…

Cool. That bodes well for this thread.

Thanks for taking the time to investigate this. It may be partly that my oscilloscope skills aren’t that advanced, but as I mentioned before my 3.3V and 5V rails don’t look anything like that. I recently found another DC adapter that I’m going to try on my system and try and get some 'scope captures.

I’m glad to learn that the 5V rail shouldn’t be used with the ADC.