Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Color Blocks Detection Help Required.

Status
Not open for further replies.

fenderman

Member
Hi All,
This is related to Model Railroad's, I am building the classic 'Imglenook Sidings' and 'Timesaver Sidings' shunting puzzle layouts and want to 'interface' these into a PC (probably via PIC chips etc).
Both these puzzles use 'wagons' with colored blocks in them (there are 8 different colors required).
These 8 wagons can be placed at random in any of 15 different, but defined locations on the layout.
I want to be able to detect which wagon (by its color) is in whcih position on the layout at any given time, and pass that to a PC for further processing.
My question is related to the detection of the different colors, is there an easy and cheap way (I have to make 30 of these in total - 15 for each layout) to produce these?
I can design and produce my own PCB's and have experience with PIC's / Micro's, VB and C++ so am happy with all that side of things.
It's the color detection where I would appreciate a little guidence, assistance, advice etc.
Many thanks ... hope it nudges someone's interest !

Roy
 
Does each wagon have just one color on board? Sometimes, intensity (gray scale) alone is enough. Look at the false color pictures of space one sees. If you really need color, then the usual way is to view the object though a colored filter. Again, you may be able to obtain adequate discrimination with just two filters (or white plus one filter) instead of three. Each color can be defined as a ratio of intensities for the image viewed through the two or three filters.

John
 
Last edited:
One option is CDS photo cells with a simple plastic lens to focus the light a bit and colored filters like jpan recommended. CDS photo cells have a light response very similar to the human eye and the filters. Don't know how cheap that would be and like jpan said you'd need at least two possible three sensors per device depending on the actual colors of the blocks.
 
Hi and thanks for the quick replies, the shade or color of the blocks is not too important, so long as it can see a difference between 8 different shades / colors.
Each block is a single unique color, which I think may make it easier and more reliable to detect.
The wagons will be far enough apart that the detector for that position would only see the wagon in that position and no others.
I'll have a look at both suggestions, any idea's on where I can get circuits for these ?
Roy
 
Last edited:
Hi All,
Many thanks for all your replies, but after checking out overall costs, I've decided to go down the route of each wagon having a unique code transmitted repeatedly by a battery powered (XLP) PIC chip on an IR led and a receiver IR Transistor again into a PIC where it will be de-coded etc.
This looks to be the most efficient and cost effective method and least amount of 'work' on the wagons and baseboard.
Thanks again for your advice etc.
Roy
 
I know I'm a bit late here, but if I read you correctly you just want to read the colours into the PC. Personally, I would just get a webcam and position it so that it could see all the wagons and get the PC to do the simple image processing. As you can program in C++, it should not be a problem for you, especially if you use the OpenCV library as a starting point.
 
Cheers Dougy83.
Thanks for the suggestion, the PC aspect of it is further down the line, the main object is to detect wagons in various positions on the layout and communicating these into a control PIC for further processing, I have opted for assigning a number to each colour (Wagon), and 'transmitting' these via infrared to a series of receivers built into the track bed, where each wagon 'sends' its current location etc.
The 'proto type' veroboard unit I've built works fine, so now I need to do a PCB design etc as I need 30+ in total (now that a couple of other 'members' have seen the idea, they want to do it as well) ...
regards
Roy
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top