PDA

View Full Version : 500K or less triggering of a pin.



Dwayne
- 10th March 2009, 18:35
Yo folks...

Long time no see... Been busy, and trying to hold on to job. Anyhow...
What I am looking for, and would like some input involves the best way to trigger a pin when the resistance becomes 500K or less Anything more than 500K, the pin remains open (I guess closed would be ok too, for I will be checking for a change in the bit, and turning on a motor).

I want the fewest parts possible. It doesn't have to be exactly 500K. I have about a 10% tolerance or so.

My thoughts and ideas are as follows:

1. Pull up resister on a pin...Since I can use a chip with a pull up resistor, I am thinking that it may be possible to use some kind of grounding resistor, and when that pin is shorted to ground with a 500K (or less) resister (in parallel , it will trigger the pin to fall).

2. Some kind of Ladder situation in which voltage could be measured and compared to a value.... 5 V being open, 2.5 volts being 500K, 0 volts being 500K or less. This could be done on a A/D converter or comparator of some kind, but this will involve more material. (Hey , if I can do it with just one resistor, I will <smile>)

I would prefer #1, but I have not set up anything to experiment with it yet. I was wondering if any of you had played with this kind of toy?


Dwayne

anonymouse
- 11th March 2009, 19:08
myself i would use rctime, resistor to earth to help with static discharge. Depends if you need an instantaneous response or not.
all the best

Dwayne
- 11th March 2009, 21:37
Instant Response is not necessary... delays of 1 second is fine.

It seems the only thing I can think of, is a 500K resistor in series with the trigger resistance, and when the voltage gets to be about 2.5 volts or less, flip my motor on.

Dwayne

anonymouse
- 12th March 2009, 01:06
even with a resistor in series with the 500k, a pic pin seeing it in parallel is way above the recommended 10k or 5k impedance depending on the chosen chip. Myself using thermistors via resistor capacitor timing (choice dependant on environmental conditions) have had results well within the necesarry parameters.
all the best

Melanie
- 12th March 2009, 07:28
Oh Guys, stop struggling....

10K between the PIC pin and 0v. Your 500K between the pic in and +5v. Use an ADC pin. If your device is subject to noise pick-up, then put a 100nF across the 10K. That's it.

Calibration. Take an ADC reading with a Resistor at 500k. This is your minimum 'threshold'. Take another ADC reading with a Resistor at say 450k. This is your max threshold.

You now have two values... at which point you decide to signal your 'event' condition between thos two points is up to you. You may have to use 10-bit ADC as the values will be pretty tight and 8-bit won't give you much leeway.

anonymouse
- 12th March 2009, 14:32
Oh Guys, stop struggling....

10K between the PIC pin and 0v. Your 500K between the pic in and +5v. Use an ADC pin. If your device is subject to noise pick-up, then put a 100nF across the 10K. That's it.

Calibration. Take an ADC reading with a Resistor at 500k. This is your minimum 'threshold'. Take another ADC reading with a Resistor at say 450k. This is your max threshold.

You now have two values... at which point you decide to signal your 'event' condition between thos two points is up to you. You may have to use 10-bit ADC as the values will be pretty tight and 8-bit won't give you much leeway.

5/vref * 500, my apologies, teach me to post after visiting boozer

Byte_Butcher
- 12th March 2009, 16:00
Oh Guys, stop struggling....

10K between the PIC pin and 0v. Your 500K between the pic in and +5v. Use an ADC pin. If your device is subject to noise pick-up, then put a 100nF across the 10K. That's it.

Calibration. Take an ADC reading with a Resistor at 500k. This is your minimum 'threshold'. Take another ADC reading with a Resistor at say 450k. This is your max threshold.

You now have two values... at which point you decide to signal your 'event' condition between thos two points is up to you. You may have to use 10-bit ADC as the values will be pretty tight and 8-bit won't give you much leeway.

I was going to suggest using a PIC with ADC, but I thought that the ADC's needed a fairly low source impedance to drive them...
From the 16F727 data, 9.3 A/D Acquisition Requirements,
"The maximum recommended impedance for analog sources is 10 kΩ."

Is this not true for most of the PICs?


Some of the PICs have analog voltage comparators don't they? Perhaps they'd be better suited to the voltage divider with 500K resistor? I guess I don't know what the input impedance is on those voltage comparator inputs.

Melanie
- 12th March 2009, 21:52
I was going to suggest using a PIC with ADC, but I thought that the ADC's needed a fairly low source impedance to drive them...
From the 16F727 data, 9.3 A/D Acquisition Requirements,
"The maximum recommended impedance for analog sources is 10 kΩ."

Is this not true for most of the PICs?


That's why I put the 10K Resistor across the PICs input! The 500k feeds it... you end up having a 50:1 potential divider.