> -----Original Message----- > From: Jeethu Rao [SMTP:jeethur@SANCHARNET.IN] > Sent: Tuesday, October 22, 2002 9:22 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE]: Maximizing ADC Range > > Hi, > I'm working on improving(actually reimplementing) an existing > analog > Circuit using an MCU. Its for a grain color sorter(used for > sorting > rice) I'm using an AVR 8515 for this. That does not exactly > constitute > the problem. > > The problem is the application. It is to detect the color of a > singular stream of rice, which passes through an illuminated chamber. > Two photodiodes with a dichroic beam splitter detect colors of > the > grains against a distinctly colored background plate, In > the analog > ckt, lighter shades give a higher voltage and darker shades > lower > the signal voltage. It works well in analog, with some 14 > OPAMPS > (LM725s and 741s) For each photodiode. So, I have > an average signal > on the photodiodes (for instance, 2.5 volts) with all the lamps > lit > up. A black grain gives a lower signal (say 2.2 volts), > while a > normal grain will not get as low as that, might get a little > higher > if it's a little lighter than other grains (In the coffee > > industry, we call such grains Bleaches, but there's no > nomenclature or purpose for that in the rice industry), but > never will the signal rise above 3 volts or so. > > Now, if I set the ADCs ref to 3.0 volts so that it reads 1023 > (AVR AT90S8535 has a 10 bit adc like a PIC16f877), I'll be wasting > 2/3rds of the ADCs range below 2 volts. And the ADC on 8535 > doesn't have a VRef- input. And even if I use an adc with both Vref+ > and Vref-, The brightness of the CFLs used in the illuminated > chamber tend to deteriorate over time, so the mid point will not > always be the same, > it shifts over time. And another problem is that the ADC > readings initially will be low, since it takes a little time for > the > lamps to attain full brightness. The solution In the analog > circuit is > to compensate the value with a multi turn pot for zero setting. > But > this is inelegant. My idea is to use two DACs to set the Vref+ > and > Vref- once the mid point has been determined. I'm not sure if > this > Approach works well. A simpler approach would be to use a higher > res > ADC (~16 bits), but I need an SPI ADC,(low pin count) and I'm > using > Microchip MCP3201 (12bits) for this. I guess there is a pure > analog solution to this problem , just using OPAMPs. Could you > folks please enlighten me in this regard ? > > This is a simple dynamic range problem, you either cover a large range with poor resolution, or a smaller range with better resolution. What you need to define is what resolution is acceptable for your purpose. You can get 16bit ADC's with an SPI interface, but they are not at all common and most of them use a DSP type interface rather than plain SPI. Take a look at the Linear Technology LTC1865. Alternatively, you could consider oversampling and averaging to give you more effective bits. You need to sample 4^n times where n is the number of extra bits you want. The beam splitter arrangment sounds very simmilar to an arrangement we use to wavelength lock tuneable lasers in the fibre optic communications industry. The difference bwteen the two diodes gives wavelength information (i.e. colour), and the sum of the two gives us optical power. If this is the way your system works, then you can automaticaly compenstae for differening light levels by using the sum term to scale the difference term. This would mean no manual reset is required. Regards Mike -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body