Smartphones have become our primary interface to the network world, and increasingly, to the real world as well. I call this project GlueMotor, because it works like “glue” for putting gadgets together under smartphone control, providing a very easy way to build simple servo-controlled machines.
To use it for making simple gadgets or prototyping your projects, attach any convenient on-hand materials — PVC pipe, chopsticks, Legos, duct tape — to a GlueMotor, then plug it into your smartphone’s headphone jack. The GlueMotor app lets you control it with a finger swipe.
How It Works
Controlling a hobby servomotor is relatively easy. It requires a single digital pulse-width modulation (PWM) signal at 50Hz, which means one pulse every 20ms. The width of the “high” pulse sets the absolute rotation angle of the servo.
Normally the width of the pulse at center angle is 1.5ms. A longer pulse will set the angle clockwise of center, and a shorter pulse will set it counterclockwise. The maximum and minimum angle will depend on the model of servomotor, but usually a range of 1.5ms ±0.5ms is supported. In a typical R/C car or airplane application, the radio receiver generates the control signal.
But the radio receiver is not strictly necessary. If you can generate the proper PWM signal by whatever means, you can control a servomotor in exactly the same way. The GlueMotor project uses a smartphone to generate the control signal, and outputs it through the headphone jack.
The output from a headphone jack is usually an analog audio signal such as music or voice. If you can create digital sound data that only has “high” and “low” voltage values, then play the data through the headphone jack, you can produce a “nearly” digital signal good enough to control the servo.
To generate this signal, I have developed two applications, one for iOS devices, and another for Android. The user interface is very simple, converting the onscreen coordinates of a touch location to the width of two PWM signals, allowing simultaneous control of two servos. The GlueMotor app is free from the iOS App Store and Google Play.
NOTE: Some devices may not produce enough voltage at maximum volume for this project. To test your device, play a sine wave tone through the headphone jack and measure the output with the AC voltage mode of your multimeter. A reading of 0.6V or higher should work.Related