Controlling ADC with new I2C version

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Mon Feb 10, 2025 12:40 pm

Just wanted to check on the capacitor types. I unfortunately don't have the correct sizes of ceramic capacitors - only 104 and 103. i.e. these ones....

Image
I have a load of the following types though and was wondering if I could use any of these instead

Image

Image

MicroController
Posts: 2048
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Mon Feb 10, 2025 1:11 pm

Yes, you can :)
The point in combining two or more of the capacitors in parallel is to leverage the benefits of the different capacitor types: Ceramics have desirable properties w.r.t. higher frequencies while electrolytics are not so good at high frequencies but come with bigger capacitances which is good at lower frequencies.
So it's common practice to put one 100nF ceramic capacitor in parallel with a 1-10uF electrolytic to 'catch' both high and low frequency noise.

(Notice that, unlike ceramics, electrolytic capacitors are usually 'polarized' so take care to observe the stripe marking the "-" (negative) leg.)

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Mon Feb 17, 2025 8:19 am

I have now managed to get it working fairly well and have ordered some more capacitors/ resistors. My next challenge is how to wire it up to read from 4 different probes. I have done a lot of Googling and can't find anything.

Ideally I would use a single fixed resistor and capacitor to save space but can't think of a way of doing that. Similarly, setting up 4 voltage dividers would set up 4 parallel circuits but then the voltage across a specific thermistor would then be dependent upon the other legs (e.g. a thermistor may or may not be plugged in). I then thought maybe I need to power each divider using a different GPIO which I guess would logically work but not sure if this is correct? Also if the GPIO has a pull up resistor could I use that instead of the fixed resistor (although maybe I don't know what size it is).

Many thanks

MicroController
Posts: 2048
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Controlling ADC with new I2C version

Postby MicroController » Mon Feb 17, 2025 9:51 am

leenowell wrote:
Mon Feb 17, 2025 8:19 am
Ideally I would use a single fixed resistor and capacitor to save space but can't think of a way of doing that.
Won't work.
Similarly, setting up 4 voltage dividers would set up 4 parallel circuits but then the voltage across a specific thermistor would then be dependent upon the other legs (e.g. a thermistor may or may not be plugged in).
If you use a low-impedance/constant-voltage source, e.g. the 3.3V supply from the ESP, the parallel strings won't affect each other;
see for example this circuit simulation.
I then thought maybe I need to power each divider using a different GPIO which I guess would logically work but not sure if this is correct?
Can work too. But the GPIOs have an output impedance in the 10-100 Ohms range, compared to the basically 0 Ohms impedance of Vcc, so that may affect the accuracy a bit.
Also if the GPIO has a pull up resistor could I use that instead of the fixed resistor (although maybe I don't know what size it is).
Can also work. The integral pull-ups are in the 50 kOhms range, and may vary more or less with temperature, Vcc, between chips, and between pins, so not a great solution w.r.t. accuracy and repeatability.

leenowell
Posts: 155
Joined: Tue Jan 15, 2019 1:50 pm

Re: Controlling ADC with new I2C version

Postby leenowell » Mon Feb 17, 2025 11:28 am

Sorry I was being dozy. Of course the voltage stays the same it is the current that would vary by switching the circuits on and off. The simulator helped a lot to correct my mental picture. Thanks very much. When the bits arrive I will wire it up and give it a god.

Who is online

Users browsing this forum: DrMickeyLauer and 99 guests