The story behind this project is a bit overcomplicated. That’s all below, if you’re interested. I made a video to explain the final product:
Back Story
This all started when I bought a sewing machine for making fabric RFID tags a little over a year ago, and started using it to make cute plushy objects. Well, as much as I like making plushy objects, I haven’t actually made very many of them since buying the machine. So, my boyfriend has been guilting me into making him a few as gifts for Christmas, birthday, valentine’s day. Naturally, being the great partner I am, this gets me thinking about ways to soup up my sewing machine first
The original machine did bug me in many ways when working on fine detail work. I’m lazy and uncoordinated with a needle, so I tend to sew almost everything by machine, even when the individual stitches all have to be lined up just right. In fact, when sewing the face parts on my meat and crab plushies, I found myself sewing individual stitches by turning the flywheel by hand.
I don’t know whether more expensive sewing machines are any better, but on my cheap Singer Inspiration 4210 the stock motor is nearly unusable at slow speeds. It stalls easily, makes an awful buzzing noise, maintains an uneven speed, and delivers very little torque.
Sensors
My first experiments were to instrument the sewing machine with sensors that I could use to estimate the speed and angle of the main shaft. I needed some kind of absolute angle reference, plus some way of counting how far the shaft has traveled. For the angle reference, I found a really handy place to mount a photo-interrupter sensor. This cam is part of the mechanism that advances the machine’s feed dogs. It conveniently moves this metal bar back and forth once per revolution of the shaft.
For sensing the shaft speed accurately, my preferred solution would have been a high-resolution encoder wheel attached to the motor or the main shaft. But that would, at the very least, involve making a rotary encoder disc and attaching it somehow to one of the sewing machine’s moving parts. I wanted to avoid messing with the machine’s moving parts as much as possible, so I looked for non-contact solutions. I noticed that, with a little signal conditioning, an IR reflection sensor works pretty well for counting teeth on the machine’s drive belt. After switching motors, I modified this to sense teeth on the motor’s sprocket instead, but the same signal conditioning circuit works in either case. The signal conditioner is an dual op-amp configured as an amplifier, bandpass filter, and comparator with hysteresis.
Lastly, there’s the most important sensor: the foot pedal! I wanted to keep the original foot pedal feel, but use it as a generic input device for the microcontroller. So, I removed all electronic parts other than the variable resistor itself, and connected that to a 1/8″ jack. With a little modification, the jack fit into the same hole that was originally used for the mains cord.
Induction Motors Suck
This is where the project got a bit out of hand and I started making wrong turns. At first, I was hoping it would be possible to implement smooth closed-loop control by using the original motor and a simple triac-based speed controller for the motor. This seemed straightforward enough. But I didn’t have all of the parts on hand to do a normal optotriac + triac based driver circuit. So I went shopping at HSC. No optotriac, but there were some solid state relays. Alas, after I got them home and looked up the data sheets, it turns out they are the zero-crossing switching variety. Useless for speed control. So, back to the drawing board. No optotriacs on hand. Well, I could move the opto-isolation, putting the microcontroller on a line-powered circuit, and opto-isolating the serial port instead. But that sounded really annoying to debug safely, especially for me without an isolation transformer or variac. But that would require a low-voltage power supply on the mains side of the optoisolator anyway, and if I had to go to that trouble I might as well just use a transistor to switch on the triac…
So I started rummaging through my junk bins again, and I found an old X10 lamp module. This must have a triac in it, I thought. It won’t have an optoisolator, since X10’s cheap circuits never bother with mains isolation. But it might have a power supply and zero-crossing circuit I could use. So I find a handy LM465 schematic online, and I start paring down the circuit into just a bare-bones triac driver, zero crossing detector, and +15V power supply. I got pretty far along on this triac-based speed controller before I switched tactics:
I was experimenting with closed-loop servo control using this triac controller, but the results were pretty uninspiring. With a triac, you can only change speeds as fast as twice your AC power frequency. And a 120 Hz control loop just isn’t tight enough to keep the sewing machine operating smoothly at low speeds. The motor’s lousy torque at these speeds certainly doesn’t help.
I also had lots of trouble with EMI in this design. With all the parts strewn about my desk and electrically isolated but not RF shielded, my microcontroller would randomly reset after the motor ran for a few seconds or so. I first saw this with my trusty Propeller. I tried switching to an AVR Butterfly, half to try and avoid the EMI, half to have its LCD and joystick as a user interface. But, no luck.
I was curious how they solve this problem in industry. Servo motors are pretty common in industrial automation, and surely you must need a fancier way to control the speed of a large motor in order to build a heavy-duty servo. Well, it seems that there are two solutions:
- Just use a DC motor instead of AC. This is more expensive, but it’s simple and until recently it was the only option.
- Variable-frequency drive. You still use an AC motor, but now you use an AC-to-DC power supply plus a DC-to-AC inverter to control the frequency of the motor’s power supply. With an induction motor, this controls the speed.
VFD seems quite cool, and I was really close to attempting to build a simple VFD controller using parts from a dead UPS. But then my better senses caught up with me…
So, I was about to settle for this mediocrity and finish off my triac-based controller with some buttons and mounting hardware from HSC, when I randomly happened upon the perfect DC motor. I didn’t know it was perfect at the time, but I had a hunch. As soon as I got it home and sat it next to the original motor, I knew.
I was pretty lucky. The speed range was good, the sprocket had the same pitch, and it had plenty of torque at low speeds. The only problem: It’s just barely too large to fit inside the sewing machine cabinet. So, I had to improvise the mounting a bit. I ended up slicing off the bottom panel of the sewing machine, bolting its frame to some scrap pressboard, and mounting the motor using a hacky arrangement of pressboard scraps, screws, and zip ties.
I started out building a simple MOSFET speed controller for the motor, since I’d never used a MOSFET to control an inductive load before. But after spending an hour or two trying to squash transients and convince my FETs to switch at a high enough frequency, I figured I’d had enough pain for one week. I had a spare LMD18200 chip with this project’s name on it.
The LMD18200 is an amazingly versatile and robust little chip. I used it for my laser projector project a while back. It was really overkill for that, but it’s about right for this sewing machine’s beefy new motor. I needed a pretty heavy duty motor drive capacitor too, so I ended up mounting the LMD18200, capacitor, and DC-DC converter in a small metal box for safety reasons. If the capacitor fails, I’d prefer not to have burning hot electrolyte and shrapnel all over my face.
Future work?
Enough rambling for now. And I guess I should stop hacking my sewing machine, and start sewing cute things
I did leave plenty of room in this build for later expansion. I’d like to add some kind of user interface for switching sewing modes. Right now I’m using the USB port for that, but a little LCD with a rotary encoder knob would be just swell. I’ve also thought of other ways to automate the sewing machine to make common tasks easier. For example, it would be useful to have a mode that automatically lifts the presser foot between stitches in single-stitch mode. I already found a good place to mount an RC servo motor for that.
And then there’s the idea of building a CNC embroidery machine around this, using Lego Mindstorms to make the cartesian robot…
Links
- More pictures
- Ugly hand-drawn schematics: main board, wiring harness, power box
- Source code for the Parallax Propeller firmware






I wish I understood how to do any of this.
This is an excellent idea, and I may have to do something like this to my own sewing machine.
One additional thing, you describe the motor as a “junk shop” motor. I have a couple of these on hand, so can confidently say you’ll find this exact sort in the cheap generic children’s electric scooters if you ever need a replacement.
Micah… You should file a patent on this. I’m not joking. These modes are horribly useful and I’m sure Singer or Brother would love to have them. Would it be a bad idea to get the concept patented then give them a call (or at least an email)?
Really? I’ve always assumed that the high-end $$$$$ sewing machines out there already had features like this. But I’ve never used one, so I really have no idea
The stop-with-needle-down feature exists, but the others I have not seen, and I’ve been sewing (home and professionally) for 30 years. In particular, for home embroidery, the one-stitch-at-a-time seems super useful. I may be trying alterations like this on a machine I have that I dislike
This might be the coolest thing I’ve ever seen.
I have a very similar Singer machine that also has the same problems at slow speed. I seem to share your aversion to hand sewing anything as well. Despite the fact that I understood almost none of how you figured out the electronics, I know how to wire things up and can follow directions – I AM SO DOING THIS!
Sweet! Let us know how it turns out
fascinating idea for resurrecting a generally useless machine. I’m curious to see how this effects the plastic gears that singer uses and if the higher speed causes them to break down faster. I sew for a living and can tell you that on older or higher quality machines speed control and low speed sewing are not an issue. Some of the newer computerized Brothers have excellent speed control options as well.
You can stop by a good Bernina dealer and try out the full line of machines. I have a high-end quilting machine that does most of what you desire. I second the idea to seek patents. Really enjoyed reading your line of thought.
WOW! I really enjoyed this post. I wish I could say something a little more “smart,” but this is just kick ass.
I enjoyed your work..but still needs to know about the final outcome..Keep up the good work..
I have also worked on CNC embroidery machine and i made DST to Gcode embroidery software too..you can see in my blog
http://www.my-woodcarving.blogspot.com
regards
Thanks for the insight into the possibilities for motors for sewing machines. I am building a long arm quilting machine for my wife. The closed loop mode would be perfect for my project. Now all I have to do is figure out the circuitry. I have an electronics background and understand the concepts.
You might want to take a break from re-inventing the wheel (not that there’s anything wrong with this–how else would we get better wheels?). Try searching freepatentsonline with the keyword ‘gegauf.’ This is the name under which bernina files their patents. They have some pretty clever schemes to measure needle position, control motor speed, etc. Not suggesting you steal their patents, but you could get some ideas & inspiration here. I look at their patents often when trying to repair old sewing machines. Good luck!