E7277604 6c23 47bf ac65 f58458506baf


Magical Marble Sorting Machine Revisited

by alexpikkert

Published on December 1, 2016

This project is an updated version of the original magical marble sorting machine, published in april 2015.(See http://littlebits.cc/projects/the-magical-marble-sorting-machine

It uses a real color sensor (Adafruit TCS34725) instead of sorting marbles based on their weight.

the new version now sorts four different colors instead of three and it also counts the number of marbles per color, using the Number+ bit.

I used a lot of information from the "color sensor How To guide" on the forum from JackANDJude. Thanks!

See http://discuss.littlebits.cc/t/color-sensor-how-to-guide/22898


Duration: > 24 Hrs.

How To Make It

STEP 1 : the box

6e8ea7de 782f 48db 8d2a fa820b3d2ae9

I made a wooden box with a removable top cover and an open front. on the top cover I glued white cardboard. (I reused the box from the original magical marble sorting machine). Dimensions WxDxH 310x190x80 mm.

STEP 2 : the marble selector

58147673 82f5 455d a6f0 efa33a04f696

B3c77596 e74c 4c40 b9c3 5f41541cac22

I made a cardboard selector to send the marbles into their storage lane. Dimensions WxDxH 74x33x20 mm with a sloped surface inside. The selector is glued on the circular servo accessory. I made it as small as possible, adding too much weight on the servo made it jitter a lot...

STEP 3 : the kick mechanism

F8bbd31b 93de 4f95 9b15 cace992e657f

I made a wooden & cardboard cyllindrical device, glued to the circular servo accessory. When the servo is activated, it catches a marble and kicks it into the cardboard selector from step 2.

STEP 4 : the color sensor ramp

F201b008 f8a3 4d0e bb7a f7c043a060dc

458beadb 7c54 4bed 81e0 cc4969dc192c

I made a wooden ramp with the TCS34725 color sensor inside. The marble, catched inside the kick mechanism lands on top of the sensor so ot can measure the color. It has a small piece of clear plastic on its surface to avoid blocking the marble on the hole where the sensor is located. The color sensor is connected with the SDA,SCL, GND and VCC connections on the front of the Arduino.

STEP 5 : the storage lanes for the sorted marbles

34c5ff83 eb9f 4706 9f65 7069847dec76

Made from white cardboard, each lane just wide enough for the 25 mm marbles. Mounted with a slope so the marbles slide into the lanes.

STEP 6 : the marble warehouse

7bfc24fc 1249 4116 bd21 d291e6693cb4

8de2211b f5ab 47ba b87a c5a48c1b62c2

For the warehouse (where the unsorted marbles are stored) I used a cylindrical cardboard container from MyMuesly and added a cardboard spiral to its outer surface with a small fence to keep the marbles in place.The spiral is glued on a number of litle wooden cubes.

STEP 7 : the marble pointer and counter

4875b8b3 1ab9 4e32 8043 863c75d5f607

435735f4 c6c5 43e7 837d a0af524fd688

Berhind a white cardboard background the number+ bit and a servo are mounted. The servo is connected to a hand pointer which makes the same moves as the marble selector. This servo is connected to the circuit via a dimmer to adjust the angle of the hand pointer. The counter remembers the amount of marbles per color and is reset when the final counting procedure is activated via the remote control.

STEP 8 : the Arduino

A0ed8095 d8e9 4a46 bdde ed0576d66fcd

The Arduino bit and the remote trigger sensor are mounted on a vertical mounting plate behind the marble warehouse.

STEP 9 : the mp3 player

E5f6cbeb 7c1d 42a0 b04d cf3d56ad4595

The mp3 bit is loaded with a bell sound and is mounted inside the main box together with the synth speaker on a upside down mounting board.

STEP 10 : reading the colors

Ace0fd6e d772 4bfd b6b2 4f0840f8cc33

The color sensor reads three values of each marble, red, green and blue. Depending on the value of these colors the marble selector is pointed to a certain storage lane. When there is no marble detected, the selector moves to a halt position. I wrote two small programs for the Arduino, the main program detects and sorts and counts the marbles, the second program is only used to detect the three color values from the sensor and show them on screen. This was neccessary because the communication via the arduino screen monitor conflicted with the main program. I nearly bricked my Arduino when I tried to combine this with the main program.

Related Projects

Ugly Sweater Hack

Dress to impress with this super easy wearable pack. The light wire is 4 feet long and can be easily bent, molded, sewn, stapled, ...

Aerial Laser Tag

This is a game that is interactive for kids. You pull the strings with the attached people and light wires. If you hit someone the...


Featuring over 30 individual tracks, this song was composed entirely of sounds created by the littleBits Korg Synth Kit - no exter...