simple black/white detector without ADC?

Brietech

Senior Member
I have an interesting problem that I will put out to the community for suggestions. I would like to place a sensor over a black or white square (created using toner on a laser printer), and get out a ~5V or ~0V signal. I would like to use the QRD1114 IR LED/phototransistor combo if possible (http://www.sparkfun.com/commerce/product_info.php?products_id=246), since I already have several of them. I would also like to do this using 1) only discrete components (no microcontrollers!), and 2) as few components as possible.

From my experimenting so far, the phototransistor doesn't *quite* saturate when it sees a white square (just normal photocopier paper), so I get like ~3V or so at the input (just a pull-up resistor to 5V on the collector, and emitter tied to ground). I basically need a 1-bit ADC =)

Suggestions welcome!
 

moxhamj

New Member
Re "no microcontrollers", are DIP chips allowed, eg an op amp? If so, you could use 1/4 of a LM324, feed your phototransistor into the +ve input, and put a trimpot on the -ve input, so you can adjust the -ve input from 0V to 5V. If you set it at, say, 2V, you will have your one bit ADC. The 324 chip will cost 30c. Trimpot maybe 10c. What is the application?
 

Brietech

Senior Member
So I need to detect the black/white state of a 7 x 5 grid of squares on a sheet of paper. Think of it like a 35-bit 'punchcard' (only black/white squares, rather than actual holes). I need 35 sensors, so I'm looking for as simple of a solution as possible (maybe a single transistor that just saturates really easily?), and I'm trying to avoid using a microcontroller in this project if I can help it (just for the challenge!).
 

moxhamj

New Member
Well you get 4 op amps in a 324 package. Also, if the threshold is the same for all (which it would be) then you only need one 2V reference, and just run it to every -ve input on the op amp package. So it would be 35/4 =9 chips and one (say) 1k trimpot. That might end up easier to wire up than transistors.

I wonder, maybe you could tweak the brightness of the led and/or the phototransistor resistor, and get a more definite signal directly with no more processing?
 

Brietech

Senior Member
the LM324's aren't a bad idea with only nine of them. I'll try just tweaking the IR intensity as well (and maybe the type of paper I'm using, to find something more reflective).
 

Dippy

Moderator
Have you tried adjusting the pull-up resistor value?

What happens if you feed the o/p into a sutiabley biased transistor circuit?

The afforementioned op-amp as a comparator sounds good to me.

Can you do a rapid/strobe and only use one op-amp comparator?
(Note: This is off the top of my head and has only had about 3 milliseconds thought, which probably shows :) )
 

BeanieBots

Moderator
What does the signal need to feed?
The obvious (as pointed out by Dippy) is to play with the pull-up.
If feeding logic, you could "jack up" the logic 0v line with one or more diodes giving an offset input to the logic levels. Otherwise, it's op amps or compariots as suggested by Doc. Descrete trannys would probably be more expensive, fiddly and larger than a few quad packs.
 

Brietech

Senior Member
about half of the detectors need to feed a 1 or a 0 into TTL-level digital inputs. The other half are a bit trickier, in that I need them to connect a TTL-level digital output to some sort of ORing circuit. I was hoping for a single-line open-collector-style setup, but we'll see, I might just have to use a bunch of OR gates. I'm trying to avoid using any kind of digital storage elements or microcontrollers, so the behavior of the circuit is completely dependent on the 'card' sitting at the input.
 

BCJKiwi

Senior Member
Just been through this with ROHM RPR220 reflective sensors.

Played with both the LED output and the pulldown resistor values.

On a white target Matt or glossy, the best shift that could be obtained from a 5V supply was around 3V. This 3V could be moved from around .5 / 3.5 to around 1.25 / 4.25 despite all the data sheet info about 'white card' being the reference standard.

Put some reflective tape in front of the sensor and with a minor tweak of the pulldown and a low LED output easily obtain a virtual square wave for near 0 to near 5V without any difficulty. Purchased a roll of Automotive detailing 'chrome' tape and that makes excellent targets for not many $$.
 
Last edited:

Brietech

Senior Member
I'm a bit worried about the reflectivity. I would really prefer to just use the direct output of a printer, for ease of use, but we'll see. I could also use that ~3V (or whatever I measure with my setup) shift as the input to a transistor that saturates at a lower voltage.
 

BCJKiwi

Senior Member
Should also have mentioned;
Input in my case was to ST inputs on a 28x1 so needed the swing to be certain of clean sensing for a count command ('must sense to must release' 1V /4V @ 5V supply).

Also found when testing the 'white card' that when tuned to the best settings, ambient light levels also moved the max/min levels a bit effectively further reducing the working range.
 

Mycroft2152

Senior Member
You need to take a page from the linefollower builders, and isolate the area being read from ambient light with shields.
 

Brietech

Senior Member
The area will be fairly isolated (and the qrd1114 chips actually have a "daylight" filter built in to the photo-transistor). This is for a "read-head" that will be mounted over a 35-bit card, as I described earlier. There will likely be very little clearance between the card and the read-head.
 

BCJKiwi

Senior Member
No, this is a rev counter on a machine.
There are two spindles - only one can operate at a time - safety interlocked by the machine controls.
Have sprayed the shafts (34 and 40mm dia) Matt black.
Split the 6mm pin striping 'chrome' self adhesive tape down the middle to get 3mm width.
Placed 20 of them equally spaced around each shaft along the axis of the shaft.
RPR 220 is set up at it's optimum 6mm distance.
Using count command in a 28x1 @ setfreq m8.
The sensor modules (including led R, pulldn R and RPR 220 on a small piece of perfboard) are mounted inside existing safety enclosures or protective mounts hence they are in a dark place.

Shafts rotate at up to 2500 rpm.
Rpm of whichever shaft is rotating displays on 7seg LED 4 digit display unit.

28x1, Philips SAA1064 7 Seg Driver, a couple of LEDS and a PB all enclosed in a box that is really too small!
PWR is from a 4.5V regulated plugpack - tested to ensure there is no overshoot or spikes at turn on or off (the 5V unit I was going to use originally did have this problem).

Most of the components were on hand - just had to buy the tape, the RPR 220s and some hardware.

75% of the job has been to do with the mounting and machining associated with getting everything set up on the machine - the PICAXE part was the most straight forward!
 
Last edited:

boriz

Senior Member
Try using a general purpose, medium gain signal transistor thus:



This will increase sensitivity considerably, but note that the on/off polarity is reversed so white=low and black=high, also note that because of the increased sensitivity, your black needs to be REALY black, IE: No ambient light.

I know it says ADC, but with a simple black/white surface, this should work fine on a digital IP.
 
Last edited:
Top