Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6986

General • Re: Help with Pico ADC project

$
0
0
Ok. With a 100k resistor to 3.3V, and your originally stated values for the Mode switch (Float = 200k
Press = 100k) you can work it out (although when you press the Mode switch it should short out the internal resistor and you should get zero ohms).

With the Mode switch not pressed, current flows through the external resistor and the internal resistor to ground. The total resistance is 300k, so the current flowing is I = V/R = 3.3/300k = 11uA. At the junction connected to the ADC you will see a voltage across the internal resistor, due to the current flowing. The voltage will be V = IR = 11u x 200k = 2.2V. This is approximately 2/3 of the ADC range, so if you read the ADC you will get a number that is 2/3rds of maximum. This number (with some margin) represents "Mode not pressed".

Assuming that the resistance when pressed is 100k (because of something not represented in the drawing) then the same calculations when the button is pressed gives us: I = V/R = 3.3/200k = 16.5uA, and V = IR = 16.5u x 100k = 1.65V. This is approximately one half of the ADC range (as it should be, since you have created a potential divider with two equal resistances).

The same calculations can be done for the other switch. You are basically substituting different resistances into a potential divider. You can calculate the voltage at the ADC, or you can use the ratio between the two sides of the potential divider and calculate the result that way.

Statistics: Posted by ame — Tue Jun 18, 2024 1:45 am



Viewing all articles
Browse latest Browse all 6986

Latest Images

Trending Articles