Why are my ADC readings messed up? (Arduino example)

Поделиться
HTML-код
  • Опубликовано: 18 окт 2024

Комментарии • 35

  • @filips7158
    @filips7158 2 года назад +8

    Put a cap parallel to the divide output and add an emitter follower or an op amp follower. You get very low impedance output and you can sample it very fast.

  • @jonathangainsford6811
    @jonathangainsford6811 2 года назад +6

    Hi Jacob, would appreciate if you could add more content of embedded systems coding, best practices and tops and tricks I am self taught and always scanning for learning and improving my skills.
    Thank you for the great channel I appreciate your time,
    J

  • @m0Ray79
    @m0Ray79 2 года назад +7

    AFAIK, ATMega has a separate pin for ADC reference voltage. Why not to use it, maybe, with a resistor and zener/LED?

    • @edgarbonet1
      @edgarbonet1 2 года назад +3

      Right. There is also an internal band-gap reference that should be quite immune to power-supply fluctuations. Its is somewhat low voltage though (1.35 V IIRC).

    • @katiagalkina4607
      @katiagalkina4607 2 года назад

      @@edgarbonet1 that is still full of white noise both from power supply and wires. the most clean output of uno adc in my experiments is just to feed the supply voltage to external reference pin.
      in this case as mentioned, the surge current of motor upon action and sampling rate of adc causes the problem.

  • @andreidaniacovache
    @andreidaniacovache 2 года назад +4

    Doesn't the arduino have an internal voltage reference that you can use? Most microcontrollers I've used have that. Googled it and it seems it does have an internal 1.1V reference, that you can use, of course you'd also change the resistor divider to bring the signal to that level. Wouldn't that be a better quick fix that the battery?

  • @johntoe6127
    @johntoe6127 2 года назад +1

    I try to put all inductive loads on their own power supply. I use input from a 12v or 9v wall cube. Then split that between two inexpensive buck converters that drop the voltage. One buck converter powers all the inductive loads (motor/solenoid/relay/servo) The second buck converter powers only the microcontroller. The MCU then has it's own power supply with nothing to cause surges. The 12v Vin can usually easily handle varying loads from either buck converter.

    • @brandontay2053
      @brandontay2053 Год назад

      This is usually what I do too! It has worked pretty well so far!

  • @datawolk
    @datawolk 2 года назад +2

    I think in this case its the sample and hold circuit of the adc. Since the aref of the Uno is on the 5v supply rail. So it should be proportional to the voltage drop.

  • @berk473
    @berk473 2 года назад

    Great knowledge👌🏽!

  • @portblock
    @portblock 2 года назад +1

    simple way, use an precision reference voltage for the ADC
    LM4040 or similar

  • @tobias4lyph
    @tobias4lyph 2 года назад +5

    Cardboard and tape craft science is what I do best ;)

  • @Error_00101
    @Error_00101 2 года назад

    Ugh i remember when we learned about this in school. There is a whole field about providing clean power to all components (with lowpass filtering, shielding, dividing power correctly,...) there are all sorts of things you can do with hardware to prevent these things. When we measured with our µControler and had (more or less) the same problem to solve only we HAD to use the power provided via the controller (part of the exercise).

  • @rexjuggler19
    @rexjuggler19 2 года назад

    Good one.

  • @omargamal665
    @omargamal665 Год назад

    very useful thank you

  • @RespectEdits
    @RespectEdits 2 года назад +1

    Could adding a capacitor to the power supply fix the issue?

  • @OmidAtaollahi
    @OmidAtaollahi Год назад

    tnx. great.

  • @fluiditynz
    @fluiditynz 2 года назад

    There's another common issue I've dealt with in the past which is charge couples input voltage sharing between channels. Especially with high impedence inputs and rapid channel switching (which I used to have back in the old days using assembler. If you're running python it's kind of slow so might not be an issue but otherwise you might need to do some dummy reads or extend your input sample time depending on your hardware and how much into the nuts and bolts you're having to dive to extract the readings. i.e. for Arduino, it's already hiding most of the work of doing an analogue reading behind the calls you make.

  • @brianczuhai8909
    @brianczuhai8909 2 года назад

    You are measuring an independent absolute voltage source with an A/D. Your input is not ratiometric with the Vref.
    To measure absolute A/D voltages, you need to also feed in a stepped down Vref and a precision voltage reference into 2 other A/Ds. Then you can derive what the voltage of Vref is.
    A/Ds read a count value relative a full count value representing Vref. It is wrong to assume your A/Ds read absolute voltages.
    You need a discussion on ratiometric A/D configurations and one on what’s needed to read absolute voltages on A/Ds.
    The easy way out of this problem is to use a weight and pendelum or connect the arduino to a clean power separate from the motor power. Vref ~= 5V and be fairly stable.

  • @KangJangkrik
    @KangJangkrik 2 года назад

    Hobbyist-grade sensor often either biased or a bit noisy, need to be calibrated and filtered in Arduino program. This is why industry-grade sensor like Siemens and Omron are bloody expensive because calibration is hard to do and they did the job very well

  • @PinakiGupta82Appu
    @PinakiGupta82Appu 2 года назад

    Please make a video on the Adafruit TinyUSB library and its implementations in CDC and HID (both host and device) modes. It would be better if you can use something which incorporates an RP2040 controller. Raspberry Pi Pico is cheaper. The codes should perform simple tasks without making things difficult to understand.

  • @zyghom
    @zyghom 2 года назад

    Thank you - I realised similar issues some time ago, and since then, all my MCU based sensors have: LDO and bunch of capacitors, to make sure the Vin is as stable as possible. Vref in MCU crap ;-) (because it is probably not referenced to the Vin but Vref, however if Vin is unstable then Vref as well)
    EDIT: btw, this issue you are showing is typical: "LAB only problem" because in the real life application you were describing there was... no motor, right? ;)

  • @gdotone1
    @gdotone1 Год назад +1

    more on resistor dividers

  • @CC-tb6tj
    @CC-tb6tj Год назад

    Can you pls do a video on resistor dividers

  • @katiagalkina4607
    @katiagalkina4607 2 года назад

    thanks a lot, it was certainly interesting. 👍 but if had to do it in a more precise and reliable way I wouldn't use an Uno! Instead I'd go for a military/aerospace/life support ADC chip and a bridge to my pc with proper filtering and shielding. 😁

  • @hasanalattar9561
    @hasanalattar9561 2 года назад

    I thought you will talk about digital filters instead of caps and beads

  • @thevitruvianman9781
    @thevitruvianman9781 Год назад

    Why not an stm32 example but thanks

  • @gdotone1
    @gdotone1 3 месяца назад

    more more embedded

  • @sathirasilva4958
    @sathirasilva4958 2 года назад

    How about using galvanic isolation, though? (instead of using multiple power rails)

  • @brianczuhai8909
    @brianczuhai8909 2 года назад

    I cringe when I hear people are reading voltage levels when using their A/Ds. They need to get out of this fantasy land in assuming Vref = 5V. Ratiometric configurations address much of this. Just think of A/Ds as being a count value relative to Vref and not an absolute voltage reading.

  • @sameerplaynicals8790
    @sameerplaynicals8790 2 года назад

    you are my father

  • @unperrier5998
    @unperrier5998 2 года назад +2

    No code at all video.