A mini prototype of a conveyer belt that catches the skittle, and moves it to two positions along a platform with the help of a servo motor.
Introduuuucing the Servo motor!
The idea for this: A skittle will drop down, the servo motor will move it half way along the arc, stop and wait for the colour to be sensed. Then it'll continue to the end where the skittle will drop down through the hole 🟣 ⬇ 🕳️.
I got the angle totally wrong for this, I want the servo motor to be flush against the edge, but very happy about this as a proof of concept! 🥳 The lil prototype is made from a tissue box for the flower design, and the thicker cardboard box my multimeter came in.
If you're interested in how a servo motor works behind the scenes:
A servo is a little motor that rotates to a specific angle. I have one that can rotate between 0-180° back and forth, and another that can rotate continuously like an owls head (360°) 🦉
You can program the servo to move to a specific angle really easily, just by writing "servo.write(180);" -> Rotate to 180° position.
Behind the scenes, the arduino (or other microcontroller) sends a pulse of current through to the motor. The length of the pulse determines the position the motor is rotated to ⚡️.
• A pulse that is 0.5ms long moves the servo to neutral (0°).
• A pulse of 1.5ms long moves the servo 90° relative to the neutral position.
• A pulse of 2.5ms long moves the servo 180° relative to the neutral position.
If the servo is positioned at 70° and it receives a pulse of 1.5ms, it will rotate to the 90° position relative to neutral (0°) rather than adding 90° on top of 70° (150°).
This is called a PWM signal (Pulse Width Modulation). In other components, the pulse length can do something else, like increase brightness, this is just how it works for the servo.
We don't have to worry about figuring out the math in terms of milisecond pulse duration because there is a servo library that abstracts that so you can just write the angle number you want.
So for me to correct the angle problem 📐 I need to figure out:
a. What position 0° my servo horn is (the arm that's sticking to my skittle platform).
b. What the start and end angles are for my platform (I need to redraw it with a protractor).
c. Line both up.
My idea is for the skittles to be dumped into a funnel that drops one down at a time, then it falls onto this little prototype arm. Then before it drops down, a little chute uses another servo to move to the correct colour bucket.
Getting closer!!