Readily Available 8ch, 10-12bit A/D

Status
Not open for further replies.
Nigel Goodwin said:
with such a low level of electronics knowledge

Disclaimer: I am not upset... the quoted comment was based on my post, but I would just like to clarify so that any further help I recieve will be given in the correct context (that I am not absolutely cluleless )

I have a degree (B.S.) in computer systems and electrical engineering where my primary focus was on the computer side so my analog electronics skills are lacking, but I would not consider myself having a low level of electronics knowledge. My 'resume' includes an NTSC signal generator and a complete web, telnet, and ftp server implemented on an AVR... This is not meant to 'wow' anyone as I'm sure what took me months you guys could do on a rainy Sunday afternoon, but I think it at least puts in perspective where I stand.

Now for the fun stuff... Since I apparently meet all the requirements for a project bound for failure I am going to post my circuit/application and I am seeking feedback on any/all aspects.


Application Description:
-We have a matrix of bins (in the case of the schematic 3x2=6 bins -- but this could be expandable too 50x50 if need be).

-Each bin can hold zero or 1 object at any given time

-There are 300 hundred objects, but only 30 unique types so duplicates are available

I want to be able to identify which object is in which bin when a button is pressed.

Schematic: **broken link removed**

The schematic shows Row1/Column1 'On'... So essentially I am reading what is in bin1. Bin2 is an empty bin.

I added the diodes because I dont want the current represented by the red line in the schematic.

Hope this is clear now and I do appreciate your help, even though I disagreed with the approach I do believe you guys are well intentioned and here because you enjoy solving problems and helping others.

B

PS Philba, I am in Seattle too.. Well Kirkland.
 

No disrespect, but 'computer' and 'electrical' are a long way short of 'electronics' - what really stood out was asking for a 0-12V A2D converter!.


'Clear'? - clearer perhaps, I know it's not easy but you've told us things we didn't need to know (like bins - a matrix of resistive sensors, which presumably they are?, is all we needed). But you've not told us things that would be useful - like what processor you're thinking of using?, and why you're looking at an external A2D?.

But as for the circuit you posted, why are you switching the bottom end of the matrix?, you simply need to read the A2D that's connected to that row, if you're not reading it, it doesn't matter if it's shorted down to ground or not.

As I suggested previously, a PIC16F877 includes 8x10bit A2D inputs, and for only eight rows would do everything you require. For more than eight rows, you could use CMOS switches to select the A2D's in banks of eight. With the values of your resistors you would also need to buffer the inputs (8 opamps?), to meet the source impedance requirements of a PIC A2D.
 
What is the mechanism for differentiating one object from another? Does the object complete some kind of circuit inside the bin with a varying resistance or something? Can I assume that the bins are actually just component sockets, and the objects are resistors, with different values of resistors being different objects?

1. What is the purpose of Q1-Q3? and Q37-Q38?

2. How did you plan on separating the readings from bins 1-3 and 4-6? It looks like all 3 are always feeding into the same ADC input.
 
Last edited:
Assuming that the bins are, indeed, resistive, it appears that you are using the transistors (and an unseen uC) to matrix the bins. This is much more complex than needed. I would simply make a voltage divider with each bin. then read the voltage via a seperate ADC channel (or use a switch like Nigel said).

From your circuit, it appears the bins have a wide resistance range (0 to >.5M). The input impedence of most uC ADCs is around 10K, so you may have to use an op amp to meet the input impedence requirements.
 
For me, I would make transistor-switched branches. Each branch would contain 8 bins (or however many channels the ADC has). Each bin in a single branch would have it's own ADC channel...but this channel would be shared with other bins in other branches. By only activating one branch at a time (ie. with the digital output pins of the uC), the ADC only sees a particular bin from one one branch. You could then switch branches sequentally and record the readings. There would be a buffer before each ADC input, and just before that a resistor gong to ground (to form the resistive divider). I can draw a schematic later....just not now.

You can always add on more bins by adding on more branches- the requirement being that for each new branch that is added on, you lose another digital output line (used to switch that branch on and off). But digital lines are more plentiful than ADC lines anyways...on PICs at least....(I'm assuming you are using the ADC and digital output lines in a microcontroller since it is way more convenient and easier than learning to communicate with a stand-alone ADC.)
 
As others have suggested, I would try connecting the bin and the sense resistor in series across the 12v supply, then connect the bin/sense resistor junction to the input of an analogue multiplexer, the output of the multiplexer to the ADC. Use the digital outputs of your microcontroller to address the analogue mux.

That way you should lower the parts count, do away with your unknown volt drops on diodes etc.
Also the 12v supply to the bins does not need to be 12v, it could be a more managable 5v, or even Vref from the ADC stiffened up by a voltage follower. That way you are just looking for the ratio of Vref to Vbin to measure what is in the bin.

JimB
 
Here is what I would do (see image attached).

This if for an ADC with 3 channels (therefore 3 bin resistors per branch). If there are more ADC channels, just stick add more bin resistors in parallel onto each branch and connect the end of additional resistor to an additional buffer-ADC channel.

Each bin resistor in the equivelant location among the branches connects to the same buffer-ADC channel. The MOSFET switches the entire branch on or off (high-impedence will switch the branch off, while a low will switch the branch on...a high will also probably switch the branch on since a logic high of 5V is smaller than 12V enough to switch the MOFSET on.) You switch one branch (and only one branch at a time) on and then take the ADC readings across all ADC channels, and then switch the branch off, and move onto the next branch. You move through all the bins this way.

The VRef divider-buffer scales down the 12V to a readable level by the ADC to serve as a reference. You want the resistive ratio formed by Rdiv1 and Rdiv2 to reduce 12V down to about4.5V...a little less than the maximum of 5V for saftey reasons. It provides the ADC with an equivelant voltage reference for the 12V whose fluctuations do not follow the microcontroller's own fluctutations in it's 5V power supply (which the microcontroller uses as the standard voltage reference for it's ADC).

THe ADC buffer circuit is just really a half of a voltage divider (the other half is formed by the bin resistors) connected to an op-amp configured as a voltage-follower to act as a high impedence buffer. This is then connected to another voltage divider that has the same ratio as the Vref divider and is used to scale down the bin voltage so it can be read by the ADC. THis divider then feeds into the final buffer which goes to the ADC channel. The reason for the two buffers is that you cannot cascade two voltage dividers directly since voltage dividers do not necessarily have a high impedence input and need to drive a high impedence load. They can only drive a high impedence load because a low impedence load introduces resistances that are in parallel to the divider output, thereby distorting the divider's ratio. The buffer provides a high impedence input and low impededence output between the dividers (and the ADC).

The +5V and +12V Op-amps are DIFFERENT. They handle different voltage ranges (the supply voltage being the maximum the op-amp needs to be able to handle).

Hope this helps.
 

Attachments

  • PAGE1.jpg
    100.5 KB · Views: 105
Last edited:

Maxim makes an ADC with analog inputs that can go from AGND-16.5V. So I dont think asking where I can find one was all that absurd. https://www.electro-tech-online.com/custompdfs/2006/09/MAX1270-MAX1271B.pdf

Did I misinterpret the datasheet?

No disrespect taken, but as I said I was just giving you guys insight to my background -- I was not trying to say that since I have degrees I am inherently good at electronics.

I told you a matrix of bins because thats what they are. I dont know what a 'resistive sensor' is... I am not using one (maybe I should be) but the schematic is my actual implementation.. The bins have two contacts and the object with the resistor completes the circuit.

MAJOR OMISSION THAT I TOOK FOR GRANTED: The objects contain a resistor, which can be 1 of 30 values.

For what its worth I'd be using an ATMega16... I wanted an external A/D because I wanted more channels and I wanted a larger range on the analog input pins. I didnt want to deal with switching 'banks of 8' because I felt the switch would have its own loss associated with it and I am aiming for accurate readings.
 

I apologize for this omission... You are correct in assuming the bins are just sockets and the objects complete the circuit via a built-in resistor

Q1-Q3 turn 'on' the colums, and Q37-Q38 turn 'on' the rows.... I want to be able to switch off the colums so I can read individual bins, I want to turn off the rows to reduce power consumption

If Q2 and Q3 are off then only bin1 is being read... I think answers question 1 actually answers question 2.
 
Well it doesn't really matter what ADC voltage range is used...I'm just saying it's easier to handle everything if the digital outputs to control the branches and the ADC channels are all on the same microcontroller. If you want accuracy try a dual-slope ADC (the price for accuracy is loss of sampling speed which probably isn't an issue here since you can't replace bin resistors so fast anyways)...but accurate is a relative term. How accurate do you need it? How close are the bin resistor values going to get to each other. Technically with such setups you can pretty much measure the value of the resistor anywhere between 0ohms and a maximum value rather than just "30 values".

A large analog range doesn't matter too much...it's the bits that really matter since you can step down the 12V AND the ADC input and still have the same number of bits and therefore the same resolution. There may be losses involves with the stepping down process and offsets introduced by the op-amp which can be minimized if you are careful about the op-amp you pick (it's not hard to find one with offets orders of magnitude smaller than the minimum resolution of the ADC). But this is probably moot since resistor tolerances are much higher than the errors introduced by these offsets. You just search op-amps tables on Maxim's website.

The way you have it wired up in your circuit does not allow the transistors in your circuit to be switched...they are just always at some static state it seems...no microcontroller pins or signals anywhere...

Also...you know the MOSFET switches have about the same losses as your BJT switches right? It doesn't really matter.

I edited it my last post and schematic to step-down the bin voltages so that they could be read to the ADC.
 
Last edited:


Thanks for your suggestions... I have to really sit down and try to make sense of it all before I reply... But to answer your question the transistors will be switched by a uC. I stated that the schematic is shown with row1/column1 in the 'on' state, but failed to mention that is initiated by the uC (ATMega16)
 
Oh, I see. You replaced the uC pins with static voltage sources to represent an output state.

You may need a darlington or MOSFET rather than a pure BJT for those switches since the uC might not be able to provide enough current from its pins.

One last thing you should consider is the part count per bin...it's quite high. 50x50! (I'm obviously biased towards my circuit in this aspect).
 
Last edited:

The reason I matrix is due the expandability... Like I said I want to be able to expand this to a matrix of 50x50 bins... In the initial case I only would need 6 ADC channels... but 50x50 I would need 2,500 as opposed to 50.

You are correct about the unseen uC.

Isnt using a switch essentially the same as matrixing or did i misunderstand your implementation?
 
Matrixing must requires switches, but not all switches require matrixing applications. You are basically using the BJTs as switches, but there are many types of switches. Same thing. I prefer MOSFETs over BJTs...it's just me. Simpler switching requirements (lower current and voltage controlled). It just means larger MOSFETs can be switched directly by a uC pin. Make sure you understand how to switch MOSFETs and BJTs on and off and their voltage/current requirements at the base(BJTs) or gate (MOSFETs).

Yours goes by a cartesian grid. Mine goes by clusters of #N, where N is the ADC channels available. Mine is not quite matrixing, it's more clustering or branches. Mine is arranged more like bytes in computer memory than a table. To expand mine you add on additional branches. It doesn't have the geometric row-columns grid bin selection like yours. However, the reason I made mine was part count and expandibility cost (like I/O pins) are much lower for large scale, which was pretty much the only thing I had in mind when I was making it.

The Maxim ADC you posted, 12bits isn't that great. You can get that on Microchip's dsPICs standard. Not sure about AVR (I assume it's 10-bit).

Your circuit:
*Geometric organization
*Possibly only one ADC channel required with some modifications (I believe the biggest step is to make the diodes unecessary)
*100 digital pins for 50x50 bins
*You still need to add buffers of some sorts
*New connections to expand circuit ~= number of rows or columns

My circuit:
*Branch organization
*Requires at least 25 ADC channels to have 100 digital pins for 50x50 bins
*25 ADC channels only available with 44+ pin uC like the dsPIC. This number of channels not available in a single stand along ADC IC
*Ready to interface with 5V uC (only matters if you are using uC's ADC)
*lower part count
*New connections to expand circuit = Number of ADC channels + 2 (1 digital line & +5V)

The organizations of both my circuit and your circuit (as is) are dependent on the number of ADC channels available. For "square" matrix organization you need 50 ADC channels. Any less for 50x50 bins, and you would have to have longer rows(or columns) and shorter columns (or rows).

I think the most important things that you can do for your circuit is to:
-to add buffers
-make it so only one ADC channel is required (you can't sample & read all ADC channels at simultaneously anyways, yours is not a speed critical application)
-I think if you can remove the need for diodes then you can easily adapt your circuit to one ADC channel.
-change BJTs to darlingtons or MOSFETs
 
Last edited:
Ok I finally got a chance to think about your idea...

I am certainly going to use MOSFETs now.

I would also love to get rid of the diodes, because like you said my part count per bin is high. I also dislike the diodes because according to the datasheets the forward voltage of a diode can vary which really throws my expected analog values off.

As for rearranging the matrix into 'branches'... I understand the benefits and still need think about this some more.

Thanks again.
 
On the issue of input impedance to the ADC channels... The AVR has a reccomended 10k. If I am either too high/low does this only affect acquisition time or is accuracy also affected?

B
 
I believe the issue is the amount of leakage in the ADC input circuit. The sample hold capacitor needs to be charged above the discharge rate determined by the leakage. So, I think it's accuracy that would be affected if your impedence is too high. you could let the sample cap charge longer. as long as the input is more than the leakage current, eventually, the cap would charge up. you could calculate that time via the RC constant (5 RCs, I would guess). lower impedence isn't an issue.

For example, the PIC16F877A datasheet has a diagram that shows 500 nA leakage. I would assume the avr has something similar.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…