Disclaimer and Social

This page may contain affiliate links. As an Amazon Associate I earn from qualifying purchases.

Showing posts with label motor. Show all posts
Showing posts with label motor. Show all posts

Monday, August 17, 2020

DIY Two-Needle Dial with Arduino

Just learned about a great device called a "Biaxial Stepper Motor." It's a pair of stepper motors driving two separate shafts that are nested concentrically inside of each other. This allows you to mount two indicator needles, one on each shaft, and operate them independently.

It functions something like the shafts that move the hands of a clock, but with one very important difference. 

two hand dial gauge for arduino with dual independent needle working with biaxial stepper for sim games
You can easily make a dial or gauge for your flight sim or other game. These biaxial stepper motors move each needle arm independently. Each hand can rotate at different speeds or directions. Easy to control with any Arduino or Raspberry Pi.


In a clock, all the shafts are linked by gears and they rotate with a set ratio (for example: the hour hand moves 1/12th of a rotation for every full rotation of the minute hand). Wikipedia calls the gearing mechanism a "wheel train" (note the illustration) with the "hand shafts" being the part attached to and  moving the hands.

By contrast, the two shafts of a biaxial stepper operate completely independently, so you can

Tuesday, September 18, 2018

LEGO Mindstorms Motors with Arduino

Found a bunch of my old LEGO Mindstorms robotics stuff and realized that I could still use all the old motors and most of the sensors. The old versions of the motors (RCX 1 & 2) are just 9v DC motors so I can easily control them with an Arduino.

These old motors are super sturdy, reasonably powerful and the gearing makes them great for any hobby level robotics project. And of course, they fit into the entire LEGO ecosystem so they are easy to prototype with.

LEGO Mindstorms RCX motors can be used with an Arduino with Adafruit motor shield
Just a few leftover LEGO Mindstorms Technic motors. And I've got lots more Mindstorms and Technic parts, plus quite a few Bionicle sets. 

I stopped using the RCXs when the software and drivers stopped working on modern systems. I thought about buying the NXT or EV3 versions, but by that time I was already into Arduino or Raspberry Pi and couldn't justify buying another brain and motor/sensor package.

So the motors and other items languished in storage for years. But I wanted to find one of my robot chassis (still assembled after all these years) to use with some beginning roboticists. I was going to 3d print some adaptors for the cheap DC motors. But when I saw the old motors I realized I could just cut the LEGO connector wires and plug them directly into a motor driver.

Normally, I would just upgrade to newer equipment, but I have a dozen of these motors and several robot chassis and mechanical contraptions that are already designed ( and more importantly, already assembled) to work with this style of motor. Since the motors are designed to run on 9v (I remember running them at up to 12v without damage) so I knew they would work well with several of the Arduino motor drivers I already have. I decided to put these handy little motors back to work.

I chose to use Adafruit's Motor Shield. It can handle 9-12v easily and has handy screw terminals for attaching wires. And the well-written library makes it easy for new roboteers to program their creations. It gives you four DC motor outputs (or two stepper motors) as well as two servo ports. And it leaves the analog and digital inputs to use with sensors.



Put the shield on top of a UNO and they are about the same size as the old RCX, so they fit perfectly onto the existing robot chassis. Or use one of the new M4 powered UNO compatibles and have enough power and speed to run a full color touch screen display, Bluetooth, GPS and a 10 DOF sensor board. You could even get one of the smaller boards like a Feather or Teensy.

Compare LEGO Mindstorms RCX brick with the size of an Arduino and Motor Shield combo
The Arduino and Motor Shield are slightly smaller than the original RCX brick, so they can be substituted into any design that uses the old RCXs. And the motor shield gives you an extra motor port and the option to run the motors at higher voltages for that extra boot of power.

Hooking up the motors is simple. Just use one of the Mindstorms motor cable and cut the wire that runs between the two LEGO connectors. You will get two cables, one end with a LEFO connector and one with just wire. Strip a small amount of insulation off the wire. Attach the connector to the motor, then screw down the wires into any of the four ports on the motor shield. Use the LEGO motors like any other DC motor.

Just snip the wire between the connector blocks and attach them to the screw-terminals of the motor shield.

You could get fancy and tin the wire with solder, crimp a pin to the wire, or splice it into a breadboard style wire.

Now build a robot and code the Arduino using the library for the motor shield.

LEGO Mindstorms RCX motors running on an Arduino with Adafruit motor shield
You can run the old LEGO Mindstorms RCX motors using an Arduino and Adafruit's Motor Shield kit. The motors are simple 9v DC motors that are geared to be powerful and sturdy. Plus they fit into the LEGO and Technic universe, so you can build almost anything you can imagine.
For information about connecting to later LEGO Mindstorms kits check out:


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

Wednesday, September 5, 2018

Creepy Baby Head with Remote Contol

Dolls are creepy in general, and disembodied heads with fluttering long-lashed eyes give me nightmares. So what could be better to create a Halloween prop? Add some cheap remote control units and wait for the trick-or-treaters to arrive.

I was looking for hackable electronic toys at the local thrift store. The dolls were nearby. I couldn't avoid them. There were hundreds of them, strange limbless torsos and disheveled Barbies lying in twisted entangled piles.

One bald head --- just the head --- sat alone on the top shelf.

As I walked past it the doll's eyes fluttered, then suddenly snapped open in an unfocused stare. I freaked out... until I realized the vibrations from the nearby pillaging children were causing the eyes to operate. I was relieved and decided I had to have it. For 50 cents, how could I resist?

It turns out that the eyelids are on a pivot. A metal weight holds them shut or opens them depending on the head's orientation. However, the weights are so delicately balanced that any small vibration (or magnetic field) can cause them to flutter, or even snap open unexpectedly.

I needed to learn to control this frightening phenomenon. If I can control it, I take away its power over me. (And can frighten other people instead). A cheap RF remote-control, some motors and LEDs gave me some ideas.

Creepy remote control glowing doll head
Schematic circuit diagram for making a creepy Halloween doll head prop with cheap RF remote controls. The LEDs cause the skull to glow. The small vibrator causes the eyes to flutter. The big motor was intended to make the head spin on a spiked pedestal, but I might replace it with an electromagnet to pull on the metal weights and make the eyes snap open suddenly.


I have posted about how easy these cheap RC units are to work with, but didn't include any real examples. So I worked up a quick breadboard example in Fritzing last night. I haven't hooked it up yet, so there are probably errors in the circuits (I just did the diagram to help me think about how to do the project). But it gives you a good idea of the kinds of things you can do with a $10 radio remote control.

The items used in the schematic are available from Amazon.



The doll-head's pale, unnaturally pink skin is partially translucent, so an LED causes the skill to glow eerily from within. I'm using red and green LEDs for a nicely diffused sick glow. I pull the power directly off the RC receiver's pins with a current-limiting resistor placed inline.

The small vibrator also pulls power from a receiver pin. I used an NPN transistor and protective diode to form a basic motor driver circuit. It causes the eyes to flutter (but not open) and is startling because, well, doll heads don't typically buzz and vibrate. (Or maybe they do, how would I know)

The big motor needed a driver board and extra batteries. I was originally going to put the head on a pedestal and have it spin. (Fun, fun, fun) But after working on a gearing system and stand, I started to think of other options.

Right now, I'm thinking about using an electromagnet to pull on the metal weights of the eyes. They should snap open quickly to great emotional effect. And the small ones only need about 5v, so the extra batteries and driver-board might not be needed.

I'll work on this and put an example out for some of my friends to experience. I'll let you know what happens.


As an Amazon Associate I earn from qualifying purchases.

Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE

Sunday, September 2, 2018

Simple RF Remote Control for Motor and Lights

Control a motor or lights just by clicking a button --- no microcontroller needed, no Arduino or programming required.

Sometimes you just want to keep things simple. Not everyone wants to learn how to code and configure an Arduino. With these handy little boards you simply press a button on the remote and the receiver module turns on an output to power your light or motor.

I have already found them useful for several types of DIY projects and am dreaming up more:

COSTUMES: Placing and wiring switches into your costume can be a real pain. With these you can turn on lights, trigger the smoke effects and start the radar dish turning with the click of a button.

GAG PROPS: Make a chair vibrate, cause the creepy doll head to rotate and eyes light up, or make the fake rat run around the table.

SUPER SOLAR YARD LIGHTS: Make a simple security or decorative lighting system that only operates when you want them to. No more coming home to solar lights that have run out of power when you really need them.

I even did a Creepy Remote Control Doll Head for Halloween... it glows and vibrates and its eyes snap open... all at the click of a button.

Adafruit 433 RF remote control transmitter receiver for DIY motor light prop costume gag
Adafruit's four-button RF transmitter (key-fob) and one of their four-output-line receivers. For about $10 for the pair you can control up to four different outputs with the press of a button. The receiver puts out about 5v on each of the outputs. With a few more components, you can easily control LEDs or even motors. Add an Arduino and you have an easy RF remote control for all kinds of projects.


If you know how to install a button and an LED or motor, you can get started for under $5. For a few dollars more you can get a four-output versions with a preassembled remote transmitter. For a few more you can get one to control 12-24 volt circuits or even 110/220 AC.

You can get 10x pairs of single-output receivers for $12. These are just the raw boards. You will need to put a trigger (like a button) on the transmitter and wire a light or motor to the output of the receiver. But for about a buck each, that's a cheap way to start.

For a little more money, you can get four-output versions with premade key-fob style transmitters. That way you can control multiple lights and motors from a single remote.

While these tiny RF modules are cheap and easy to use, they do have significant limitations.

Most of the cheaper versions are "non discriminating" transmitter/receiver pairs. You cannot assign a specific transmitter to a specific receiver. So you can simultaneously operate 10 receivers with a single remote. But if two people have a transmitter, both people can operate all the receivers.

They send simple on/off signals to the transmitter to toggle the output lines. You can control one or all of those four outputs. You can wire the outputs up to an Arduino and have it take other actions based on the state of the output. However, you cannot send complex data like serial text commands with them. You will need a more expensive RF transmitter receiver to do that.

Some only work from a few feet away, others have a decent range (several yards) under ideal circumstances, all certainly good enough for costumes, props and gags. But you won't be turning on your porchlight from a mile away like with the expensive models. I found that fiddling with the coiled antenna can give me a little extra range (or limit it to a few inches).

The receivers may have different ways of responding to the transmitter signals. Some only turn on while the button is pressed, then turn off once the button is released. Others turn on with the first press, then remain on until the same button is pressed. Others cycle through, they turn on a channel when the button is pressed while also turning off all the other channels.

My recommendation?
Adafruit has a good selection of key-fob style transmitters (1,2 or 4 button) and receivers (momentary, latching and toggling).

While Adafruit's versions are more expensive than knockoffs, they might be worth it to you. You know exactly how the transmitters and receivers work together, all the transmitters work with all the receivers, and as usual with Adafruit, you get excellent tutorials on how to wire, install and operate the equipment.

Plus, you can order some LEDs, motors and driver boards all from the same place. They even have a sound effects board that can be controlled with these remotes.

Both the cheap versions and the Adafruit boards are also available from Amazon


If you know how to read digital inputs on an Arduino, then your options expand exponentially. You can control the speed and direction of motors, change the color of LEDs and even control NeoPixel animations. With some MOSFETs, a driver boards or some relays you can control valves, pumps, fans, solenoids and servos ---- basically anything you normally control with your Arduino.

But this post is about keeping it simple and using only basic hardware and the simplest of electrical circuits. So pick up one these RF units and start building your own props and costumes.


Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE

Wednesday, May 30, 2018

Got the LRA Vibration Motor Partially Working

SUCCESS !!! - well sort of. I can now make an LRA vibrator click and pop and hum - very weakly, but it's definitely progress.

Recently, I posted about finding (I thought) a mythical LRA vibration motor. After spending the last few hours combing through the 62 page spec-sheet for the DRV2605L Haptic Motor Driver Chip from Texas Instruments, I'm almost certain it really is an LRA vibrator.

I'm using the Adafruit Haptic Motor controller board for the chip, so I'm also using Adafruit's library. Sparkfun also sells the same type of board along with a library. Both manufacturers have an excellent, easy-to-use implementation for driving standard ERM vibrators (lots of fun). And both have a function for sending audio signals, like music or voice, to an LRA. However, neither has a good example for the command set for LRAs.

LRA vibrator with Adafruit DRV2605l Haptic motor controller on arduino uno
Hooking up the LRA (or an ERM) vibration motor is easy thanks to Adafruit's DRV2605L Haptic motor controller board. Even a classic Arduino is capable of handling it because all the calculations are handled by the chip. Just send a code over the I2C line and the waveform is executed. Tuning an LRA, now that's a lot more complicated.


Now I understand why, and it's not the fault of Adafruit or Sparkfun - the LRAs themselves are picky and tricky and each one is unique. The driver chip needs a lot of info about the physical operation of the LRA. There are lots of register bits to set and obscure mathematical formulas to deal with before the LRA resonates properly.

Although both libraries give you easy access to these register values, it doesn't do me much good because I don't have enough info about this specific LRA so I don't know what values that motor needs in those slots. Properly tuning the resonance for these motors seems more like a job for a skilled luthier, not an electronics hobbyist.





Nevertheless, I bravely went into the core CPP and H files (a scary thing for me) and set the hex values for some registry slots (according to page 15 of the manual). And what do you know - it works. The LRA moves and every one of the waveforms is distinct. Short or sharp or ramped or rumbling, they are all very distinct. But I have to have my finger touching the vibrator to feel them. When the vibe was still in a phone it would rattle my knee caps. So I'm still doing something wrong.

Compare this to using an ERM. The simple ERM just slings an off-balance weight around a shaft. It's easy to configure and the pulse is powerful. But the waveforms feel almost the same. Out of about 100 different waveforms, I can sense maybe five different feelings. The rotating mass just doesn't stop or start quickly enough, so the difference between a short pulse and a long one is negligible. A double or triple pulse feels like single pulse because the mass is still moving when the next pulse hits.

There may be ways to brake the ERM quicker, I'll explore more and report back. I know when I was making a haptic gaming chair I would hit the rumble-motors with a quick reverse or braking command to create a much sharper and stronger sensation. There could be commands for ERMs in these libraries that I just don't know about yet.

If I can find a well documented LRA cheaply enough I might get one or two. Until then I'll play with this scavenged one and randomly change values. I'm not the only one struggling with this issue of LRAs, so there are some good forum posts about it. But this whole process reminds me of the bad old days when electronics were obscure and difficult and confusing.

On a positive note, if the corporate "they" see enough of us playing with this (spending money) one of them will make us a nicely documented, simple to use LRA so we'll all buy them. Just sayin...

Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE

Friday, April 13, 2018

Mythical Vibrator Found?

I might have found one of the legendary LRA vibration motors. I can't be sure yet, but all the signs are there. It looks like a standard ERM, but it acts more like a piezo and its magnet is incredibly powerful. (Check out the update - it is and it kind of works)


Is this an LRA linear resonant actuator virator motor in an old cell phone.
So is this an LRA vibration motor? It looks like a standard ERM pancake motor. But it's got a really strong magnet and operates like a piezo. I'm going to hook it up to my haptic driver controller and test it out.


What's the big deal? Well the LRA (Linear Resonant Actuator) is rumored to have a better feel for haptic feedback devices. When your phone vibrates, or the screen clicks or taps or buzzes when you touch it - that's an LRA.

An LRA acts like a speaker. When current is applied, a weight moves back and forth in a linear motion. Like a speaker, this allows you to create complex waveforms that can be felt kind of like you hear waveforms in music.

Compared to a regular ERM (Eccentric Rotating Mass) vibrator, LRAs provide a wider range of sensations. That's why they're used for tactile feedback in all your phones.





You can find standard  ERMs everywhere, from the tiny disk shaped motors in a bristlebot, to the huge versions in your back massager. They are cheap, readily available and easy to work with. But they have a very limited vocabulary. All you can really do is adjust the speed and duration. Even with modern controllers, you can't use ERMs for sophisticated feedback tasks.

By contrast, LRAs are difficult to source and many use connector sizes I'm not comfortable working with. You also need to be either a serious programmer or buy a specialty controller board to use them. I do own one of those controller boards, a haptic feedback driver, so I can test my newly found vibe as soon as I figure out how to tweak the registers. Luckily, this motor is also large enough and uses connectors that I can see without a magnifying glass.

If I get it working without blowing anything up, I will certainly post my experiences here.


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on: