can the ADC in the pics test a circuit that only changes resistance in 3 ohm increments?
can the ADC in the pics test a circuit that only changes resistance in 3 ohm increments?
3ohm on what? Input Voltage matter, not the impedance step....How about Vref VS Vdd?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
The PIC measures voltage, not resistance. There is not enough information here to give an intelligent answer.
Charles Linquist
ok, sorry, i know it measures voltage and resistance effects voltage. so, i guess i will try to explain what im trying to convey. lol
basically i need to test a circuit, to see if its open or closed. the item that closes the circuit is an ematch and they are only 3 ohms, and there could be multiple ematches in series or parallel, i was thinking it would be nice to be able to tell by the adc reading, how many and maybe how they are wired. i was also thinking of using just a simple ressistive voltage divider, where R2 would be the ematch and R1 would be 10k. Vdd 3.3 , Vref 3.3 maybe less. Vout would go to the adc pin. there would also be a diode in series with R1 and R2, the adc pin would connect after R1, have to shield the pic (18lf6622 ) from the 24Vdc that would also be there every now and then. When i do the math, it is a drastic change when going from R2 being 0 and R2 being 3 ohms, but a very small change when R2 changes from 3 to 6 ohms or even 9 ohms. So what im wondering is will the adc even register this small of a change?
Simple answer: If full scale =0 - 3.3V, and the adc is 10 bit, LSB = 3.3/1024 = 3.22265mV. I would think you should plan for 1LSB error so you could detect ~6mV worst case. Now there are plenty of debate around here about 1024 vs 1023, but I live in 1024 world
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Even though the A/D is 10 bits, you won't get a lot of accuracy unless you have a dedicated Vref and you average a lot of readings. You might get 9 bits of accuracy in that case.
You can do a lot better if you amplify the signal with a rail-to-rail input / rail-to-rail output op amp.
If you don't want to go that route, you are going to have to get a bigger voltage change than you will get with your setup. First, R1 will have to be smaller than 10K. I don't know how many "ematches" you plan to have, but 330 ohms would seem to be a good value. Of course, the resistor would have to be a 5W type. This will give you 72mA through the resistor, and .218V across 3 ohms. You will also need a 2K 1/2W resistor between the junction of R1 and R2 and the PIC input to protect it when the switches are open. That should give you enough signal to work with.
Charles Linquist
Charles Are you saying it won't detect 6mV changes?
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
I'm saying that it won't detect 6mV changes reliably. If you can't tolerate the current draw of a smaller R1, you should use an op amp with a gain of 10 or so.
You CAN detect 60mV changes reliably.
Charles Linquist
I'm with charles...what made you choose 10k for the upper resistor?<br>
<br>
If you fed say a fixed voltage 1.024V to the top of the resistor chain, and brought R1 down top something more appropriate like 100 Ohms. (the chain would be a draw about 10mA so would need external power)<br>
<br>
If you then go with a PIC12lf1822...you can set its ADC poistive reference to its internal vref of 1.024V (even if it's supply is 3.3V)<br>
<br>
if you used 10 bits, this in theory would yield 1mV resolution (can't predict how noise will start impacting here though!) ....which ought to be sufficient.<br><br>Another idea would be to have the 3 ohm device turn on/off a mosfet, which IN TURN then kicKs in higher value resistors in your divider chain ...which would make the whole thing a lot easier.<br><br>Without seeing more details, I'm not sure ADC is the solution ....can you ground these 3 ohm devices so they could for example pull a PIC IO pin down to ground - this would be a far more robust method of establishing which device is on or off....simply use an IOC interrupt.<br><br>
Last edited by HankMcSpank; - 28th September 2011 at 09:33.
well, i picked the 10k for a couples reasons -
1. i wanted the least amount of current going thru the circuit, there is 10 different circuits that will be tested. Also the device will be powered by a 4 AA battery pack most of the time.
2. you can only put so much current thru an E-match before you have a violent reaction,, NFPA 1123 regulates me to 30ma.
But 30ma will kill some AA batts pretty quick.
I was thinking about using a 1k, but then i would want the device to be able to have some way of connecting each circuit one at a time for test and then grounding it while it's not tested, i was thinking of using a shift reg, or maybe even using 10 pins on the pic. I was thinking that this would help with not wasting battery power and maybe even keep th RF interference down from the MRF89XAM9A-I/RM transceiver.
Bookmarks