Arduino upgrade of Microwizard P2XL

DIY timing systems
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Arduino upgrade of Microwizard P2XL

Post by ironband »

Hi all,

I posted as part of another thread, but I figured this could be its own topic.

My pack has an old P2XL finish gate which has served us well for many years. We'd like to upgrade so as to be able to interface with software and eliminate manual entry of results (as well as add race time capture), but of course it isn't really in the budget. After seeing so many other folks who have used Arduino based timer solutions, I figured we could retrofit our old P2XL with an Arduino and a start switch to meet our needs.

At this point, I have a working prototype in front of me which uses little pushbuttons for the start switch as well as each of our three lanes. I built this essentially to be able to make sure I'd be able to interface with the software before I tear into the gate, and in that I've been relatively successful, running several heats with lane masking working and whatnot.

But software is my strong suit...hardware...not so much.

So, now comes the task of splicing this into the finish gate. I saw in the previous thread that at least one other person has managed this task, but attempts to contact that individual have failed.

I'd like to leave the finish gate's functionality fully intact if possible, and simply "read" the state of the existing photodetectors to my arduino, and possibly allow the arduino to reset the finish gate once the data has been communicated and a set amount of time has gone by.

I'm just not quite sure the best way to go about it. I have high school level electronics knowledge and can follow a schematic. I'm willing to learn, but could use a good hefty shove in the right direction. If successful, I will definitely document the build and share it for future tinkerers to utilize.

Thanks in advance. Our Bear den is doing an overhaul on the stopping portion of our track in May, and we plan to set up then to test the new stopping section (cars currently slam hard into a foam stop taped to the end of the track). I'd like to test the timer retrofit at that time as well, so I have some time to get it together. Cubmaster is bringing the finish gate to me next week, with the understanding that if I break it, I build a whole new one :)

Andre Miron
Pack 903
Livermore
Speedster
Pine Head Legend
Pine Head Legend
Posts: 1972
Joined: Sat Feb 18, 2012 1:48 pm
Location: Toledo, Ohio

Re: Arduino upgrade of Microwizard P2XL

Post by Speedster »

Howdy ironband,
Around 1996 I had a Microwizard timer that showed 1st and 2nd place finish. I wanted elapsed time. I talked to Microwizard and he built me a separate unit that I mounted, with double face tape, on top the original unit and the new unit shows elapsed time. The original unit still shows 1st and 2nd place finish which is not really necessary for my use. I had to send the original unit to Microwizard so he could perform his magic. I received all the wires, plugs and start switch when it was returned to me. Each unit is powered by its own battery pack. I bought a new "Best" track recently and mounted this unit at the end of the Best track on its own stand instead of on the Best track. The cars now travel 30' instead of Best tracks 29'10". Nothing holds the timer unit in place so all I have to do is unplug the wiring and take the unit into the house where it's warm. The extra unit cost $150.00 plus what I paid to ship it to Microwizard. This might be within your budget and it would all be Microwizard. The new unit matches the old unit perfectly and actually looks kinda Cool.
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Thanks Speedster,

I'm glad Microwizard was able to help you out - they are a class act and their support is second to none!

Unfortunately my Cub Master talked to them and apparently retrofitting the old unit with serial communications was going to be out of our budget (which is why the cheap arduino solution came to mind) . Even if it wasn't, I'd want to do this because I want to expand the functionality over time - for instance, I have a raspberry pi with a camera unit I want to mount on or near the finish gate. It will be recording continuous video at 90fps and keeping half a second in the buffer. When the Arduino detects a finish, it will trigger the pi to save the last half second of video and add the next half second of video, then replay it on a connected screen in slow motion a couple of times for an instant replay. This way I can have a slow motion instant replay that doesn't rely on a separate trigger.

I do appreciate the suggestion, but it looks like this is going to be my baby.

Andre
Speedster
Pine Head Legend
Pine Head Legend
Posts: 1972
Joined: Sat Feb 18, 2012 1:48 pm
Location: Toledo, Ohio

Re: Arduino upgrade of Microwizard P2XL

Post by Speedster »

That sounds REALLY COOL !!!!!!
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Speedster wrote:That sounds REALLY COOL !!!!!!
I hope it will be.

Now that I've done some research, I think I have a path to the integration, but I'll need to do some sniffing around the gate. I know the gate runs on a 9V power supply, but I don't know what sort of voltage is present in the phototransistor loop, so I'll need to check that. If it is in the 3.3-5V range, then I *think* I can just wire a high impedance digital input directly into it to detect changes. If it is up at 9V, then I'll need to figure out the best way to detect the signal without hurting the gate's stock performance. I'll cross that bridge when I come to it, but I'm thinking either a voltage divider or a transistor will do the trick.

Time to reacquaint myself with the ol' soldering gun...

Andre
User avatar
gpraceman
Site Admin
Site Admin
Posts: 4926
Joined: Fri Jun 20, 2003 12:46 am
Location: Highlands Ranch, CO
Contact:

Re: Arduino upgrade of Microwizard P2XL

Post by gpraceman »

While the power supply might be 9V, it is likely that there is a 5V converter built into that circuit.

You can still try giving Stuart, from Micro Wizard, a call. He likely will point you in the right direction for your conversion.
Randy Lisano
Romans 5:8

Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Online
User avatar
Vitamin K
Pine Head Legend
Pine Head Legend
Posts: 1246
Joined: Sat Apr 20, 2013 7:26 pm
Location: Spotsylvania, VA

Re: Arduino upgrade of Microwizard P2XL

Post by Vitamin K »

gpraceman wrote:While the power supply might be 9V, it is likely that there is a 5V converter built into that circuit.

You can still try giving Stuart, from Micro Wizard, a call. He likely will point you in the right direction for your conversion.
This is correct. The Arduino Uno can take a voltage source between 7 and 12V.

Just be sure you're running through the Vin pin, and not the 5v pin.
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Vitamin K wrote: This is correct. The Arduino Uno can take a voltage source between 7 and 12V.

Just be sure you're running through the Vin pin, and not the 5v pin.
I get that much - I'm talking about tapping the photo-transistor circuits to the Arduino digital inputs to detect when a lane finish occurs. I'm hoping those are at 5V when not blocked and at 0V when they are. If they are running at 9V, I'll need to use a splitter or a transistor or some other thing since, as I understand, it putting more than 5V into a digital input can fry that input on the Arduino.

Andre
Speedster
Pine Head Legend
Pine Head Legend
Posts: 1972
Joined: Sat Feb 18, 2012 1:48 pm
Location: Toledo, Ohio

Re: Arduino upgrade of Microwizard P2XL

Post by Speedster »

Andre, I'm following this very closely because I'm fascinated by it. Regarding your response On February 16, 2017, at 1:42 PM. I followed everything about what you said until after you said "I hope it will be". After that I have no idea what you were talking about and I couldn't even pronounce the words.
I love to kid around with folks. I Love Derby Talk, I Love the generous people on Derby Talk, I think Derby Talk is the Greatest Site on the Internet for Pinewood Derby Information. I promise I will never lie to anyone and I don't make anything up. Everything I know regarding the Pinewood Derby, and I know a LOT, I have learned from the wonderful experts on Derby Talk.
Go back to work, Andre. I hope everything works out for you just the way you have planned.
Cheers,
Speedster
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Speedster wrote: I Love Derby Talk, I Love the generous people on Derby Talk, I think Derby Talk is the Greatest Site on the Internet for Pinewood Derby Information.
Even though I'm new here, I wholeheartedly agree with this sentiment. This site was a big help in getting my family "on the podium" after years in Cub Scouting without even coming close. While I'm not all about winning, it is nice to show my son that the time and effort he put in "doing his best" with a little help from dad guiding him can indeed pay off.

And now I'm all excited to improve our tech :) Hopefully it will help someone else down the road once I get it all figured and documented.

Andre
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

OK, update - I got the finish line from my cubmaster and tore into it last night. The key is this ribbon connector:

Image

After tracing the circuit through, the pin-out is (starting from upper left)
1 - unconnected (would be used in 4 lane track)
2 - unconnected (would be used in 4 lane track)
3 - yellow - from circuit board to phototransistor lane 3
4 - orange - to circuit board from phototransistor lane 3 (terminal grounded)
5 - red - from circuit board to phototransistor lane 2
6 - brown - to circuit board from phototransistor lane 2 (terminal grounded)
7 - black - from circuit board to phototransistor lane 1
8 - white - to circuit board from phototransistor lane 1 (terminal grounded)
9/10 - grey/purple -reset button terminal 1
11/12 - blue/green - reset button terminal 2
13/14 - Ground from power
15/16 - 12V in from power

Using my trusty multimeter, I was able to confirm that when a given lane is unblocked, the voltage reading between the two terminals from that lane is low (100mV or so), since the phototransistor is conducting to ground. When a given lane is blocked, the voltage jumps to around 5.9V as the phototransistor ceases to conduct. It looks like a resistor array is used to provide a pullup resistor for each lane and then each lane is connected to the microcontroller.

Unfortunately this is higher than the 5.5V max for an arduino input, but it isn't really high, so I think putting a 1000ohm resistor in series with the input will be sufficient to protect the input. Now I just need to figure out the best way to solder/attach leads onto the 3 lane terminals and ground so that I can test my theory. Hopefully nothing blows up :)

Andre
User avatar
gpraceman
Site Admin
Site Admin
Posts: 4926
Joined: Fri Jun 20, 2003 12:46 am
Location: Highlands Ranch, CO
Contact:

Re: Arduino upgrade of Microwizard P2XL

Post by gpraceman »

Careful to not let out the white smoke. Once out, there's no putting it back. ;)
Randy Lisano
Romans 5:8

Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.
Online
User avatar
Vitamin K
Pine Head Legend
Pine Head Legend
Posts: 1246
Joined: Sat Apr 20, 2013 7:26 pm
Location: Spotsylvania, VA

Re: Arduino upgrade of Microwizard P2XL

Post by Vitamin K »

gpraceman wrote:Careful to not let out the white smoke. Once out, there's no putting it back. ;)
I learned that the first time I tried to upgrade the RAM on my brand new PowerMac as college freshman!

Did you know that you're technically not supposed to be able to install a DIMM backwards? Apparently I was too much idiot for that bit of idiot-proofing!
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Happy to report that no smoke was generated in the first successful test:


https://youtu.be/1R_juWSSQjs

I loosely attached some leads to the three phototransistor pins (3,5,7) and had a successful test. I used 1kOhm resistors to ensure that the slight overvoltage wouldn't be an issue.

So, with that done, I've now soldered leads from an old ethernet cable onto pins 3,5,7,9,11,13,and 15, and fed the cable out through the void on the top left. I've got a shield board on order to replace the breadboard, and a small relay so that I can reset the finish line from the arduino. So 3,5, and 7 will be used to monitor lane finishes, 9 and 11 will be used to reset the finish line from software using the relay, 13 will be used for common ground, and 15 will be used for 12V in to power the Arduino.

So far, so good!

Andre
ironband
Journeyman
Journeyman
Posts: 47
Joined: Mon Jan 30, 2017 9:58 am
Location: Livermore, CA

Re: Arduino upgrade of Microwizard P2XL

Post by ironband »

Update:

Almost done! I need to mount stuff in a project box and set up a long cable for the start gate switch, but everything is working!

Here I have soldered leads from an old ethernet cable onto the header in the finish line:
Image

(Yeah, my soldering looks atrocious, but the connections are solid.)

I transferred my circuitry to a proto-shield:
Image

Image

(the protoshield was a cheapy that had some extra headers on it I had to remove. Scorching looks bad, but the board is functional)

I made a little board for my status LEDs and their in-line resistors (no pic), then connected everything up with dupont connectors.

My arduino sketch borrows heavily from David Gadberry at miscjunk.org, but tweaks a few thing status wise and makes the output and serial commands mimic MicroWizard for compatibility with DerbyDay software.

The connections from the track are as follows:

Track Lane 1 Sensor -> Arduino input 2
Track Lane 2 Sensor -> Arduino input 3
Track Lane 3 Sensor -> Arduino input 4
Track 12V Power -> Arduino Vin
Track GND -> Arduino Ground
Track Reset 5V -> Relay terminal 1
Track Reset GND -> Relay terminal2

Other connections are:

Arduino output 5 -> relay signal
Arduino output 7 -> reserved to trigger Instant Replay
Arduino output 8 -> green LED
arduino output 9 -> yellow LED
Arduino output 10 -> red LED
Arduino input 12 -> start gate switch

Essentially, the cycle works like this:

On power-up, the track goes into finish mode if start gate is open, which it usually is. Otherwise it goes into start mode
Once the start gate has been closed for 2 seconds, it resets the finish line display and goes into ready mode
(while in finish mode or start mode, it is receptive to lane mask commands from the software)
Once the start gate is dropped, it starts the timer and goes into race mode.
While in race mode, it watches for finishes in each lane, recording the time of each.
After the first car finishes, it sends a replay signal to pin 7 (this will tell my RasPi camera to keep footage, record, and then replay in slow motion)
After the last unmasked lane finishes, it sends results to the computer and goes into finish mode.
If any unmasked lanes do not finish after 10 seconds, it sends the results to the computer and goes into finish mode

I have to say I'm pretty pleased, and I've learned a lot about arduino and electronics in general. I do realize now that I could have used a simple transistor to reset the start gate, and in retrospect probably should have gone that direction. At the same time, there is something about the satisfying "click" of the relay switching that will probably lead to me leaving it as is.

Video to be posted later on.

Next step is to get the RasPi camera program written and tested and debugged, then to connect that to this system and put everything in a pretty project box for mounting to the finish line.
Post Reply