Details in german language: (Roll-a-Ball-Game - Autorennen 1v1)
Translation by Deepl:
Introduction
First post here and then a longer one....
I would like to show you a project that I made in my spare time for my two sons. Maybe some of you still know the horse racing games at fairs. I haven't seen them much for a while, but they used to be quite common.
For those who don't know it: You roll a ball and try to hit the coloured holes so that the horses gallop into the finish.
Description
In my version, cars drive instead of horses run. The brown holes give one point, the yellow two, the red three and the blue four. For each point, your car moves a distance X forward and whoever reaches the finish line first is the winner. In addition, the points scored and the total score are also displayed via LED matrix. This also shows a few smaller simple animations and smileys, etc. Thanks to the Parola library, the panels are defined with two zones each, which can be addressed separately (total points on the left, current hit on the right).
Which hole has been hit is detected by a total of 4 centrally placed optical sensors (KY-033) and the cars move by means of two Nema 17 motors with TB6600 motor drivers and two toothed belts. The substructure is a mixture of sawn-to-size rain gutters and pipes made of plastic.
A total of 4 Hall sensors determine whether the start or finish line has been reached. For this purpose, a few neodymium magnets are attached to the suspension of the cars. There are also a few LEDs and two flashing beacons that visually indicate when the finish line has been reached. After the end of the game and a short pause (for the obligatory award ceremony and tribute to the proud winner), the cars drive back on their own to the starting position for the next race.
The whole game measures 1.20 m x 0.80 m, as a smaller playing surface would somehow have spoiled the fun. Of course, this size is not quite compatible with a living room - but what did that matter to the enthusiastic hobbyist before
The tracks are completely separated from each other in terms of electronics, i.e. two Arduino Nanos are installed - one for the right track, one for the left track. I solved the communication between the two sides via the wire library, with one Arduino acting as the master and the other as the slave, i.e. communication only takes place in one direction. So that the slave can also send back information, there is an extra pin as a link in the other direction... but it cannot transfer more than 0 or 1. There is only one sketch, the status (master/slave) of the respective Arduino is defined during compilation via a #define.
The power source is a 60W, 12V and 5A power supply. I have installed a switch at the positive pole so that you can easily switch the whole thing on and off. There is also a reset button that can be used to restart the game at any time.
Pictures
Interior from the side
Interior from above
A tangle of cables in a confined space
Substructure
Hardware
Here is the parts list:
Arduino Nano (x2):
https://smile.amazon.de/gp/product/B078SBBST6
Shield (x2):
https://smile.amazon.de/gp/product/B08LH5TM6C
Tracking Sensors (x8):
https://smile.amazon.de/gp/product/B07VHP6L71
Hall sensors (x4):
https://smile.amazon.de/gp/product/B07ZZCWLY2
Nema 17 motors (x2):
https://smile.amazon.de/gp/product/B07MMQH1HP
Stepper Motor Driver (x2):
Mounting plates for the motors:
https://smile.amazon.de/gp/product/B083DQLDC4
Vibration dampers and heat sinks for the motors:
LED modules MAX7219 (x2 with 8x32 each):
https://smile.amazon.de/gp/product/B07HJDV3HN
Power supply unit:
https://smile.amazon.de/gp/product/B001W3UYLY
Screw terminal strips:
https://smile.amazon.de/gp/product/B093383MQG
Connector 12V:
https://smile.amazon.de/gp/product/B06XPVJT1Z
Step-Down Converter:
https://smile.amazon.de/gp/product/B086W79QQ8
Flange couplings:
https://smile.amazon.de/gp/product/B0833PTFZM
Toothed belt & Co (5m - one set is enough for both sides):
https://smile.amazon.de/gp/product/B07PQRJL2W
Street stickers (the rest is now hanging on Junior's wall):
https://smile.amazon.de/gp/product/B0093JH002
Stainless steel balls, one set hollow and one full:
https://smile.amazon.de/gp/product/B07PSHKL6C
https://smile.amazon.de/gp/product/B006SFEN68
In addition, of course, various wooden beams, boards, screws, cables, wood, etc.
Software
The following libraries were used:
JC_Button.h
MD_MAX72xx.h
MD_Parola.h
SPI.h
Wire.h
Sketch
I'm sure there is a way to make it more efficient in some places and I'm sure there are still some possible optimizations - the code has just grown more and more over time... you know how it is. At least he hasn't developed his own consciousness and tried to launch nuclear missiles yet... so all is well
(Sketch: see original posting in german board)
Targets and ToDos not implemented
Sound
Actually, MP3 sound with a DFPlayer Mini was planned, but due to lack of free pins, full memory and lack of motivation to implement a third Arduino for it, the plan is put on hold for now.
traffic light
For the start a Ready-Steady-Go traffic light was planned:
https://smile.amazon.de/gp/product/B086V33MST
Due to lack of time this is currently on the back burner.
Set up and transport
At the moment the game is just lying on the floor or the table. In the final version, however, I would like to mount the retractable feet of a folding table at the bottom. Also, a carrying handle is to be added to the side.
Side panels and general look
The sides are currently still open - this should not remain so. I would also like to hide the holes and screws.
Clean up the cable mess
Explains itself when looking at the pictures
Conclusion
It was fun, but sometimes more exhausting than I thought... especially with my rudimentary manual skills. Afterwards you're always smarter and I think with today's knowledge I probably would have done a lot of things differently. I hope some of you enjoyed reading the description and maybe it will give some other crafters some nice ideas. My children and their friends have a lot of fun with the game.
Kind regards
Wizball/Thomas