Hardware proof of concept
Hardware proof of concept
Started electronic prototyping today. QRD1114 sensor shown first, as the sensor passes over the hole in the paper it reads a measurable drop. This is great news as I feared the infrared emitter would diffuse too much and reflect from the paper surrounding the hole, preventing distinctive detection.
As mentioned in a previous post, I only have six analogue inputs on the processor I can use.
This presents me a problem. I want the visitor to guess a two numbers, each between zero and nine. Hence for each digit I need four bits, each bit needs reading by a sensor, this gives me requirement for eight sensors.
I also need the processor to know when to read the card inserted, a way to do that is to have a ninth sensor at the back center of the detector slot to sense when the card hits the "back wall" of the slot, and thus should start the read.
At one point I thought it necessary to have a further sensor at the front of the slot to detect insertion of the card. I no longer think this is required as the other 8 sensors will be "seeing" the leading edge of the card go by.
To cater for this requirement I've got myself a 74HC4051 8-channel analog multiplexer/demultiplexer. With this device I can use three digital pins to select the analogue input I want to "listen to". Its like a digital rotary switch. So to the one analogue pin I can feed any of the sensors, one at a time. As I can switch between all the sensors many times a second, this is quite adequate to "scan" the sensors in order to read the inserted card. I could cascade chips to read many more inputs, but as still have five spare, I might as well use an analogue input directly for the final rear sensor than add more cost and complexity to the circuit.
You an see my prototyping of this arrangement in the photos. The black I.C. is the multiplexer. In this rig it is currently only multiplexing between the two sensors shown in the photo (the camera even picks up the little glow of the infrared emitter on the two sensors - invisible to the eye). This it does quite satisfactorily, so I'm happy enough to trust that this will scale up to all eight sensors in the next stage.
The experimentation has proven that the gap between the sensors and card needs to be small, four millimeters is about the most. It will also be important to make certain the bottom of the slot on which the card sits has a good back matte finish to get the best differential between white paper and black hole punched hole.