Learning How To Use Pololu Stepper Driver Modules

My first experience with stepper motors is with this very inexpensive Amazon offering. I’ve since learned that these stepper motors are termed “unipolar” which incurs some trade-offs. From the price tag I knew they were cheap, and from the description I knew they were easy to control from a simple program. What I did not know about is the fairly significant headwinds if one wishes to get beyond the basics.

The simple driver module that goes with these simple motors only works for straightforward on/off control. When I tried to modulate the power to be somewhere between on and off, mysterious electromagnetic stuff started happening causing erratic motor behavior. At the time I decided to postpone solving the issue and to look into it later. Well, now is later and I’m going to solve my problem by ignoring unipolar motors entirely. Because it’s more productive to look at the bipolar stepper motors used by pretty much every halfway decent piece of hardware.

The motors themselves are more expensive, and the drivers are as well. Fortunately economies of scale meant “more expensive” is still only a few dollars. Pololu sells a line of stepper motor driver modules that are popular with the 3D printing crowd. (Or at least that’s where I learned of them.) The module’s physical form factor and pinout has become something of a de-facto industry standard. And a bipolar stepper motor for experimentation is equally easy to obtain as pretty much any stepper motor salvaged from consumer electronics will be a bipolar motor. For the purposes of my experiment, this motor came from a dead inkjet printer’s paper-feed mechanism.

Hooking up the electronics is a fairly straightforward exercise in reading data sheet and following instructions. The only thing I neglected was a capacitor across the motor input pins, something pointed out to me when I brought this experimental rig to a local maker meet. Fortunately I had been playing with a small enough motor that the absence of said capacitor didn’t fry everything.

All I needed to do was generate two data signals: direction and step. This is apparently a fairly common interface, even industrial-type stepper motor controllers accept similar inputs, so a Pololu is a great way to start. I created a small program to run on an 8-bit PIC microcontroller to generate these pulses, and the motor is off and running. It was super easy to get started, and this setup is enough for me to play around and build some basic understanding of stepper motor behavior. How they trade torque for speed, and how they respond to higher voltage/amperage. It’s a good foundation for designing future robotics projects.

Pololu ExperimentComponents on the breadboard, from left to right:

  1. Breadboard Power Supply
  2. Pololu A4983 Stepper Driver
  3. PIC16F18345 with program to generate step/direction based on potentiometer value.
  4. LEDs hooked up in parallel with step and direction signals.
  5. Potentiometer

A Gentle Introduction To Surface Mount Soldering

In my electronics projects to date, I’ve avoided surface mount devices (SMD) as much as I could. They require custom circuit boards because, given the absence of through-hole legs, they don’t work on prototyping breadboards. They’re small, which makes them difficult to handle without specialized tools. Tools like microscopes to see them, fine-tipped tweezers to handle them, and specialized fine tips soldering irons to solder the tiny connections.

That avoidance came to a crashing end at Layer One, where I had to face SMD head on or be left out of the fun on the Layer One badge add-on kit. The tools were provided at the event, as well as some guidance, so I got over the very beginner parts of the learning curve. It doesn’t make me an expert by any means, that would require more practice.

In the spirit of keeping the momentum going, I decided to check out a beginner-friendly SMD soldering electronics kit. The “I Can Surface Mount Solder” kit was designed by someone who also wanted a gentle introduction to SMD and decided to design a circuit for the purpose. All information is open source so I can make my own. And catering to lazy people like myself, the designer has also put kits up for sale on the maker marketplace Tindie.

There’s a volume discount for buying ten or more, with no increase in shipping, so I decided to buy ten and bring them to share at my local hobbyist meetup. I knew I wasn’t the only one who wanted to practice SMD with something simple. Before the event I had one taker for a kit besides myself. During the meet, a third one was put together by a SGVHAK regular and two more were put together by people who have never attended a SGVHAK meet before. They came because they read the meeting information on Meetup.com and wanted to try SMD soldering. I count this as a publicity win.

The kit itself was far easier to put together than the LayerOne LED add-on kit. The SMD components were about the largest sizes available. So they could be seen by the naked eye and while we still needed tweezers to handle them, we could solder them with regular-sized soldering tips. The only real technical challenge was determining the appropriate orientation of the lone red LED, something that took us a while to figure out. Fortunately we all determined the direction correctly before soldering.

At the end of the night, we had five little pulsing heartbeat pendants and five people who had the satisfaction of a successful SMD soldering project.

I Heart SMD

Monoprice Maker Ultimate (Wanhao Duplicator i6) Kills Another Relay

I was willing to stop at “good enough for now” on modifying my open-box Monoprice Maker Select because I needed printers up and running. In the process of designing and iterating Sawppy‘s 3D-printed components, I kept both printers busy pumping out prototypes to see how the designs in my mind survived the translation into real world pieces.

Sometimes there was enough work to keep printers busy around the clock, and this was too much stress for the control boards inside these affordable printers. It’s an inevitable tradeoff between price tag and robustness. In the case of my Monoprice Maker Ultimate, the weakest point in the chain is the main motor relay that controls power going to all the motors (both stepper motors and fan motors) and heaters.

This relay has failed once before, and under the constant workload, another one has kicked the bucket. It has started failing intermittently which shows up as brief interruption in motor power. Since the electronics are not powered through this path, these brief interruptions ruined prints, making them look like the motor drive belt had skipped a few teeth when the reality was the motors stopping briefly as the electronics continued onwards.

Last time this happened, I kept trying to diagnose belt skipping. Wasting a lot of time looking over mechanical parts that were working well. This time I recognize the symptoms and pulled out the control board before the printer failed completely.

Since it wasn’t completely burned out yet, the relay exterior didn’t look bad – only a minor discoloration that might have gone overlooked if we didn’t know exactly where to look.

Relay exterior discoloration

Cutting away the relay’s blue enclosure exposed a familiar sight: the interior is fried.

D6 Second Failed Relay

It’s always easier to do something the second time, but addressing my second fried relay is still time spent not working on the project itself.

Solarbotics Photopopper 4.2 Photovore

And now, a completely unnecessary distraction.

While digging through the parts pile for stuff to help build Sawppy’s wiring, I came across an electronics kit that has been sitting, waiting to be built, for over a decade. Every time I came across this kit I decided “I’ll build it later.” And even though I’m in the middle of building rover wiring, I looked at this kit today and thought: “I kept saying I’ll build this someday… that day is today.”

Photopopper Bag

I’m not sure how old the kit is, but I’m quite confident it’s been over a decade. The only date visible is the last revision date on the manual – August 25, 2003. The manual said it is version 4.2, the Solarbotics catalog is now up to version 5.0. I thought its age wouldn’t be a problem, it’s not like electronic components decay, right?

Photopopper Contents

It’s a simple little kit of through-hole solder components. The first step – like all kits new and old – is to lay out all parts and check against the parts manifest in the instruction. Once all parts are accounted for, assembly can begin. Given the growth in my electronics skills over the past years, this “Skill Level 3” kit is now a breeze to assemble.

It took only about half an hour to reach the point where all power components are connected. I am instructed to take the partially built robot someplace bright to give the solar powered system a test. I placed it under sunlight and… nothing.

First I ran through troubleshooting steps outlined in the manual, and none of them helped. So it was again time to deploy skills I didn’t have years ago, this time for electronics debugging. Out came the multi meter and start probing the circuit.

Diagnosis: the electrolytic capacitor is dead. Remember when I said electronic components don’t decay with age? Well, that was wrong because electrolytic capacitors do. Back into the parts pile I go and I was able to find another 4700 uF capacitor. Problem: it is physically a far larger device. In this picture, the dead capacitor from the kit is on the right, dwarfed by the new functional capacitor on the left.

Photopopper Capacitor

Since the functional capacitor is much larger physically, it couldn’t fit in the same space under my photopopper. The big capacitor would have to go above. The dead capacitor also served as the third leg of the photopopper, so that job had to be reassigned to a little piece of wire. Now the robot sit on the wire instead of a capacitor along with its two wheels.

Photopoppin

And now… it moves! The little solar panel charges up the capacitor, and ever few seconds that power is dumped into one of the electric motors, scooting the photopopper a tiny bit forward. A process that will repeat for as long as there’s light shining on the solar panel. I’m sure that it would move farther or maybe faster if the original sized capacitor was in place. This poor photopopper has to carry a big heavy barrel of a capacitor on its back.

Technically the kit has not been completely assembled. There are also two touch sensors that help the photopopper detect walls and steer away from them. But given that it is moving, and that I wanted to get back to assembling wiring for Sawppy the Rover, I’m content enough to leave the photopopper as is. I’ll pull it out every once in a while, so I could put it under sunlight and let it scoot around.

 

 

 

 

 

 

 

Old ElectriFly Triton Sheds Light On Battery Condition

Today’s enlightenment comes courtesy of an old ElectriFly Triton battery charger unearthed from the dusty equipment shelf. This particular charger was purchased years ago to feed an interest in electric remote-control aircraft. At the time, the RC aircraft field was in a period of transition. The lowest-cost aircraft came with NiCad batteries, the mainstream used NiMH batteries, and the premium segments started adopting lithium-ion chemistries. To work in this world, the charger is designed to be used out at a remote control air park, hence it was designed to run on a 12 volt lead-acid battery instead of an AC outlet that might not be at the airfield.

Born into this confusion, the Triton charger was a jack of all trades. It knows how to properly charge all of the above types of batteries. It even has the capability to do a charge/discharge cycle to measure capacity. The latest models appears to have picked up even more features, but this old one is already on hand and can tell us interesting things.

Triton was first used to quantify behavior of an old 12Ah lead-acid battery dug up for solar panel investigation. It had discharged down to 6V while in storage and its voltage curve did not behave as expected. The good new is that even degraded, Triton deemed it within acceptable behavior range for a lead-acid battery. The bad news: Triton discharge test added up to only about 3.5Ah of usable capacity remaining out of the original 12Ah. There might be interesting projects where a degraded lead-acid battery can be useful, but it’s equally likely to end up in battery recycle.

After the old lead-acid battery was examined, the Triton was employed for the NiCad battery cells pulled out of the recent Dustbuster project. These cells suffered from chronic overcharging and exhibited depressed voltage levels when trying to deliver the current demanded by the Dustbuster motor. This condition might possibly be cured by individually charging and discharging the cell multiple cycles according to NiCad best practices, but that didn’t seem worth the expense of buying a NiCad charger/discharger. Fortunately, with the rediscovery of the Triton, we now have one. We’ll see if these NiCad cells can be recovered to a point to be useful for future projects, or if they should just go into battery recycle.

Triton NiCad

DSO 138 Simple Case by chibikuma2

The DSO 138 purchase was ultimately decided by seeing one in person, assembled by a local maker. That unit was first encased in an acrylic case, which cracked under use and was replaced by a 3D-printed case. Learning from the pioneer’s experience, I’ll skip the acrylic case and go straight to the 3D-printed one. If it works out, I’ll have something useful to protect the DSO 138. If it doesn’t, at least I could see one in action and decide what improvements to make.

The printer is the Monoprice Maker Ultimate, and the STL files were sliced into G-Code using Cura 3.1, printed on top of a Cura-generated raft.

DSO138 Case Bits

The author of this particular case is Thingiverse user “chibikuma2“. And the dimensions of the design looked good – all the pieces lined up well with parts on the DSO 138. The top and bottom parts of the case is held by friction. There were no fasteners and no clasps or hooks. 3D printers with loose XY accuracy may have problems creating this tight fit – if the XY “ooze” is too large, the pieces would not fit together at all. And conversely, if the printer under-extrudes, the two halves would be too loose to hold together.

The fit is good enough on the Maker Ultimate printer to fit together tightly. Once assembled, a putty knife or similar tool would be needed to pry the halves apart again.

The other printer performance dependency is first-layer performance. The labels for the controls in this design were done as lettering recessed into the surface. For these words to be legible, the first layer must be accurately positioned since slight movements are enough to spoil the lettering. Cura’s raft is what I usually use when first layer is important, sadly in this particular case it was not enough.

DSO138 Case Reset

The lettering is cosmetic, but there’s also a functional requirement for first layer precision: the 3D printed sliders that cap over the multi position switches on the DSO 138. The square hole at the base must match up to the square peg on the switches. If the holes are too large, there will be unpleasant slop in switch operation. If the holes are too small, the slider would not fit. Again this printer fell short of ideal, and had to be cleaned up with a small sharp blade.

DSO138 Case Slider

This is a decently functional case for the DSO 138, but this experience has motivated thinking towards creating a different design. Some items on the feature wish list are:

  • Move away from 3D-printed lettering. We have a label maker and we’re not afraid to use it.
  • Expose the loop of wire that generates the test square wave form.
  • Include a battery pack to supply the 9-12V DC power, with associated auxiliary components like an on/off switch.
  • A removable screen cover to protect the screen while in transit.
  • Storage for the probes.

DSO 138 Oscilloscope Kit by JYE Tech

An oscilloscope has been on the tool wish list for a while, but good ones are really expensive. But occasionally a simple basic scope would have been better than no scope at all, which is where today’s project comes into the picture.

JYE Tech makes the DSO 138 oscilloscope kit perfect for electronics hobbyists who can make use of a simple scope and also willing to put in the time and effort to assemble one out of a kit. The kit is available at a very low-cost, a fair exchange for making their customers do their own assembly.

This product is popular enough to spawn counterfeit copycats, which was a concern. Not just out of fear of a problematic product, but also the desire to support the original authors. Fortunately JYE Tech offers the option to send in the serial number for authenticity validation. The serial number of this unit purchased from Amazon vendor Kuman checked out as authentic.

There are two versions of the kit that differ by their treatment of surface-mount components: pre-installed or not. This particular example is the variant with surface mount pieces already installed, the customer just has to take care of the remaining through-hole parts. All those parts to be soldered came in a single bag and had to be sorted and identified before assembly could begin.

DSO138 parts sorted

The instructions were straightforward enough for someone already familiar with basic electronics soldering. The only complaint with this kit is that some of the mount points were not designed for easy soldering. They connect directly to large pieces of copper trace that acted as a huge heat sink making it difficult to bring the solder joint up to temperature. It would have been nice if they etched a little more. Leave one contact sufficient to carry the current, and etched around the rest to serve as a thermal break.

Apart from that minor complaint, the soldering was not difficult, only tedious. The electronics hobbyist is reminded why manual assembly of circuit boards is not considered a great career. This particular example took roughly four hours to assemble. Thankfully, when power was connected, everything started running as they should. Here is the assembled DSO 138, showing the built-in square wave test signal.

DSO138 complete

A few simple tests followed the self test, clearly showing some limits of this little oscilloscope. For one thing, the voltage scale is quite unreliable. An AA battery at 1.22 volts (according to the Fluke multi meter) was interpreted by this oscilloscope as 1.67 volts. But we didn’t get this thing to read voltages – we want to use it to graph wave forms that we couldn’t see with a multi meter. (UPDATE: On the advice of the local maker who built a DSO 138 before I did, I ran the calibration routine to align Vpos with zero volt and now voltage levels are much closer to the Fluke meter readings.)

It’s now part of the toolbox. Thanks to its low-cost, it wouldn’t take much data to throw it in either of these two buckets:

  • Positive: “That was so much easier to diagnose with a scope, even a simple one. This was well worth the money.”
  • Negative: “The inaccuracy of the scope led us down the wrong diagnosis path. This was a waste of both time and money.”

While we wait for the verdict to come in, let’s work on an enclosure for this device.

 

Button Cell Joule Thief on a Clothespin

Since the time I got up and running building my own joule thief devices, I’ve been having fun lighting up LED with batteries that have otherwise been given up for dead. Most of them were AA and a few AAA, but I also had a few button cell batteries sitting around that might be good for a bit of LED fun.

Since these tiny little batteries are already weak, I did not expect very long run time out of them. And these cells on hand were in several different form factors. Given these two factors, it didn’t make sense to 3D print a battery case as I had done with with the AA batteries – the effort wouldn’t be worth the result. I just needed something to hold the contacts against the terminals of these thin batteries for long enough to drain their remaining power into some LED amusement.

Initially I tried the things that were already on my desk – paperclip and binder clip – but their naturally conductive nature meant it’s hard to avoid accidentally shorting the battery. I continued thinking along these lines during household chores, and I found my answer while doing laundry: clothespins!

Since these are made of cheap injection-molded plastic, they are not conductive like paperclips and binder clips. The cheap plastic can be easily melted with a soldering iron tip to mold around parts I wanted to mount. There is a spring to hold things tight, and the jaws open up wide enough for button cell batteries.

The bulk of the circuit was melted onto one jaw, and a wire is melted onto the other jaw. I had originally intended to run the wire through the middle of the spring, and started contemplating the best way to do so while minimizing the amount of stress metal fatigue would place on the wire.

Then I smacked myself on the forehead for overlooking the obvious: the spring is itself conductive! I don’t need to worry about metal fatigue of the wire if I recruit the spring into my circuit. So that was the final step – the wires of each jaw run to the spring, and the spring itself completes the circuit.

Clothes Peg Joule Thief

Analog Adventure: Flyback Diode

Every once in a while I learn the real world analog behavior of electronics components that I only think about in abstract digital terms. The most recent lessons come from my exposure to electrically operated switches a.k.a. relays. This exposure came from two fronts: one is the small failed relay module that I pulled out of my 3D printer, the other are the larger industrial-strength relays that were recently installed on the Tux-Lab thermoforming machine.

In the idealized digital world, these are just switches that control the flow of a large amount of electrical power on command of a much smaller electric signal. The control signal goes on, the big power goes on. Signal off, power off.

In the real world, this is implemented with an electromagnetic coil that generates the field necessary to move a physical armature. The tricky part comes from the time when the coil is de-energized. When the control signal is cut, the magnetic field collapses and is turned back into electrical energy on the circuit. This is actually the heart of my recent analog electronics project: a “Joule Thief” is a very simple flyback converter circuit to convert low battery voltage into a higher-voltage spike that can illuminate a LED.

But when the intent of the circuit is actually to just switch something on and off with a relay, such a voltage spike is unwelcome. It may in fact damage nearby components in the circuit. This is why I learned I needed to add flyback diode to protect the circuit for controlling the relays in the thermoforming machine.

Adding this array of diodes to protect against voltage spike complicates the prototype circuit, but it is good insurance to have. Once the control circuit is finalized, we plan to have a real circuit board fabricated so we don’t have to deal with this nest of wires. Unfortunately, in the near term I expect some headaches associated with the additional complexity.

FlybackDiodes

Building a Tiny “Joule Thief”

Yesterday I got a “Joule Thief” (a.k.a. Armstrong self-oscillating voltage booster) circuit up and running on a breadboard. The circuit was more complex than it needed to be, with a tangle of wires, because things got messy while debugging. But now that I know which parts connect to which, it’s time to simplify.

The goal is to make it small and compact enough to package together as a single-battery LED flashlight. That general goal broke down to the following parts:

  1. Minimize physical size. Since the coil is the largest single piece (other than the AA battery) it makes sense to align the diameter of the coil to the battery and pack everything else as tightly inside as I can.
  2. Minimize component count. Most Joule Thief examples on the internet (including the top picture on the Wikipedia page) soldered the legs of the individual components together. No circuit board needed.
  3. Friendly to hand soldering. There are some ready-made Joule Thief circuits for sale on the internet using surface mount components and a circuit board. I wanted something I can build by hand and maybe use as a soldering teaching project to be shared on the internet.

After a few iterations, I have something I’m happy to share with the world. This is purely about the mechanical assembly – the electronic schematic is identical to the one in the Wikipedia article linked at the top of this post.

An overview in words:

  • The resistor for the NPN transistor base is installed between the collector and emitter. The resistor acts as physical separation in order to avoid a short-circuit.
  • The transistor and LED are pointing in opposite directions, allowing their pins to point towards each other and soldered together. The aforementioned resistor keeps the LED anode and cathode separate.
  • The transistor is stuffed into the middle of the coil, utilizing the center volume.

The build sequence in pictures:

1 - Transistor
Transistor with the base bent in preparation for resistor installation.
2 - Transistor Resistor.jpg
The 1K Ohm resistor is installed on the base, between collector and emitter.
3 - Transistor Resistor Coil
The coil has two wires wound together. One end of this dual-coil is facing the camera, the other end facing away. Since we need to wire up the coil in opposite directions, we’ll bend one wire of the front pair towards the back, and the opposite back side wire to the front.
4 - Coil prep.jpg
The two wires now facing away from the camera are soldered together to become the positive terminal of the circuit. One of the two wires facing the front will be soldered to the resistor, and the other to the emitter.
5 - Transistor in Coil
Transistor in the center of the coil. Now the coil wires can be soldered.
5a - Resister soldered
Resistor soldered to one coil wire, all the others have been trimmed short in preparation for attaching the LED.
6 - LED
LED is soldered to the circuit, as is a wire to act as negative (return) wire.
7 - AA
Install the whole assembly in front of a 3D-printed AA battery tray: Let there be light!

Building a “Joule Thief”: Adventure in Analog Electronics

One of my early memories as a little kid playing with my battery-powered toys was the realization that battery exhaustion is not an absolute thing. A set of AA batteries that could no longer run a motorized toy aren’t completely useless – they could be installed in an electronic toy and make that light and beep. I turned it into a little game for myself: swapping batteries around trying to figure out which tired worn batteries would work in which toys.

A well-meaning adult saw this activity and thought they saw a poor child frustrated by dying batteries. He or she (I have no memory of the person, only their action) tried to help by taking away the worn batteries and giving me a fresh pack of AAs. They were understandably confused when their well-intended kindness were rewarded by an upset toddler in tears.

Many years later I would learn how electric motors demand more current than microprocessors along with their effect on battery power output, thus explaining my childhood observation. I understand what’s going on now, but I still try to pull every bit of power out of a non-rechargeable battery before they are disposed.

Which is why my eyes lit up when I learned of a circuit that can power a LED from a “dead” battery. Wikipedia says the official description is “Armstrong self-oscillating voltage booster” but it’s filed under “Joule Thief“, the pun name that I usually see.

This type of electronics projects venture beyond the digital world I’m familiar with. There’s no voltage representing 1 and 0, instead it works with voltage that oscillates. Specifically, I’ve never worked with the fields generated by wires coiled around a toroid core. The first few attempts – using either hand wound coils or savaged from electronics – failed. And I didn’t understand enough to diagnose if it’s the coil or the circuit.

This time around, I took a shortcut: I bought a pack of coils with customer comments that confirm they can be used for building Joule Thieves. This way, if the circuit didn’t work, I knew it was my fault and not the coil. And indeed, the first few attempts failed because the coil was not correctly connected to the rest of the circuit. (The key phrase I missed in the Wikipedia article: “the two windings are connected in opposing directions”.)

Attached is the picture of the first iteration that actually worked, powered by a “dead” AA battery. This circuit is unnecessarily complex because I had been moving parts and wires, around trying to understand where I made my mistake. But now that I have a working Joule Thief I can start simplifying and make a more compact version.

Joule Thief v1

Investigating the Infamous Relay Bypass for Monoprice Maker Ultimate (Wanhao Duplicator 6)

This week my 3D printer stopped working mid-print. All motor movement, heating activity, and cooling fans stopped simultaneously. However, the control panel is still responsive and so is the LED light strip. Time to hit the web and see what I can find.

My printer is a Monoprice Maker Ultimate, which is a rebranded Wanhao Duplicator 6. Which is in turn a knock-off of the Ultimaker design, though not a literal clone of any specific Ultimaker model.

A web search of my symptoms found a known point of failure with this product: the main 24V relay. The popular explanation is that Wanhao cloned somebody else’s circuit board, removed the features that would use the relay, and used a cheap relay that’s always on. So the recommended workaround is to solder a wire to bridge the legs of the relay and bypass it. “It doesn’t do anything anyway.”

I was skeptical of this explanation because if Wanhao is really just cutting costs, they would skip the relay entirely: no relay is cheaper than any relay! There must be more to this story.

But first, a check to see if the relay is indeed the fault. A quick visual inspection confirmed that there’s a problem with my relay, indicated by the melted hole in the side.

D6 Relay hole

For additional confirmation, we temporarily bridged the pins as recommended by forum posters. When done with the power on, it brought the always-on heat break and circuit board cooling fans immediately to life. Relay failure confirmed.

What does the relay do?

Turning off this relay cuts power to all 24V components: Motors, fans, and heaters. In normal operation, there’s no situation where the 5V components (micro-controller, display, LED strip) are running without the 24V components, so the answer must be related to abnormal operation. Our best hypothesis: this relay is a safety switch in place to halt the system if the 5V subsystem should fail. If that happens, it makes sense we’d want to shut down all the 24V parts too. And now that we have a plausible description of the relay as a safety feature, bypassing it with a soldered wire seems like a bad idea.

Why did the relay fail?

This part was easier to figure out. When I ran my printer with my Kill-A-Watt meter, it indicated the power draw jumps by over 300 watts when both heaters are active. So even ignoring the cooling fans and motors, the print bed and filament heaters together draw over 12.5 amps from the 24V plane.

Typing in the designation on the relay “SRD-05VDC-SL-C” found its datasheet, which says the relay can handle 10 amps. So the printer was designed such that the relay exceeded its rated capacity anytime both heaters are active. Not exactly a great design. The relay tolerated this overworked condition for many months but this week it could take no more.

The correct solution, then, would be to replace this relay with a higher-rated unit that can handle 15+ amps continuously. (12.5 for heaters + motors and fans + margin.) Unfortunately relays are not standardized in their footprint so I failed to find a drop-in higher-capacity replacement. (I found the Omron G5LE series with the same footprint, but with the same 10A maximum for DC so I’d be no better off.) Hooking up a beefier relay to the circuit board via wires is a possibility but intimidating. 300 watts of electricity is very good at finding minor flaws and turning them into big problems.

What do we do?

To summarize, the candidate solutions are:

  1. Bypass the relay with a wire as per internet forums: Seems like a bad idea to bypass a potential safety feature.
  2. Install an exact replacement: Known to work until it doesn’t.
  3. Install a higher-rated drop-in replacement: Great idea but such a replacement could not be found.
  4. Install a higher-rated unit elsewhere in the box, connect to the circuit board via wires: Adds many points of potential failure and >300W of power is unforgiving of flaws.

I’d love #3 but I couldn’t find a beefier relay with identical footprint. #1 and #4 are asking for trouble. For the immediate future, I choose #2 as the least-bad solution.

Building a Lithium Ion Battery Pack with S-8254A Protection IC

Encouraged by my earlier success buying somebody’s implementation of an IC reference design off Amazon, I went looking for more. The previous project used a MP1584 chip to regulate the variable voltage of a battery to a constant level for a Raspberry Pi 3. Now I want to improve upon the battery side.

The battery pack had three 18650-sized lithium-ion battery cells in series. These cells were salvaged from an old Dell laptop’s power pack. Since they were ten years old, there’s a bit of a question mark hovering over them. A battery pack that simply wires them in series risks over-charging or over-discharging the weakest cell. This abuse of lithium-ion cells usually ends in a fire.

I searched for a battery management circuit board to help me avoid setting my projects on fire. I settled on this item which is built around the Seiko Instruments’ S-8254A IC. This circuit board will monitor individual cells. If any of the voltage levels exceed safe limits for lithium-ion cells during either charging of discharging, the chip will disconnect the whole pack.

Once everything was connected according to instructions, I have a battery pack that I can use with much higher confidence.

BatteryManager

Using my Astro-Flight power meter, I put this battery pack through a full charge and discharge cycle. Something I was squeamish to do before the battery protection board. Upon completion of the cycle, the power meter counted 1.65 amp-hours. The text printed on the cells say LGDA2E18650, which had a nominal 2.25 amp-hour capacity when new. Ten years old and 73% of nominal capacity is not bad, and perfectly usable for a wide range of future projects.

Powering the Raspberry Pi 3 With MP1584 Voltage Step-Down Converter

The Raspberry Pi 3 is a very impressive piece of hardware for the price, but it has its flaws. One challenge is supplying power to a Pi 3. Like all the Pi boards, power is supplied via a standard micro USB plug. This implies the Pi only needs USB level power with its specified maximum of 0.5 amp @ 5 volts = 2.5 watts. In reality, this USB port is abused beyond the specified range. The Raspberry Pi foundation recommends the power supply for a Pi 3 should supply up to 2.5 amp @ 5 volt = 12.5 watts. Five times the USB specification maximum.

None of the USB power sources I already had could handle this workload. I originally had ideas about running a Pi 3 off of a portable USB charger, but that failed under the vastly greater power draw. I went looking online for solutions.

I needed an efficient DC to DC voltage regulator that can handle the maximum power draw of a Raspberry Pi 3 without consuming a lot of power itself. Since the voltage of a battery changes as it drains, the converter needs to handle a range of input voltages while holding the output voltage steady.

The MP1584 chip from Monolithic Power Systems fit the bill, but I didn’t want to deal with a tiny surface mount IC, nor do I have the skill to design the supporting circuit required. Consulting with a few electronics hardware hobbyists, I got the recommendation to take the reference design out of the datasheet and build that.

And then, an even better recommendation: If it’s a popular chip, and its reference design is good enough, somebody would have mass-produced it and put it on Amazon. And indeed, they have. A lot of vendors, in fact, from all around the world.

I scrolled through a few of the listings but didn’t really have a good feel on how to judge one vendor against another. So I took the easy way out: I clicked on the “Amazon’s Choice” link to this offering.

Once the module arrived, I soldered battery connectors to the input and a micro USB plug to the output. I adjusted the output voltage to 5 volts, and connected everything to power up my Raspberry Pi 3.

PiVoltage

So far it has worked very well. The Raspberry Pi 3 stayed running through tasks that demanded extra power, that would previously trigger a low-power brownout with my existing USB power sources. The output voltage held steady as the battery drained.

Functional, inexpensive, and I didn’t even have to deal with surface mount components! This was a win.