Blog - Sketching with Hardware

Team 2 – Twister with Hardware

Published on: | Author: Linda Bandelow | Categories: 2016a, Projects

Twister with Hardware – What did Team 2 do?

-by Linda

After learning about electrical circuits and how to solder, we gained some basic knowledge of the Arduino components and its software. We then almost right away started with our projects. One of our first thoughts of a cool circuit game was going towards Twister, a game for children of all ages. We wanted to make the game more intelligent and make it work without an additional person, who is not able to play and has to work the game turntable. In our game the Arduino should be that referee, which tells the players the next move.

We started making plans on how the contact between the players and the circles on the field  would work. One problem soon came up: If we put any sensors on the players hands and feet, there would be four cables for every player and they would hang out at some side of the field.

This would totally hold up the game, because the players need to have the ability to move freely on the field and over or under each other. Another consideration was that the players would use a lot of pressure on the matt and the contacts, so the system should not be easily breakable. So we decided against techniques like RFID, light, magnets or weight.

Widerstand ist zwecklos! Said no one on Team 2 ever. 

After discussing this huge problem, we came up with the idea of using resistors as circuit closing bridges. How does this work?

The circles on the field have one conductive contact area in the middle (the small circle), and one bigger line of conductive copper tape on the outside. You can’t really see it from above, but the copper tape actually is connected to the mat. So now the resistors come into play.

The finished padThe resistor on one pad

The players wear pads on their hands and feet with one resistor each. This resistor has two contacts that have to be put on one on the middle circle, one on the outer circle. Only in this case closes the resistor the circuit and the Arduino knows where the players are. But how does the Arduino know which player is really cheating? The solution were a different resistor for each body part. This then makes eight resistors and one reference resistor, for the testing.

One of the circlesThe gamefield

Just to remind you: This resistor system was the most important component of our game. If this wasn’t going to work, we could basically pack our bags. Or just play regular Twister. How boring!

So we were really anxious if this would work in the end, also because the hardware took up a lot of time and thus we would only get results in the end of the project. Well guess what: It worked (after some adjusting)! We enhanced the bridge of the resistor and the matt contacts with kitchen sponges and this  actually works really well. All the resistors were also measured correctly by the Arduino.Another component of our game was the playbox, which generates  the moves for the players. The design of the box was decided early, maybe to early. User studies showed that the signs L, O and R on the front of the box led to the believe that our game was called LOR, which is not the case. In retrospect we should have better used a square instead of the O in the middle, but we still love LOR very much.

The gamebox

The box itself has some cool components, that actually worked more easily than expected. There  is the hand/foot display, which is worked by a servomotor, and the LOR display which is lightened by 6 RGB LEDs on a strip. We were planning on giving an audio output, which tells which player won or lost. We had quite some difficulties with a sound shield for the Arduino,  because it didn’t get bought and used a lot and the documentation is not very precise. We then decided to use the LED display to show wich player lost and which one won. This worked out fine. We glued the laser cut box together at the end, after every other component was adjusted.

So about a half day before the presentation our hardware worked!

We had already started with the software throughout the project, but the game logic still had to be coded. We were slightly disappointed that the software did not seem to work correctly. The hardware components all worked perfectly, but the software always had the opinion that every player made a mistake in every single round. Consequently the game was over very fast. But for the presentation our Twister with Hardware did its job and we were really  happy about that. This was very rewarding after all the handwork and effort we had put into the project. This was only possible with the help of everyone involved in the Sketching with Hardware workshop! Thank you!

You can find a more detailed documentation of the project via this link and our source code is on Github.

Your can read about how to build our Twister in the second blog entry.

A video of our game in action is here:

Twister with Hardware – How does it work? – The Technical Side

-by Karlheinz Reinhardt

For our Twister game we wanted to be able to get the exact position of a player’s extremity on the game field. Ideally we would be able to identify which extremity is touching which field. With this possible we could implement an algorithm that can detect if a player does a wrong move, like moving a limb to a field with the wrong colour or even moving a hand instead of the foot. In addition, we would not need a referee anymore. This person could now be an extra player.

The Idea

We had a lot of ideas (RFID, light, magnets, weight, …) but the most were too expensive, not reliable enough or would not fit into our design (height, shape, …). In the end we choose to use simple resistors. In this approach we would give the user gloves with resistors inside. Each glove would have a different value, so we can identify them. Whenever the user touches a pad (field) he would close a circuit. The Arduino would detect this and measure the resistance. Because of the different resistor values it would be then able to identify which extremity has been pressed onto the field. In order to measure the resistance correctly we decided to connect each pad separately to an Analog-Pin of the Arduino. That’s the reason why we use a small twister field of the size 4×4. We had some worries that long wires will influence the measurements, but gladly our concerns were proven wrong. Very wrong :). Even with long wires (approx. 4-7m) we could not detect a noticeable difference to our test build on a breadboard (wires approx. 30cm). The only problem that occurred was when we taped one copper-tape over another, this connection would induce very high resistance. The solution is, either to simple use only one continous string of copper or bridge/short circuit the connection with a wire soldered onto the both tapes.

The Theory

But how do we measure the resistance? Arduino doesn’t have a function for it. Or does it? Well, not really, but thanks to Ohm’s law we can measure the resistance. We use the “Voltage Divider Rule”. Which says that (Voltage part)/(Voltage overall) = (Resistance under Voltage decrease)/(Resistance overall). Or in other words, if you know the voltage and one out of two resistors you can calculate the value of the second one.

This is the magic code:

long measurement = analogRead(pin);

voltageR2 = (sourceVoltage / 1023.0) * measurement;

resistance = rs1 * (voltageR2 / (sourceVoltage – voltageR2));

In our setup we used 5V as voltage (source Voltage) and 2700ohm as our known resistor (also called reference resistor or rs1 in the code). The resistor we want to measure (here resistance in code) is hidden inside a player’s glove. The corresponding schematic will have to look like this (left: genearal schematic, right: the version we use in this project):

For the pads we decided that they will be a circle with a little dot inside. Why a circle? Well to ensure that from whatever direction the user touches a field, he can connect the inner and outer copper trace without risking a short circuit, which would mess the measurement up. The gloves just have 2 stripes of copper with the resistor in between. So when a user touches a field. The glove will connect the inner and outer copper trace. Because of the resistor inside the glove, we can then measure this change.
Now you know the theory behind everything. But we all know that reality is always different than reality. So let’s build a game field.

The Building Instructions

You will need: Wires (red, blue, green), pin headers(male/female), copper-tape, stiff blanket (e.g. pvc-oilcloth), Resistors (16×2700, 470, 680, 820, 1000, 1200, 1500, 1800, 2200 ohm), Arduino Mega, breadboard, coloured thick paper, wood (5mm), 8x Velcro-cable-binders, steel wool or sponge with steel threads (e.g. Vileda Glitzi Power)

The Resistance Detection Circuit

Before we begin to build the game-field or the gloves let’s build the resistance measuring circuit

The resistance detection circuit is pretty straight forward. If you have built it for one pad you can repeat this design for as many pads as you want. For our 16 pads It will look something like this.

team2-wiringteam2-resistor_circuit_game field_pads

The Game Field

For the game-field I recommend you to use a blanket which is a bit stiff, but not too stiff, as you still want to be able to fold it up to store it. We used the white backside of a pvc oilcloth in the size 130x160cm.

Next you want position fields/pads stencils on the blanket to check if everything fits to your taste. We used for the pads circles with a diameter of about 17 cm. When you have decided how large the fields will be and know where you want to place them, mark the middle of each location with a small dot. Then cut small holes (3x3cm) inside he blanked. This holes will later be covered by the pads and be used to feed the wires from the pad through it.

team2-blanket-holes team2-blanket-arrangement team2-blanket-test team2-blanket-full team2-blanket-test2 team2-schematic-blanket01

Then it’s time for wiring. Turn the blanket around. We will put all wires on the backside of the game-field. Do this step carefully and give yourself time. Any errors can be frustrating and hard to debug.

Every field will need a connection to ground and a connection to an Analog pin of the Arduino. Field 0 is located top-left (front-side) and top-right (backside) [just use the schematic as a reference]. I recommend you to put traces of copper-tape on blanket the this will make it easier to fold the blanket up. As wires will easily tangle-up when folding. Now you need to solder for each pad two female jumper cables (one ground and one for analog pin). This cables will be used to connect the fields/pads. When done the next step is to make a connection to the resistance-detection-circuit. Solder on each copper trace a wire and attach it to a pin header. When done you can put the header directly in the breadboard. With this method you can also easily create extension cables.

team2-blanket-wiring team2-blanket-copper team2-blanket-pad-connection

Test everything with the Arduino sketches. When everything is correct and working, you can enhance the wire joints with hot glue

The Gloves and pads

With everything wired and cut we can now start to build the gloves and pads.

Cut 16 circles in different colours (red, green, blue and yellow, 17cm diameter) and put 2 rings of copper-tape on it. Between the rings there must be a gap of 3cm. Make a small cut and feed the end of the tape trough the cut onto the backside. Solder on each tape-end a male jumper-cable. When done attach the pad to the blanket.

The only thing left to do are the gloves. Cut some wood according to the provided stencils. The smaller pads are for the hand. The other ones for the feet. Smooth the edges or tape them, so the copper-tape won’t tear. Wrap 2 lines of copper tape with an gap of 2,5cm around. Then solder a resistor on the top-side. To make it more sturdy, cover it in hot glue. Then attach a Velcro-cable-binder to it. Now you can wear your first glove :). For better connection results we found, that a sponge with steel threads woven into it, will improve the connection results, as less pressure and accuracy is needed. When using such a sponge, test the connectivity and resistance with a multimeter. We found that a similar sponge consisting of aluminium coated plastic did not conduct electricity very well. So to be save and test it.

team2-pad3 team2-glove-full team2-glove-resistor2 team2-glove-sponge team2-pad1 team2-pad2

That’s it. Thank you for reading and I hope this instruction was useful for you. If you have any questions, feel free to leave a comment.

I have included some Arduino sketches for you to test your game field. You can access them on github.

linked categories 2016a, Projects


Write a comment