Servo

Servo

A servo
A servo

What you need to move a little Detour flag: a servo. It's a small motor-like device with a shaft.

Often there's a horn or arm on the shaft: something like this: 

Girl in a jacket

This kind of servo is not to be confused with Tom Servo, of MST3K fame, or maybe it is, a little. 

Tom Servo

The first time I tried to send a servo a signal, I was sitting at a long table in Cambridge Hackspace. 

A big guy working across from me raised his head. He sniffed loudly, dramatically.

"Smells like failure," he said. "Something's burning."

I looked down. It was my servo.

But that's getting ahead of the story.

A servo, as I mentioned earlier, can be positioned by sending it a coded signal (I like the sound of that: a "coded signal." Much better than just "code.")

Change the coded signal, and the angular position of the shaft changes.

Servos are common in robots, in radio-controlled cars, in animatronic puppets, and in a whole mess of other mechanical devices.

A servo is a simple machine: it consists, basically, of a DC motor, a gear train, a potentiometer, an integrated circuit, and an output shaft.

Of the three wires that stick out from the motor casing, one is for power, one is for ground, and one is a control input line.

Here's how my servo arrived.

As my smoking servo demonstrated, controlling a servo is not easy. It's difficult to figure out what exact code will cause the servo to rotate the exact amount you want it to. Part of the problem: the documentation can be sketchy. Much of it reads like it's been translated from the Chinese, because it has.

Before my project started smoking I was trying to figure out the "coded signals" to send to the servo. There were a few servo projects online, but it wasn't easy to cobble them together -- at least without a solid understanding of embedded hardware code. 

So after we opened a few Hackspace windows to clear the burning machine smell, I tried to improvise: adjusting the code, connecting the servo, and looking for wisps of smoke.

I did not have much success. Apparently the demo code I was using was telling the servo to go further than it could. So the motor was struggling against the limit, and heating up.

I took some blind stabs at making minor changes to the code. As I did, I kept one hand on the servo, so I could feel it starting to warm up.

This allowed me to disconnect it before the smoke started.

It was tough to act before the telltale burning-machine smell started spreading. Opening a window helped mask my bumbling a little bit.

Eventually over the next few days, I took my quandary to Particle's Community site, which turns out to be one of the liveliest in the Maker world. Soon a Canadian engineer, Gustavo, jumped in with some solid advice.

The air started to clear, literally and figuratively.

Custom, Bespoke Project #1

Next - Servo Code