A peripheral for use with the Kookaberry
This DF Robot micro servo weighs only 9 grams and provides 1.6kg.cm of torque. It can rotate approximately 180 degrees (90 degrees in either direction).
Although designed for a supply voltage of 5v, it operates perfectly well off the 3.3V Kookaberry supply; but at reduced torque and current. Connecting this servo directly to the Kookaberry when running the Analogue app is therefore Ok for servo demonstration purposes. It should be run from a separate 5v supply using a when being used in projects
SPECIFICATION
- No load speed: 0.12 seconds / 60 degrees (4.8V)
- Stall Torque: 1.6 kg / cm (4.8V)
- Operating temperature: -30 ~ +60 degrees Celsius
- Dead Set: 7 microseconds
- Operating voltage: 4.8V-6V
- Working current: less than 500mA
- Cable length: 180mm (7 inches)
- Size: 22mmx12.5mmx29.5mm (0.9×0.5×1.2 in)
- Weight: 9 grams
Selecting a Servo Motor
[The explanations below are taken from components101 and Osoyoo® Micro bit lesson — Using a Servo Motor]
There are lots of servo motors available in the market and each one has its own speciality and applications. The following two paragraphs will help you identify the right type of servo motor for your project/system.
Most of the hobby Servo motors operates from 4.8V to 6.5V, the higher the voltage higher the torque we can achieve, but most commonly they are operated at +5V. Almost all hobby servo motors can rotate only from 0° to 180° due to their gear arrangement so make sure you project can live with the half circle if no, you can prefer for a 0° to 360° motor or modify the motor to make a full circle. The gears in the motors are easily subjected to wear and tear, so if your application requires stronger and long running motors you can go with metal gears or just stick with normal plastic gear.
Next comes the most important parameter, which is the torque at which the motor operates. Again there are many choices here but commonly available ones have 2.5kg/cm of torque. [The servo used for this Kookaberry peripheral has a torque of 1.6kg at 5v but the principle explained below is the same.]
This 2.5kg/cm torque means that the motor can pull a weight of 2.5kg when it is suspended at a distance of 1cm. So if you suspend the load at 0.5cm then the motor can pull a load of 5kg similarly if you suspend the load at 2cm then can pull only 1.25. Based on the load which you use in the project you can select the motor with proper torque. The below picture illustrates this principle.
How it works
After selecting the right Servo motor for the project, comes the question how to use it. Unlike the action of most motors that continuously rotate, a servo motor can rotate to and hold a specific angle until it is told to rotate to a different angle
There are three wires coming out of this motor as shown in the picture at the beginning of this description. To make this motor rotate, we have to power the motor with +5V [3.3v when connected directly to the Kookaberry] using the Red and Brown wire. The angle of the servo is controlled by sending it a PWM (Pulse Width Modulation) pulse train along the Orange coloured wire. The PWM signal is mapped to a specific angle from 0 to 180 degrees.
PWM operates by turning the digital output ON and OFF very quickly to simulate an analogue voltage. This varies the duty cycle of the pin (how much time it is spent in the ‘ON’ state) If it spends an equal amount of time in the two states, the voltage looks like 50% of the available voltage, and the angle is zero
Inside of the servo there is a gearbox connected to a motor that drives the shaft. There is also a potentiometer that gives feedback on the rotational position of the servo, which is then compared to the incoming PWM signal. The servo adjusts accordingly to match the two signals.