Posts | Comments

Planet Arduino

Archive for the ‘Stepper Motor’ Category

For anyone who’s ever had to make their own tea, steeping it for the right amount of time can be a pain. That’s precisely the problem that the automatic tea brewing robot solves with its painless approach to brewing tea, built by Slovenian electrical engineering student [Kristjan Berce].

You can use the robot by setting a timer on the knob, at which point the robot raises it arm for the tea bag then dips in the water every 30 seconds until the time has passed. At the end of the timer, the bag is raised clear of the cup to end the brewing. It’s a remarkably simple design that almost evokes chindogu (the Japanese art of useless inventions) if not for the fact that the robot actually serves a useful purpose.

The components for 3D printing the robot are available online, consisting of a case, a container for the Arduino-powered electronics, the lever for holding the tea, and the gear that raises the lever up and down. The device also uses an integrated Li-Ion battery with an accessible charging port and integrated BMS. A 35BYJ46 stepper motor and ULN2003 driver are used to move the 3D printed mechanism. The device uses a potentiometer for setting the steeping time between 1 and 9 minutes, and there’s even a buzzer for indicating once the tea is done brewing.

The Gerber and Arduino code files are open-source for any hackers looking to make their own tea brewers; just take care they operate with “deadly punctuality”.

It’s fair to say that building electronic gadgets is easier now than it ever has been in the past. With low-cost modular components, there’s often just a couple dozen lines of code and a few jumper wires standing between your idea and a functioning prototype. Driving stepper motors is a perfect example: you can grab a cheap controller board, hook it up to a microcontroller, and the rest is essentially just software. But recently [mechatronicsguy] wondered if even that was more hardware than was technically necessary to get the job done.

It’s not that he was intentionally looking to make things more complicated for himself, of course. His rationale was entirely economic; if you’re looking to drive a dozen or more stepper motors, even the “cheap” controllers can add up. So he started to wonder if he could skip the controller entirely and connect the stepper motor directly to the digital pins of an Arduino. Generally speaking this is a bad idea, but if you’re careful and are willing to take the risk, [mechatronicsguy] is living proof it’s possible

So what’s the trick to running a whopping seventeen individual stepper motors directly from the digital pins of an Arduino Mega? Well, to start with you’re not going to be running the beefy NEMA 17 motors like you might find in a 3D printer. [mechatronicsguy] is using the diminutive (and dirt cheap) 28BYJ-48, a light duty stepper used in many consumer products. Even with this relatively tiny motor, you need to crack open the case and cut a trace on the PCB to switch it from unipolar to bipolar.

Beyond that, you need to be careful. [mechatronicsguy] reports he’s had success running as many as ten of them at once, but realistically the fewer operating simultaneously the better. This is actually made easier due to the relatively poor specs of the 28BYJ-48 motor; its huge eleven degree step size means its not really susceptible to the same kind of slippage you’d get on a NEMA 17 when powered down. This means you can cut power to all but the actively moving motor and be fairly sure they’ll all stay where you left them.

With as popular as the 28BYJ-48 stepper is, there are several projects this “quick and dirty” method of interfacing could potentially work with. This small “barn door” star tracker is an obvious example, but we’ve also seen some very nice robotic arms built with these low-cost motors which could benefit from the technique.

Part of the joy of owning a dog is feeding it. How often do you get to make another living being that happy? However, sometimes you can’t be there when your best friend is hungry. [El Taller De TD] built an auto dog feeder using an Arduino and stepper motor. The video and links are in Spanish, but if your Spanish is rusty, YouTube’s caption autotranslation isn’t bad and Google Translate can help you with the web site.

The electronics are reasonably simple: an Arduino, a Bluetooth module, and a stepper motor driver. Mechanically, the motor and some PVC pipe are all you need. There’s a small phone application to drive the Bluetooth using App Inventor.

This would be a pretty straightforward first project and — of course — could be useful for any kind of animal. For dog use, we might have hardened the external wires and circuit boards a bit though. In addition there are plenty of things you could do in software, for example you could feed every 8 hours. It seems like you could add a sensor to tell when you are out of food, or perhaps if the food was not feeding for some reason.

We’ve looked at using App Inventor with Bluetooth before and it is pretty easy. We might have been tempted to go with Blynk to have more options for communication, but either way is pretty easy.

If you collect trading cards of any kind, you know that storage quickly becomes an issue. Just ask [theguymasamato]. He used to be really into trading cards, and got back into it when his kids caught the bug. Now he’s sitting on 10,000+ cards that are largely unorganized except for a few that made it into sleeve pages.  They tried to go through them by hand, but only ended up frustrated and overwhelmed. Then he found out about [Michael Portera]’s Pi-powered LEGO card sorter and got all fired up to build a three-part system that feeds cards in one by one, scans them, and sorts them into one of 22 meticulously-constructed cardboard boxes.

[theguymasamato]’s card sorter is the last stop for a card after the feeder has fed it in from the pile and the scanner has scanned it. The sorter lazy Susans around on a thrust bearing, which is driven by a 3D printed drive wheel attached to a stepper. The stepper is controlled with an Arduino.

Here’s where it gets crazy: the drive wheel and timing belt are made from the flutes of corrugated cardboard. As in, he used that wavy bit in the middle as gear teeth. Every one of those cardboard teeth is fortified with wood glue, a time-consuming process he vows to never repeat. Instead, [theguymasamato] recommends using shims to shore them up as he did in the card feeder. The whole thing was originally going to be made from cardboard. It proved to be too mushy to support the thrust bearing, so [theguymasamato] switched to MDF.

Right now, the sorter is homed via button press, but future plans for the device include an IR break beam switch. We’re excited for the scanner and can’t wait to see the whole system put together. While [theguymasamato] works on that, position yourself past the break to watch the build video.

If you collect trading cards of any kind, you know that storage quickly becomes an issue. Just ask [theguymasamato]. He used to be really into trading cards, and got back into it when his kids caught the bug. Now he’s sitting on 10,000+ cards that are largely unorganized except for a few that made it into sleeve pages.  They tried to go through them by hand, but only ended up frustrated and overwhelmed. Then he found out about [Michael Portera]’s Pi-powered LEGO card sorter and got all fired up to build a three-part system that feeds cards in one by one, scans them, and sorts them into one of 22 meticulously-constructed cardboard boxes.

[theguymasamato]’s card sorter is the last stop for a card after the feeder has fed it in from the pile and the scanner has scanned it. The sorter lazy Susans around on a thrust bearing, which is driven by a 3D printed drive wheel attached to a stepper. The stepper is controlled with an Arduino.

Here’s where it gets crazy: the drive wheel and timing belt are made from the flutes of corrugated cardboard. As in, he used that wavy bit in the middle as gear teeth. Every one of those cardboard teeth is fortified with wood glue, a time-consuming process he vows to never repeat. Instead, [theguymasamato] recommends using shims to shore them up as he did in the card feeder. The whole thing was originally going to be made from cardboard. It proved to be too mushy to support the thrust bearing, so [theguymasamato] switched to MDF.

Right now, the sorter is homed via button press, but future plans for the device include an IR break beam switch. We’re excited for the scanner and can’t wait to see the whole system put together. While [theguymasamato] works on that, position yourself past the break to watch the build video.

Many of the projects we feature on Hackaday are motivated by pure greed. Not on the part of the hacker, mind you; but rather the company that’s charging such an outrageous price for a mass produced item that somebody decides they can do the same thing cheaper as a one-off project. Which is precisely how [Bryan Kevan] ended up building his own carbon fiber tube wrapping machine. Not only do the finished tubes look fantastic, but they cost him a fraction of what even the “cheap” commercial ones cost.

The principle behind producing the tubes is really pretty simple: carbon fiber ribbon (or “tow”, in the official parlance) gets wrapped around a rotating mandrel, ideally in interesting patterns, and epoxy is added to bind it all together. When it’s hardened up, you slide the new carbon fiber tube off the mandrel and away you go building a bike frame or whatever it is you needed light and strong tubes for. You could even do it by hand, if you had enough patience.

[Bryan] had done it by hand before, but was looking for a way to not only automate the process but make the final product a bit more uniform-looking. His idea was to rotate a horizontal PVC pipe as his mandrel, and move a “car” carrying the carbon fiber ribbon back and forth along its length. The PVC pipe just needs to rotate along its axis so he figured that would be easy enough; and using a GT2 belt and some pulleys, getting the carbon-laying car moving back and forth didn’t seem like much of a challenge either.

The frame of the winder is built from the hacker’s favorite: 20/20 aluminum extrusion. Add to that an Arduino Uno, two stepper motors with their appropriate drivers, and the usual assortment of 3D printed odds and ends. [Bryan] says getting the math figured out for generating interesting wrap patterns was a bit tricky and took a fair amount of trial and error, but wasn’t a showstopper. Though we’d suggest following his example and using party ribbon during testing rather than the carbon stuff, as producing a few bird nests at the onset seems almost a guarantee.

One of the trickiest parts of the project ended up being removing the carbon fiber tubes from the PVC mandrel once they were done. [Bryan] eventually settled on a process which involved spraying the PVC with WD-40, wrapping it in parchment paper, and then using a strip of 3M blue painter’s tape to keep the parchment paper from moving. If you can toss the whole mandrel in the freezer after wrapping to shrink it down a bit, even better.

So was all this work worth it in the end? [Bryan] says he was originally looking at spending up to $70 USD per foot for the carbon fiber tubes he needed for his bike frame, but by buying the raw materials and winding them himself, he ended up producing his tubes for closer to $3 per foot. Some might question the strength and consistency of these DIY tubes, but for a ~95% price reduction, we’d be willing to give it a shot.

Years ago we covered a Kickstarter campaign for a very similar carbon winder. Probably due to the relatively limited uses of such a gadget, the winder didn’t hit the funding goal. But just like the current wave of very impressive homebrew laser cutters, the best results might come from just building the thing yourself.

The view from America has long seen French women as synonymous with thin and/or beautiful. France is well-known for culinary skill and delights, and yet many of its female inhabitants seem to view eating heartily as passé. At a recent workshop devoted to creating DIY amusements, [Niklas Roy] and [Kati Hyyppä] built an electro-mechanical sushi-eating game starring Barbie, American icon of the feminine ideal. The goal of the game is to feed her well and inspire a happy relationship with food.

Built in just three days, J’ai faim! (translation: I’m hungry!) lets the player satiate Barbie one randomly lit piece of sushi at a time. Each piece has a companion LED mounted beneath the surface that’s connected in series to the one on the game board. Qualifying sushi are determined by a photocell strapped to the underside of Barbie’s tongue, which detects light from the hidden LED. Players must race against the clock to eat each piece, taking Barbie up the satisfaction meter from ‘starving’ to ‘well-fed’. Gobble an unlit piece, and the score goes down.

The game is controlled with a lovely pink lollipop of a joystick, which was the main inspiration for the game. Players move her head with left and right, and pull down to engage the solenoid that pushes her comically long tongue out of her button-nosed face. Barbie’s brain is an Arduino Uno, which also controls the stepper motor that moves her head.

[Niklas] and [Kati] wound up using cardboard end stops inside the box instead of trying to count the rapidly changing steps as she swivels around. The first motor they used was too weak to move her head. The second one worked, but the game’s popularity combined with the end stops did a number on the gears after a day or so. Click past the break to sink your teeth into the demo video.

Barbie can do more than teach young girls healthy eating habits. She can also teach them about cryptography.

Lab equipment is often expensive, but budgets can be tight and not always up to getting small labs or researchers what they need. That’s why [akshay_d21] designed an Open Source Lab Rocker with a modular tray that uses commonly available hardware and 3D printed parts. The device generates precisely controlled, smooth motion to perform automated mild to moderately aggressive mixing of samples by tilting the attached tray in a see-saw motion. It can accommodate either a beaker or test tubes, but since the tray is modular, different trays can be designed to fit specific needs.

Source code and schematics are available from [akshay_d21]’s Google Drive and the 3D models are also available from the National Institute of Health’s 3D Print Exchange. A demonstration video is embedded below, in which you can see how smooth and controlled the motions are.

DIY lab equipment really benefits from the recent growth in desktop manufacturing and part availability; this one is in good company along with the DIY Laboratory Dry Bath and this DIY Syringe Pump.

Stepper motors work by alternating a series of magnets in order to rotate its shaft by a certain angle. When the shaft is manually twisted, these magnets produce an electrical signal in a predictable pattern, which as shown in the video below, can be used as an encoder with the help of an Arduino Uno.

More information, including a circuit diagram and the Arduino code used for the stepper-NeoPixel and stepper-stepper examples can be found here. While the write-up notes that this stepper-encoder won’t work reliably if turned too slowly, it seems to work quite well at the fairly low speed shown in the demonstrations.

I want to tell you how to make incremental encoder from stepper motor. When we turning shaft of stepper motor it works like generator. It generates certain impulses on its coils. After some signal processing, we get same impulses as incremental encoder. This encoder has one problem, it can drop steps if you turning very slowly. But for many applications, it doesn’t matter.

We always think it is interesting that a regular DC motor and a generator are about the same thing. Sure, each is optimized for its purpose, but inefficiencies aside, you can use electricity to rotate a shaft or use a rotating shaft to generate electricity. [Andriyf1] has a slightly different trick. He shows how to use a stepper motor as an encoder. You can see a video of the setup below.

It makes sense. If the coils in the stepper can move the shaft, then moving the shaft should induce a current in the coils. He does note that at slow speeds you can miss pulses, however. Again, the device isn’t really optimized for this type of operation.

The circuit uses an opamp-based differential amplifier to read the pulses from the coil. Two opamps on two coils produce a quadrature signal just like a normal encoder. When the shaft turns in one direction, one pulse will lead the other. In the other direction, the lead pulse will be reversed.

There’s code to let an Arduino read the pulses, but we were disappointed it was behind a Patreon paywall. However, there’s plenty of code that will read quadrature on an Arduino or other processors, and that really isn’t the point of the post, anyway. We’ve seen similar hacks done with hard drive motors which are quite similar, by the way.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook