Magnets & Coils

A Marble Run Game

Jonas Scheiwiller
ZHdK

“Magnets and Coils” is marble run game, where two players can compete against each other. Short reaction times and well targeted anticipation help to win this game where the aim is to hit a button as swift as possible after the magnetic marble passes one of the copper coils along he run.

Magnet Ball Graphic

In a physcial computing module in Interaction Design at the ZHdK we had to come up with a concept to embrace the topic “energy harvesting”. With the premise to use gamification and the knowledge that we can induce current with the use of magnets and copper coils, we decided to build a marble run with a magnetic ball, which passes through copper coils every now and then.

You have to be fast
and accurate!

That’s how we could register the exact point of time when the ball passed each coil. The game would challenge the players to press a button as fast as the can just after the ball has passed a coil. The quicker reaction wins a point. Anticipation is as important as reaction time – although it is to mention that if a player pressed too early, he did not get the point but instead got blocked for the next coil. Points and errors due to early pressing were indicated with status LEDs in front of the players. After seven coils the game was decided and the player with more points went off as a winner.

Marble Run Detail
Marble Run Detail
Copper Coil Graphic

Additionally we used a similar concept to make the input device (handle with a button) work. Both handles also were constructs made of copper coils and big magnetic balls. By shaking the handle every player could induce current which was saved in a capacitor. By pressing the button a little bit of this current was released and registered by the arduino microcontroller taking care of processing all the different input.

So each player has to charge his input device first and release some current at the exact right moment. It is crucial that one does not release too much current at once.

Don’t use too much current, be wise and accurate,
anticipate well and you will win!

Arduino Microcontroller
Arduino Microcontroller

Technically speaking, we used – as already mentioned above – copper coils and a magnetic ball to induce current. The little black rectangle attached to the coil is a rectifier, used for distinguishing the minus and the plus pole. The wires connecting the coils with the arduino are bundled at one point. By using diodes we hinder the current to go from one coil into another and make sure the impulse is delivered to the arduino.

The microcontroller also registers input impulses from the two controllers. Therefore we can measure which player reacted faster. But we also set a certain time frame of a few hundred milliseconds before each coil, which are prohibited. If somebody presses the button and a coil signal follows within our limit (500 ms) the player gets a punishment and can not get the point for the next coil. This is indicated by the red status led next to the counter leds.

Shift Register Graphic

By using shift registers we made it possible to control 2 * 7 point-leds and 2 status-leds while also receiving all the different input-signals with the limited number of pins on an arduino. (A pin is a I/O connection plug on the arduino-board).

We also faced a lot of problems in registering the induced current signals, because there was base noise of current registered all the time. It was important to only register the right current peaks, which were caused by the ball passing a coil, and not the peaks induced by some magic in the air (magnetic fields etc.). On the other hand we had to make sure that we catch every coil.

This got further complicated by the fact that the magnetic ball passing a coil sometimes induced up to four peaks of current and not only one. We approached this problem by comparing the exact point in time of a peak to the previous one. If the time distance was too short (below ~50ms) then we could be sure that the second peak was caused by the very same coil and therefore we did not include it into comparing it to the players input. If we didn’t, it would have been possible to get multiple points for just one coil.

overview marble run detail marble run dark detail marble run
top view marble run top view marble run top view marble run