Adding POSITION DETECTOR BOARDS

Position Detector Boards and associated

Voltage Converter Boards

Some things, you have to find out the hard way. I bought some detector boards, then started reading the details. It seems that they output 12 volt signals, which is fairly standard for model railroad electronic accessories. UhOh! RasPi takes 5 volt signals! It was necessary to buy voltage converter boards, and since I'm not very good at electronics, I hit the internet and found assembled boards that I could buy. ...no problem that throwing a little money at it can't solve. Actually, the voltage converters weren't that expensive, and gave the advantage of providing optical isolation (en lieu of direct connections). This is good!

So, I hooked 'em all up and plugged it in, one bit at a time. Detectors didn't work, until I realized that the opto-transistors had to be mounted properly. Seeing as how they detect infrared light, covering them with fingers made them keep on conducting. Duh!

Next, I powered up the voltage converter boards. The little green LEDs lit, signifying power. Covering the opto-transistors, one at a time, showed that I needed to check my connectors. Okay- - good to go. The sun set about that time, it got dark in my train room/workshop, and Wow! ...impressive! They ALL came on, both the detector side and the output side. I powered down, plugged up the 20-pin connector to the RasPi expansion board, and powered it back on. ..."crickets," as the show biz people say. The output LEDs stayed dark. "WTF?" as my grand-kids say when the grownups aren't around.

I fiddled with 'em a bit, ran out of ideas, and posted my trials, tribulations, and a few code snippets on AB-Electronics community board. Good ol' Andrew responded next morning. As it turns out, the i2C activation is done bit-by-bit. (Read the details in the full post text.) That, plus I needed to insert current-limiting resistors between converter boards and Pi Expansion Boards. I was nearly out of mounting board "real estate," but got it all to fit.

Software is next WooHoo! This should be fun.

Click here to read the details of board purchase and installation.

Click here for some software to enable and use the detectors.

Click here to move on to the Sidings and Crossovers topic.