Analog Gauges using Stepper Motors

I am trying to construct analog gauges to display CPU load, RAM use, and Network bandwidth. I am very much a n00b with all of this but everyone has to start somewhere. Anyway, my research has lead me to the Switec X27.168 stepper to drive the dials as they are cheap and works with Gaugette (http://guy.carpenter.id.au/gaugette/about/) so the behind the scenes code is done. I’ve also decided to have an Arduino Uno run the motors as this seems to be the best all around solution.

Now the confusing part. How do I connect the motors to the Uno? This tutorial (https://learn.adafruit.com/adafruit-arduino-lesson-16-stepper-motors/overview) indicates its more or less a straight connection using a L293D (Data sheet http://www.datasheetcatalog.com/datasheets_pdf/L/2/9/3/L293D.shtml), so total parts would be motor, L293D, and some soldering. However, I cam across this kit (http://hackaday.com/2013/01/19/custom-gauges-with-a-stepper-motor-breakout-board/) which has no L293D but DOES have a number of resisters to prevent electricity back flow into the Uno. There is also the motor shield which uses a L293D but it says it only runs 2 motors (I need 3) and from the looks of it, there is lots of little chips and what not.

I am confused. What do I need to run 3 Switec X27.168 stepper motors from an Uno?

Without a datasheet for the motor it'll be guess work. Datasheet seems to be hard to find.

Presumably a bipolar motor? What coil resistance?

Its bi-polar designed for 5v with very low current needs. Coil resistance seems to be 230-290

I think this is the spec sheet https://s3-us-west-1.amazonaws.com/123d-circuits-datasheets/uploads%2F1392774822254-xatrnqzc91a9vn29-ddcc8d0e4ed81e9c8567ed6aee309e11%2FX27_Flyer_v1.3.pdf

or maybe this?

https://s3-us-west-1.amazonaws.com/123d-circuits-datasheets/uploads%2F1392774822259-5okat92wm8x8byb9-ddcc8d0e4ed81e9c8567ed6aee309e11%2FX27_168_02_MD_E.pdf

For guages you should use a real stepper driver like the RAMPS A4988 or Pololu A4988. They have the microstepping feature which is ideal for a guage. Forget about using the L293D.

Your link to the PDF is a mechanical drawing. You need the electrical specs sheet.

The Switec X27.168 datasheet is hard to come by. I added another link that does have some of the techincal specs.

If its really > 200 ohms and 5V then you can drive direct from Arduino pins, you just need 2 schottky diodes per pin to protect/back up the internal protection diodes.

raschemmel: For guages you should use a real stepper driver like the RAMPS A4988 or Pololu A4988. They have the microstepping feature which is ideal for a guage. Forget about using the L293D.

Good point. 200 steps per turn is kind of coarse for a gauge.

You might also consider air core gauges aka air core meters. They take very little current and the resolution is as high as what you drive them with. You can even build them from scratch.

http://www.mikesflightdeck.com/instruments/diy_aircore_instruments.html

PWM can drive them, or you could use external DAC chips through a buffer driver. They are very low current. In fact, if you balance them really well, I'll bet 20mA would be enough, and you could drive them directly from the Arduino pins. It will take two PWM outputs per gauge.

Its a little jerky but should be more than adequate for the low precision type of gauge I am making (CPU utilization) look at the Switec in action here attps://www.youtube.com/watch?v=AedCPZO8LsM

Its literally the same motor that drives the dials in GM cars and trucks.

So I can run 3 of these directly from the Uno? I just need to add some protection to prevent reverse flow damaging the Uno?

You'll need some kind of Home sensor. One of the problems with a stepper motor is that all motion is relative. You only know how many steps you are away from the initial position, but you must add a way to find that initial position.

An optical interrupter and an arm attached to the shaft would do it.

A nice thing about air core gauges is that they are absolute position.

The board in the Hackaday page has the flyback diodes (they are not resistors, as was mentioned in the first post) and seems to be directly connected to the Arduino. There are mechanical stops mentioned in one of the pages so maybe they drive it beyond the stop to home it (send -210 to a 200 step motor)?

Wow! That is a nice stepper motor for gauges. 1/3 degree per step.

http://www.jukenswisstech.com/JSTFiles/downloads/2011/06/X27_Flyer_v1.3.pdf

At a minimum of 230 ohms per coil and therefore about 22mA, you can drive that directly from an Arduino, but you will need protection diodes.

Yes, it seems many of those steppers just initially send it to the stops and rely on them being very low torque. Nice.

I’m convinced.

Diodes, my apologies. I am new to much of this. So two diodes per motor?

I found this schematic of the breakout board with diodes. stepper breakout

That schematic is drawn poorly, and may confuse. The overlapping wires make them look as if they are meant to be connected that way.

Two diodes per wire, so 8 diodes total. Hang on...

Connect like these diodes. Ignore the ICs, this was just a handy picture to illustrate what we're trying to say.

I knew it was a crappy schematic, but it shows the diodes and how there are 4 per coil. That was the only one that I could find of the breakout board.

Hopefully, between our two schematics it will be clear.

You know about RS1 and RS2 , right ? Do you have those ?
Did you read the datasheet for the L297 ?

Um... I might not have been clear.

I only posted that schematic to show how the diodes should be connected. Ignore L297 and L298 in that schematic.

Um... I might not have been clear.

I'm just can't keep up today...