philm400/Raspberry-Pi-Node.js-Scalextric-Race-Web-App

Help with wiring

Opened this issue · 2 comments

My Dad and I are setting up a slot car set in his basement and this seems like the perfect project to add a lap counter! I'm a web developer so the Node/Express stuff is all familiar to me, but I'm struggling with the Raspberry Pi GPIO wiring setup a little. I'm not much of an electronics guy, so could you share a little more details on how the wiring setup works? And how I might adapt it to 4 lanes?

Thanks! Love the idea of using Node for this!

Hi, This was a learning curve for me too a few years back.
The circuit is fairly straight forward (in electronics terms). I'm using 2 small Reed sensors (like those sensors used in house alarms for your doors and windows), which act to complete/break the circuit. The Reed sensors are triggered via magnets, i.e. Scalextric cars with magnatraction passing over the Reed sensor which will pull the 'wires' together inside. The resulting complete circuit can then be detected by the input on the RPi which constantly polls and monitors the input pins for a change in voltage. 0v - 3.3v
The resistors are there to ensure the circuit breaks cleanly when the magnet moves away from the sensor.
In theory, 4 lanes should be easily doable using 4 Reed sensors with them connected to 2 other GPIO inputs and the Node.js code extended out to monitor all 4 GPIO input pins. The code will also need to send out updated Websocket data packets to the frontend JS code so you know which lane has triggered.

Although only compatible with 2 lanes, if you have an ARC One base plate (bluetooth connection) under lockdown I took the Node.js app and migrated it over to use the bluetooth data broadcast by the Arc base with the web app running directly on my MacBook, no Pi required! - https://github.com/philm400/ARC-One-X

Hope this helps

Super helpful! Thank you!

I've got all the parts I need on the way. We're using an old Strombecker set, but that ARC setup looks fancy!