Shop OBEX P1 Docs P2 Docs Learn Events
Prop ADC interference — Parallax Forums

Prop ADC interference

PhilldapillPhilldapill Posts: 1,283
edited 2008-06-27 04:59 in Propeller 1
I'm having trouble with an ADC. This is a 12 bit ADC, using a 5V reference that has a 0.1uF and 1000uF bypass capacitors in parallel with the reference. The Vcc on the ADC does not have any other bypass caps except the 1000uF cap with the regulator. I'm reading a VERY steady DC source - a 12V battery that is being discharged through a constant resistance. My problem, is that my value is jumping around a good bit - sometimes up to 20mV between individual samples, for no apparent reason. After an algorithym of averaging 100 samples, the output still jumps a couple mV now and then.

I'd like to get a very stable reading. Could these jumpy readings be caused by the digital logic going on by the propeller? My wiring is just on a protoboard with loos jumper wires "floating" around(not electrically, but physically). Could there be interference? What are some good ways of getting good clean samples?

The chip is a TI ADS7816 - 12-bit, 200kSamples/sec(running at about 1000kS/sec)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-26 04:12
    At the very least, you have to have a 0.1uF bypass capacitor across the power pins close to the ADC. You will always have problems with your circuits unless you have 0.1uF bypass capacitors every few ICs (1 or 2) mounted next to the ICs. There's no point in talking about other possibilities until you've done this. The problem is that the ADC itself has irregular demands for power as parts of the device switch on and off and large capacitors like the 1000uF one you have can't supply these small spikes quickly enough. The capacitor itself has some inductance and the couple of inches of wiring from the capacitor has some inductance and this will prevent the capacitor from supplying these surges quickly enough. The 0.1uF capacitors provide this very short term power source. You've already got both the 1000uF and 0.1uF capacitors on the reference voltage, but the rest of the chip needs a stable supply as well.

    Post Edited (Mike Green) : 6/26/2008 4:17:19 AM GMT
  • Brian LBrian L Posts: 60
    edited 2008-06-26 04:29
    Ditto everything Mike just said. I've had the exact same problem you're describing before, and solved it doing exactly what Mike just told you. I soldered my 0.1uF cap right across the ADC supply pins so there wasn't even a PCB trace between the cap leads and the ADC pins - just small globs of solder.
  • LeonLeon Posts: 7,620
    edited 2008-06-26 04:33
    An ADC I'm using requires a 10uF bypass capacitor, which should be close to the supply pins.

    I always use a pot initially for testing an ADC. It's makes it much easier to see what is going on.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2008-06-26 04:42
    I have used bucket loads of ADC's and not had a problem. 12 bit ADC's can certainly be problem with noise, and great care needs to be taken to avoid ground loops. I am currently using ACD0832 to monitor a 2 Pots one on each channel which are some 10 metres away from the ADC and have done continuously for months without a problem

    8 bit ADC are pretty bullet proof and are the best starting piont IMO.

    Ron
  • hinvhinv Posts: 1,253
    edited 2008-06-26 04:42
    I was looking at doing just that, measuring a 12v (actually gets up to 14V while charging) in a car.
    I was wondering, do I have to supply a reference voltage higher than voltage being measured, or is 3.3v or 5V fine?
    Which adc do you recommend for a very low sample rate, < 100Hz, I would guess?
    Low pin count and 3.3v operation, and low power usage would be good goals too.

    Thanks,
    Doug
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-26 04:46
    @Leon - I'm using a pot to step down the 12V from the battery to a 5V scale.

    @Mike - Are there any particular types of capacitors need for the 0.1uF? I would think a cap like a ceramic would be best. Isn't it true that electrolytic's have a much higher capacitance, but a higher ESR as well? I would assume the inductance is what gets in the way the most, but the resistance seems like it would too...

    The other problem I'm having is linearity. I'll scale my pot up and up until the ADC reads the same voltage my meter does(which btw, is very accurate). I'll then drop the voltage source down(not touching the pot) until the ADC reads 0V. The problem lies in betwen. Sometimes, my "smoothed" ADC readings are 50mV off, and stay that way for a good range. Anyway to combat this as well?
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-26 04:50
    @Doug - I'm using a 5V reference on my ADC. I could be wrong, but I don't think many ADC's run much higher than that for a ref. voltage. What you'll need to do, is simply run your signal through a potentiometer or voltage divider so that your signal is at one end of the divider, ground at the other, and your "new" signal in between. If you use resistors, you could use something like a 10K, and a 20K in series and tap between the 10K and ground. This way you get a voltage divided by three. In your software, to convert this back to your real voltage, just multiply your 5V scale reading by 3.

    i.e. 5V scale is now equal to 15V scale that you are measuring. I'm doing the same with a car battery, except mine is a deep cycle. I'm plotting the charge and discharge curves of it.
  • LeonLeon Posts: 7,620
    edited 2008-06-26 09:37
    Philldapill said...
    @Leon - I'm using a pot to step down the 12V from the battery to a 5V scale.

    I meant a pot supplying 0-5V into the ADC. Forget about the battery for now. It makes things much easier during initial development.

    I always use monolithic ceramic capacitors for decoupling.

    I just looked at the data sheet for that ADC you are using. It's the wrong device for your application, you simply don't need that sort of performance (200 kHz sampling) and it won't work properly on a proto board with long wires attached to it; it needs a carefully designed PCB. Anyway, they recommend an additional 1-10uF capacitor and a 10R resistor for noisy conditions, in addition to the 100n decoupling capacitor.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 6/26/2008 10:07:55 AM GMT
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-06-26 12:47
    @Phil: It is very common to combine a small ceramic cap (0.01uF - 0.1uF) with a larger electrolytic cap (1uF - 10uF) in a bypass circuit. The electrolytic cap takes care of the larger current spikes, while the ceramic manages the higher frequency noise due to it's lower internal resistance and lower inductance. As Leon said, sometimes putting a small resistance or a ferrite between the caps and the supply can also help in very noisy conditions.

    It is important to keep the leads between the caps and your chip as short as possible. It's best to use surface mount components and custom PCB layouts with a good ground plane to minimize noise.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • scottascotta Posts: 168
    edited 2008-06-26 14:50
    Philldapill,

    try this for filtering, it will clean up your signal.


    var
    long INPUT,OUTPUT
    long fy,fk1,fk2

    obj

    f :"Float32Full"

    PUB MAIN
    f.Start

    fk1:=0.9950 ''change this to adjust filtering, loop speed affects filtering as well
    fk2:=f.FSub(1.0,fk1)


    repeat
    INPUT:=YourSampleRoutine ''YourSampleRoutine returns integer
    INPUT:=f.FFloat(INPUT)
    OUTPUT := f.FAdd(f.FMul(INPUT,fk2),f.FMul(fy,fk1))
    fy:=OUTPUT
    OUTPUT:=f.FRound(OUTPUT)
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-26 21:06
    You might want to look at the voltage input? Is it a voltage divider? Perhaps a whetstone bridge is necessary. Also I use a voltage regulated precision reference on a ADC above 10 bits.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-26 21:09
    The 5V reference is from the 5V regulator with a 1000uF cap attached. This reference is also directly connected to the 5V power for the chip. Could that also be a problem?
  • LeonLeon Posts: 7,620
    edited 2008-06-26 21:35
    It's bound to pick up digital noise from the chip supply pin.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-26 21:46
    @Leon - How do you suggest a provide the 5V reference and power the chip? Should I put a signal diode in between the reference and the power pin, and have a bypass cap in parallel with the pin? With the diode, I would assume that any voltage drops from the chip changing states, would be blocked and would provide a clean signal? I'm also assuming that the diode I have in mind would not have any drop since the reference is pulling less than a uA.
  • LeonLeon Posts: 7,620
    edited 2008-06-26 21:51
    Use a separate reference. There are plenty of suitable devices.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • grasshoppergrasshopper Posts: 438
    edited 2008-06-27 01:48
    Typically I power the ADC with the ref voltage as well. Check out Digi key for Ref power regulators they cost less than a dollar or two.
  • LeonLeon Posts: 7,620
    edited 2008-06-27 03:25
    I normally do that as well, but he is having so many problems that I thought it might be the easy way out. I'm quite sure the noise he is getting is due to poor layout and exceesively long connections. I always get very stable values from ADCs, but I take a lot of care over layout and wiring.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-27 03:55
    @Leon - I'm getting better results now. I've added a 1K resistor between the Vcc and the ref. voltage. I also have a 2.2uF and 0.1uF cap in parallel with the reference. I still have 5.00V at the reference. Do you suggest adding a small inductor between Vcc and ref to further isolate any noise? Also, I plan on using PWM on the battery to bleed it at a variable rate. Do you think that a 10kHz PWM signal would cause alot of noise, and if so, any suggestions? I was thinking using an RC network to smooth the voltage and cancel any noise.
  • LeonLeon Posts: 7,620
    edited 2008-06-27 04:23
    An inductor is sometimes used like that. The PWM should be OK, if you have everything properly grounded.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-06-27 04:46
    What are the requirements for grounding in such a scenario? I'd like to use this for a MPPT, and would use the PWM to bleed charge from a solar panel(big cap in parallel), to another capacitor with a switch driven by the PWM signal in between. I was afraid that the constant on-off would cause a lot of noise.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-27 04:59
    It will cause a lot of noise somewhere. Whether it "gets through" to the logic circuitry depends on your physical and electrical design. Shielding helps. Avoiding ground loops helps. Adding power filtering helps. Slowing down the switching speed of the power circuitry helps. Lots of things help. All of these measures have costs. Shielding can be expensive. Power filtering can be expensive. Slowing down power circuitry may increase power loss.
Sign In or Register to comment.