Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Just a quickie - ADC

Status
Not open for further replies.

Dakta

New Member
I've been wondering about something. (still a beginner bear with me).

When using digital inputs we tend to put a current limiting resistor on the pin to prevent it from damage.

Anyway, I was looking at trying to get a readout of my cars throttle sensor (has a convenient range of 0-4.5v), however - since the throttle potentiometer (pedal) is technically a variable resistor, won't a current limiting resistor affect teh voltage?

I know this is probably a dumb question but I don't want to cook anything, or affect my accuracy either ;) (been there, done it).

I've with-held answering this question for a while now, I was hoping to find a circuit diagram I could look at, but not found anything that uses an 'external sensor' (i.e the tps has it's own power supply, though we do share a common earth as the pic will be powered off the same batt).

Anyway, just wondered if anyone can clear up the confusion about how ADC is actually wired up.

I suppose the question is 'how do you tap into the sensors of other devices'.
 
Last edited:
You simply have to size the resistor accordingly - or if there's no chance of the input EVER going higher than Vdd or lower than Vss, you don't need one.

You might check the details of my PIC analogue tutorial to see what I did - there are restrictions on the size of the resistor..
 
Smashing stuff. I did wonder about the resistor size if one would be needed because I don't want to throw the readings out (too much anyway). I couldn't logically see a reason why you can't just tap into the sensor as per the 'voltmeter pic project example' I keep coming across, but on the other hand don't want it absorbing too much current, which led me to wondering if a resistor inline with a pot would mess up it's reading.

I suppose the tricks in the value ;) I'l wander across your site in a minute - so far being using as a reference, very handy for the digital side of things ;)

cheers - Kris
 
It doesn't particularly upset the readings, what it does is alter how fast you can read it - the sample and hold capacitor in the PIC needs to charge and discharge, and it does this through the source resistance.

It's mainly a problem if you use multiple channels, as when you switch channels it has to charge/discharge accordingly.
 
Ah right, I thought having a resistor on the pin for the purpose of protecting the pic from high current would reduce the voltage.

Resistors are not clear cut! They do one thing, then you add two and then they another ;) I've a million books but none have managed to drill it in yet. I shall persist. :D

Anyway I just thought having a pot (technically a resistor) and a current limiting resistor might actually reduce/divide the voltage somewhat (aswell as the intended effect of protecting the pic).

I'l see what happens. I've a multimeter! ;) (and thanks!) It's given me something to work with.
 
Last edited:
Putting a series resistor on the PIC pin is always a good idea to protect it from voltage spikes and 'accidents'. The voltage drop across the series resistor is directly proportional to the current being drawn through it - the PIC will draw almost no current so the voltage drop will be almost nothing too.
 
The voltage drop across the series resistor is directly proportional to the current being drawn through it - the PIC will draw almost no current so the voltage drop will be almost nothing too.

And the mist is cleared! Nigel must have been headbutting a wall with me but that seems to be the peice I had missing of the jigsaw.

This isn't easy. Simple, but not easy! :eek:

Thanks to both of you ;)
 
If you are measuring voltages that don't change quickly, you can add a capacitor to the input of the ADC. If you can use a capacitor that is larger than 100 nF, then you can use a large series resistor without affecting the accuracy. See https://ww1.microchip.com/downloads/en/DeviceDoc/39705b.pdf section 17.17, paragraph 2

For instance, if you have a throttle that opens or closes in 0.1 seconds, you can have a 100 nF capacitor to ground, and a 100k series resistor, and the capacitor will charge (or discharge) 10 times faster than the throttle can open or close. With a 100 k series resistor, the input current will be tiny even if there is a bit voltage spike and the clamping diodes will stop the input voltage damaging anything.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top