Image sensor for a static scanner - Page 1
Forum section: electronics / projects

author: SixAB
author_rank: Newbie
timestamp: February 17, 2021, 09:38:40 pm
content: Hi,I am looking to create a mini scanner type device that can scan a small card with punched holes. The scan area is only about 20mm x 5mm and can be of a relatively low resolution 0.1mm would be more than adequate.Basically, as I don't want the complexity of moving parts, I am looking for a sensor that is around 20mm x 5mm or larger on which the card can be placed with a light above and then scanned electronically to read the hole pattern. Colour is not a necessity.One possibility would be something like the Toshiba TCD1304DG linear CCD array which has a scan length of 29mm however it is only 1 pixel wideThe final product will have a small production run of 50 to 100 devices so I am not looking to use parts cannibalised from old cameras etc.Any suggestions would be appreciated,Thanks,Six

author: magic
author_rank: Super Contributor
timestamp: February 17, 2021, 09:45:14 pm
content: I'm afraid a 100mm² imaging sensor may be pricey, solely on the basis of being 100mm² of silicon, which could be infinitely more productively spent on just about any other application.If you don't want moving parts, another option is a lens to project this card onto a smaller sensor, but then it takes some vertical space and mechanical engineering to put it all together.

author: Distinctly Average
author_rank: Contributor
timestamp: February 18, 2021, 12:17:56 pm
content: I would have thought this could be achieved with a simple Pi camera and a light above the card. Not sure how big your punched holes are though. If the light is pressed on the card then you should get defined points of light that could be read by the camera below.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 18, 2021, 01:48:18 pm
content: The camera modules designed to connect to the ESP32 (and other microcontrollers) and a mirror should do it if you have the space.Or just scan it one line at a time with the user moving the card and an optical mouse sensor to give info on card movement?

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 18, 2021, 03:10:51 pm
content: The sensor's area shouldn't matter here, unless I misunderstood what you really wanted to do. All you need is a pretty basic sensor (given you don't need high resolution) and the appropriate optics.

author: magic
author_rank: Super Contributor
timestamp: February 18, 2021, 04:50:51 pm
content: I think OP's idea is to lay the card flat on an APS-C or similar sensor and see which pixels see some light coming through the holes.Problem is, that kind of sensors are neither affordable nor easy to come by at such low quantity as 100

author: Siwastaja
author_rank: Super Contributor
timestamp: February 18, 2021, 05:43:24 pm
content: Maximum thickness of the device? I.e., can you afford optics or do you really need "direct contact"? Direct contact is a huge compromise on resolution.Diameter and pitch of the punched holes? Are the always on a pre-defined grid? A few dozen to a hundred SMD photodiodes/transistors might not be too expensive to P&P on a PCB.Also consider "scanning" it while the user swipes the card. This way, one pixel line is enough. You need to come up with a way to synchronize it, though.

author: Distinctly Average
author_rank: Contributor
timestamp: February 18, 2021, 06:39:11 pm
content: Yes, but there is more than one way to skin a cat. The idea got me thinking and so I have done a little testing. A card with good pinholes placed against a light source seems to show up well on a Pi camera. At the dimensions the OP stated the camera only has to be a couple of CM away and resolution seems to be fine. If pinhole sized pixels are suitable then it should be relatively easy to write a simple script to read the image in lines converting the dark and light areas into a string.

author: SixAB
author_rank: Newbie
timestamp: February 19, 2021, 01:28:29 am
content: Thanks for all the excellent advice so far.After reading the responses I realise that I should have also mentioned that I am hoping to make the device battery operated and handheld. As a result, I would prefer to keep the height below about 25mm or so. I envisage a small box with a slot for the card in it, an LED light source mounted above the slot in the top of the box and the sensor mounted below it. For costing purposes, the sensor in small quantities shouldn't exceed about US$40.Quote from: magic on February 18, 2021, 04:50:51 pmSomething like that would be ideal, however, as you mention both price and availability would a problem.Having the user move the card to manually scan it is not really an option, the only possible sensors I have found such as the TCD1304DG are only 1px wide, so I don't think this would be practical. Actually, though, two of something like the TCD1304DG with the sensor area spaced 0.5mm apart would probably be suitable, albeit slightly over budget, however, the 10mm package width precludes this.An array of photodiodes would be a possibility, but I haven't found any small enough.A PI camera is currently looking like it may be the best alternative, however, the field of view of the few I have looked at seems to confirm that the card would need to be a few cm away from the camera and given that it would have to include the light source above, it would make for a package that is much too big.

author: NiHaoMike
author_rank: Super Contributor
timestamp: February 19, 2021, 05:17:33 am
content: Quote from: SixAB on February 19, 2021, 01:28:29 amUse a mirror to "fold" the light path and adjust the lens to focus very close. Also, a Pi camera is designed for video with very high data rates, the cameras often used with ESP32 are far easier to interface with a microcontroller.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 19, 2021, 06:43:58 am
content: I think you can fit optics in 25mm just fine. Probably you'll need some object-to-lens distance, you can use a 45 deg mirror for this.Maybe a small integrated VGA resolution camera module would do the job. One which includes both the sensor and the lens. I don't mean any Sparkfruit or Raspberry Pi PCB module, but the bare camera module itself. These could be interfaced with a microcontroller.

author: magic
author_rank: Super Contributor
timestamp: February 19, 2021, 07:18:56 am
content: In terms of field of view, I think most typical webcams and similar cameras are about 60°, so you need 2cm distance to see a 2cm area. Mirror is surely a good idea, particularly in the 5mm direction.I don't know what's the minimum focus distance of those really tiny laptop/phone-style camera modules, but the larger webcam-style ones with m12 lens mounts and manual focus can often be focused from infinity right to the front surface of the lens and/or can have their focus distance reduced by m12 extension rings which are an off the shelf item (but don't bother, just find a right cam). Problem is those board have about 2cm diameter and similar height, so they would barely fit (horizontally).

author: Ian.M
author_rank: Super Contributor
timestamp: February 19, 2021, 07:51:26 am
content: If the box has a slot for the card, the user presumably pushes the card into the slot. That's your opportunity to scan the whole card (apart from a small strip across the edge the user is pushing from) using a one pixel wide sensor strip. It will need to be fast enough to scan the card at the highest speed a user would reasonably use to insert the card, and as others have mentioned will also need to sense card position to be able to trigger the scanning of each line of pixels. Due to the low power requirement you'll probably want a 'wakeup' microswitch that gets tripped by the leading card edge.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: February 19, 2021, 12:06:54 pm
content: @sixAB Question, do these punched tapes/tabs already exist, and if so, can you post an image?You might be able to pwn a USB digital slide scanner. These have an illuminated carrier and a short focus camera. Otherwise you might just be better off creating a mobile app that can image process the tabs - most phones do macro. Just place the tab on a black/white background to increase the contrast.If the tabs don't yet exist, why not use a standard QR code, which already enjoys a lot of cross platform support? Think cheaper, faster, better.

author: SixAB
author_rank: Newbie
timestamp: February 21, 2021, 09:04:37 pm
content: Thanks all for the excellent advice - much food for thought, I have ordered a few low-cost VGA modules one supposedly with a wide-angled lens to experiment with via a mirror.@Syntax Error, unfortunately, the cards exist, they are punched with identifying patterns by a special hand punch so a QR code is not an option.Six

author: Kleinstein
author_rank: Super Contributor
timestamp: February 21, 2021, 09:13:41 pm
content: If the holes are large enough, one may be able to use an array of capacitive sensors. The difference from paper to no paper may not be very large, but some µCs include quite sensitive inputs for capacitove touch screens.