Around the Crate (Ludo)

by kayleeDW in Circuits > Arduino

48 Views, 0 Favorites, 0 Comments

Around the Crate (Ludo)

WhatsApp Image 2023-05-17 at 17.32.46.jpeg

Around the crate is a variation of ludo with some extra rules to spice things op. The goal is to get all your playing pawns in the bin on the left by walking once around the crate.


How the game is played: 2-3 players

The crate is a animal transportation crate filled with animals from a zoo that need to be transfert. You, the player, are the transportation crew that need to keep the animals at bay. While moving around the crate the animals can become annoyed. Two gears will spin in different speeds while a player is standing on a "dangerous" spot. They will keep spinning til the player moves again. (To make sure the player has no controle over when the gears stop spinning, there is a built-in timed system that randomly decides how long the gears continue when the player is removed from the dangerous spot.) When the gears stop, they will reveal a color combination.

Gear 1 (Larger gear),

  • Red
  • Green
  • Blue
  • Yellow

Gear 2 (smaler gear),

  • Black RIP
  • Blue

These color combinations mean different things. The large gear translates to which player is affected, with one exception, green. There are no green players on the board and green is the only color that effects the player who is in play with something positive. If the gears land on green and RIP on the smal gear, the player may switch a pawn of an opponent for their own. If the combination was green and blue on the smal gear, the player may kick an opponent of the board with a flick of their finger. If this succeeds the pawn leaves the board.

When the large gear stops at one of the colors, Red, Blue or Yellow, that player will be affected. In combination with the RIP in the small year that player will lose a pawn. In combination with the blue side of the smal gear the turn will end. Blue in combination with a color of a player means nothing. The player is only affected by the RIP.

All players start with one pawn that they place with one dice roll. After that, the game goes on in clockwise direction. When a player loses a pawn, they need to roll the dice with a score of 3 or higher to get a new pawn on the board. When a player succeeds in going one round around the crate, the pawn is stored in the bin on the left of the board. (The player gets a new pawn immediately.)

Last important rules:

  • When a player starts their turn, they need to move their pawn right away. (Roll the dice and imminently move the pawn.) If this takes more than 10 seconds to complete the player must skip this turn and stays in the same position on the board.

Supplies

Supplies for the project:

  • Arduino UNO, with cable
  • A pack of 50 popsicle sticks
  • Tooth sticks
  • A box that is around 15 by 15 cm
  • A pack of differently sized gears

https://www.bol.com/nl/nl/p/reely-kunststof-recht-tandwiel-soort-module-0-5-aantal-tanden-20-30-40-50-60-1-stuk/9300000094261153/?s2a=

  • Battery supply with an output of 6,5 Volts

https://www.bol.com/nl/nl/p/batterijhouder-4xaa-6-volt-output-batterijclip-batterij-case-aa-battery-holder-battery-case-battery-adapter/9300000099017871/?s2a=

  • A set of playing Pawns with D6 dice

https://www.bol.com/nl/nl/p/pionnen-set-4x4-kleuren-2-dobbelstenen/9200000085126314/?s2a=

  • 20 Low magnetic magnets, 1cm diagonal
  • breadboard
  • 12 Higher magnetic magnets, 1cm diagonal
  • 4 Hall sensors
  • 1 9Volts Battery Button Plug For Arduino
  • 4 AA battery
  • 1 9 Volts battery
  • 1 Servo 360 Degree Continuous Rotation Servo MG995 Metal Gear
  • 1 role of non conductive tape
  • Soldering iron with tin
  • At least A14 jumper cables Male to Male
  • A universal PCB plate
  • glue
  • pen/pencil
  • Stanley knife

Upload the Code on Your Arduino

WhatsApp Image 2023-05-17 at 18.09.51 (1).jpeg
WhatsApp Image 2023-05-17 at 18.09.54.jpeg
WhatsApp Image 2023-05-17 at 18.09.50.jpeg
WhatsApp Image 2023-05-17 at 18.09.53 (1).jpeg

To make sure everything works before you start assembling the project is extremely important. Do as follows:

  • Upload the code listed below on your Arduino.
  • Connect the 4 hall sensors. Middel pin of all of them need to be connected to the 5V pin, The pin with the L on the hall sensor need to be connected to pin 3,4,5,6 of the Arduino, and the - pins on the hall sensors need to be all connected to a ground (gnd) pin on the Arduino. (You can test with a led, but the hall sensors all have lights themselves so it's not necessary.)
  • Connect the 360-degree servo motor. The servo motor can kill your Arduino!! if you power it with the 5V pin of the Arduino. Thats why you need a separate power supply for it. Connect the red wire of the servo with the power of an external battery. Connect the black/brown wire with the minus of that same power supply. You also need to connect the minus of the external power supply to the ground of the Arduino. Connect the White wire with pin 10 on the Arduino.
  • Place everything together and power the Arduino with the 9Volts Battery Button Plug cord and battery.
  • You can now test if when a Hall sensor detects a magnet (red light goes on) the servo starts rotating.

The code that needs to be uploaded on the Arduino:


#include <Servo.h>

Servo WoodBox; 


int HallEffectPositieNoord = 3;

int HallEffectPositieOost = 4;

int HallEffectPositieZuid = 5;

int HallEffectPositieWest = 6;

int halleffectValueN;

int halleffectValueO;

int halleffectValueZ;

int halleffectValueW;

int Speed = 1550;

int RTime;


void setup() {

Serial.begin(9600);

pinMode(HallEffectPositieNoord, INPUT);

pinMode(HallEffectPositieOost, INPUT);

pinMode(HallEffectPositieZuid, INPUT);

pinMode(HallEffectPositieWest, INPUT);

WoodBox.writeMicroseconds(1500);

WoodBox.attach(10);

}


void loop() {

halleffectValueN = digitalRead(HallEffectPositieNoord);

halleffectValueO = digitalRead(HallEffectPositieOost);

halleffectValueZ = digitalRead(HallEffectPositieZuid);

halleffectValueW = digitalRead(HallEffectPositieWest);


if((halleffectValueN == 0)||(halleffectValueO == 0)||(halleffectValueZ == 0)||(halleffectValueW == 0))

 {

  RTime = rand() % 5000 + 2; //delay tijd random tussen 2 en 5000

  WoodBox.writeMicroseconds(Speed);

  delay(RTime); // min 2 geeft de tijd om servo aan te sturen, Random getal zorgt dat spelers geen invloed hebben op draaing

  Serial.println(RTime);

  //WoodBox.writeMicroseconds(1500);

 }

WoodBox.writeMicroseconds(1500);

}

Place in the Housing

WhatsApp Image 2023-05-17 at 18.09.52 (1).jpeg

Now everything works you need to connect it to the housing. Start with the Servo motor.

  • Place the motor on the bottom side of the lid of your chosen box.
  • Trace with a pen or pencil the outline on the lid.
  • Cut out the shape and push the servo through the lid. (The servo has some extending points on the side. Don't force them through the lid but keep them on the bottom. If the servo sits to loos and falls out the bottom you can glue it on these extended points.)

Make the Gear System.

WhatsApp Image 2023-05-17 at 17.32.54 (3).jpeg
WhatsApp Image 2023-05-17 at 17.32.55 (3).jpeg
WhatsApp Image 2023-05-17 at 17.32.56 (1).jpeg
WhatsApp Image 2023-05-17 at 17.32.56.jpeg

I used one servo to turn two gears, you can use two separate motors, but the construction will become verry bulky. The thing is that the gears need to sit exactly in the right position and need to stay that way. They will often move diagonal and come loose. To prevent that I made a little construction to hold them down. By taping some popsicle sticks gently to the lid i managed to keep te gears from moving.

Here are the steps:

  • Glue a gear on top of the servo motor.
  • 2 X Get two toothpicks and pres them in the lid. The picks need to be in the exact position where your chosen gear connects to the gear on the servo motor. Do this by holding the toothpick with the gear to the gear on the servo and map where the toothpick needs to be placed. (Do this twice but with divergently seized gears. Otherwise, the gears will move the same speed what means that multiple color combinations shall not be possible.) To make sure the gear wont. move down the toothpick thicken the toothpick where the gear supports itself. The gear needs to be able to move freely.
  • When this works you can personalize the colors on the gears. Take a piece of paper and color it the colors blue, red, green, and yellow for the large gear and Black and blue for the smal gear. Don't forget to write RIP on the black half of the smal gear.

Making the Crate

WhatsApp Image 2023-05-17 at 17.32.54.jpeg
WhatsApp Image 2023-05-17 at 17.32.54 (1).jpeg
WhatsApp Image 2023-05-17 at 17.32.55 (1).jpeg
WhatsApp Image 2023-05-17 at 17.32.55.jpeg

Start by making the holes fot the Hall sensor. This can be tricky later in the proces. I have a suspicion that some hall sensors detect magnetic fields better than others and this can be a struggle. The thing is that the player pawns are magnetic and snap onto the beard, the pawns are what need to be detected by the hall sensor but there also are magnets in the board to map the placement of the pawns. Thats why you need twenty lower magnetic magnets. These are for the placement mapping. The Hall sensors need to be far enough under the board to not be affected by them, but when there is a pawn on that place, they need to detect that.

  • First start with cutting four holes in the lis where you want the hall sensors to go.
  • Tape the Hall sensors facing up through the lid.

Now make the crate:

  • Gat the popsicle sticks and cut them the richt since where the servo motor can be covered. Make it a little box and leave two holes open where you can read the colors on the gears.
  • When all these electronics are coverd you know how much space you have for pawn places.
  • Also cover this with popsicle sticks so you can't see the original lid of your box.
  • Turn on your Arduino and get a magnet that needs to be placed under a playing pawn. Search for the exact placement where the hall sensor the magnet can detect and draw a cros so you know where it is.
  • Get the lower magnetic magnet and glue it on that exact place. (Make sure the magnet isn't upside down that the playing pawn doesn't want to be placed on that space.)
  • Check if the hall sensor can detect the lower magnetic magnet. If that's so, relocate the sensor so it doesnt detect in anymore but when there is a higher magnetic magnet it will.
  • Do this with all four Hall sensors.
  • Place the remaining lower magnetic magnets on the beard where the players will continue their round around the crate.
  • Glue the higher magnetic magnets on the bottom of each play pawn. (Make sure they aren't upside down!)

If you finished this step, you have a playing board where four places on the board will move the gears.

Bin and Decorate.

WhatsApp Image 2023-05-17 at 18.09.52.jpeg
WhatsApp Image 2023-05-17 at 18.09.50 (1).jpeg
WhatsApp Image 2023-05-17 at 17.32.46.jpeg

The last step is decorating and making the bin where you keep your playing pawns when you finished a round around the crate.

  • Cur a square hole in the side of your box but leave the top intact. Flip it up.
  • Place popsicle sticks vertically onto the side like in the picture. (For stability I recommend first gluing the popsicle sticks together before gluing the hole side onto the box.)
  • Make three boxes to store the playing pawns by separating them with a barrier.
  • Store the electronics in the box and close the lid.
  • Decorate the sides of the box to your liking.

Have fun playing :)