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.


Disassemble Monoprice Maker Ultimate (Wanhao Duplicator 6) Failed Relay

This is the main 24V relay on the control board of my Monoprice Maker Ultimate 3D printer, which is a rebadged and lightly modified variant of Wanhao Duplicator 6. An earlier blog post figured out why it died. (Short summary: the printer design drove this relay beyond its rated limit of 10A @ 24V.) Today let’s look closer at how it died.

There were clear visual indication of relay failure in the form of a heat-distorted casing with a hole melted into it.

Relay 10 - ClosedThere were no fasteners to release so the case had to be cut free from the base. Once the case was removed, we could see the guts of the relay.

Relay 20 - OpenLooking at the inside of the just-removed case, we can see a lot of heat damage. Black char marks the hottest areas, and discolored white marked the rest.

Relay 40 - Charred CaseIt’s a fairly straightforward relay, with the coil actuating an armature moving between contacts on either the plate above or below it. The armature+contact area is immediately behind the blacked charred bits of the case. And looking at the armature and contacts themselves, we see the relay died an unhappy death.

Relay 30 - Distorted ContactEverything in the contact area is distorted and/or charred. There is a black plastic-feeling piece holding everything in position relative to each other, and it could no longer do its job with heat distorting it and moved things out of alignment. Between the armature and the bottom contact is a blob of melted something that looks vaguely like solder. The bits of blue visible are parts of the blue casing that has melted onto this assembly. While the top contact looks OK in this picture, the side facing the armature is just as blackened and charred as the visible face of the bottom contact. The armature itself is barely visible here but it is actually discolored and distorted near the contacts.

From the Facebook user’s group, I’ve learned more recent revisions of the printer used a relay from the SRU product line to replace this SRD unit. I’m still trying to find a data sheet for the newer relay. I would hope that it is a drop-in replacement rated for at least 15A @ 24V, preferably 20A. And hopefully it would not die like this SRD-05VDC-SL-C relay did.

Disassemble Broken Garbage Disposal

A few weeks ago something under my kitchen sink started leaking water. I had hoped it was a simple plumbing failure that would be easy to fix. Perhaps a pipe has come loose or cracked a seal? Sadly this was not the case. Water was dripping off the bottom of the garbage disposal and its exterior was dry all around: Water was flowing through the interior of the garbage disposal which meant its useful service life has come to an end.

Before I dispose of the disposal, I wanted to cut it open to see exactly what failed. I guessed that a water seal has failed around the main motor shaft, and wanted to see if my guess was correct. But first, it was sent to sit in the garage and dry off.

Disposal 10 - StartLooking around the perimeter for fasteners, the four rods immediately stood out. They are spread around the perimeter, and almost the entire height of the disposal. I tried the easy thing first but they refused to budge with my flat-head screwdriver. So out came the angle grinder with the cutting wheel, which quickly cut the exposed shaft.

Disposal 15 - Severed rodUnfortunately that did not allow the top part to come free. Something else was holding it together. Whether it is a mechanism I don’t understand or corrosion I could not tell. But there were no other obvious fasteners to release on the top side, nor is there a convenient point to start prying.

So I started looking around the bottom end of the disposal, where there was a window cut into the bottom for wiring to enter the device. That allowed me to look inside to scout out where I could best use my cutting wheel to cut the bottom free.

Disposal 20 - Bottom openedOnce the bottom was cut free, I had a better view to find next best place to cut the stator free. When I pulled the stator off, I was very surprised to feel the rotor flex along with the stator because I had expected it to stay with the rest of the grinder.

Disposal 30 - PerforationThe source of the problem became clear once the stator came off: the metal plate separating the electrical motor from the grinder has been severely weakened by corrosion. I’m sure there were only a few (or maybe only one) hole when I pulled this from the sink, but the whole plate was corrosion weakened so it fell apart when I pulled the stator off the bottom.


Hologram Working to Make Cellular Data Easy

One of the sponsors at Hackaday Superconference 2017 is Hologram.io. In the attendee bag I saw a sticker with their name and logo. It was just one of many names and logo stickers in the bag so it didn’t make much of an impression beyond “I saw it”. The name “Hologram” made me think they were some sort of video or image related system, possibly VR. But when I dug deeper I found a SIM card with the company name and logo on it.

Hologram SIM

Well, now, this is different. Since video and VR are very data-intensive services, I doubt my initial guess was right. So they have something to do with the cellular network, but I had a badge to hack and thought I’d get more information later.

As it turned out, I didn’t have to go looking for more information, they came to me. Specifically two people wearing T-shirts with the Hologram logo were walking through the badge hacking area and wanted to know more about my Luggable PC. I paused my project to answer their questions and generally chat to see what people are interested in. (A big part of the fun of hanging around supercon.) I asked about their company and got the quick sales pitch: they make it easy to use cellular data.

Their SIM is just the starting point. It allows access to cellular data worldwide without having to worry about dealing with cellular carriers. Hologram takes care of that. To help curious experimenters get started, their entry-level “Developer” plan is free for the first megabyte of data in the month. Additional data would be $0.60/mb which is not the cheapest rate, but if only a few megabytes a month are needed, it should still end up cheaper than the monthly fee charged by every other carrier.

That sounds great, but they go further: Hologram Nova is a USB device that acts as a cellular data modem and can be plugged into a Raspberry Pi, or a Beaglebone, basically any computer running Linux to give it cellular data connectivity.

What if a Linux computer is overkill for the task at hand? What about projects that could be handled by something simpler like an Arduino? They’ve got that covered, too. Their Hologram Dash is a board with self-contained cellular hardware and a CPU that can be programmed with the Arduino IDE. No computer necessary.

Now I’m impressed. I’ve had project ideas that would send data over the cellular network, but they were sitting in the low-priority stack because I didn’t feel motivated enough to deal with all the overhead of using cellular data. Now I know I could pay Hologram to deal with the ugly parts and focus on my idea.

I hadn’t heard of the name before Supercon, and now I’m contemplating projects that would use their service. Their sponsorship outreach effort is a success here.

TI eZ430-Chronos and ISM Bands for RF Projects

An event like Hackaday Superconference 2017 is supported by many sponsors that want to reach that audience. An important part of the outreach is the bag of goodies handed out to conference attendees. One item was from Texas Instruments, offering a discount for the “eZ430-Chronos wireless development tool in a watch” which caught my interest.

Recent news in smart watches are dominated by Apple and Google. Very powerful but at a price point I find unacceptable. So while I’m intrigued by the idea of a wrist computer that I could write code for, I’m waiting for the market to mature and the price to drop.

Photo by Texas Instruments

It never occurred to me that there might be smart watch platforms that offer less power and capability, at a much lower price. If I had gone looking, maybe I would have found the TI Chronos watch earlier. A web search indicated it is about 7 years old so hardly cutting edge, but it is a wristwatch I could program, for around the same money as a non-programmable Casio watch from Target. The development kit also includes two USB devices: one is a programmer to deploy code to the watch, and the other lets software running on a PC to communicate with software on the watch via RF.

Following the instruction to search for “Chronos” on the store site, I got two results: eZ430-Chronos-868 and eZ430-Chronos-915. What distinguishes the -868 from the -915? I went looking for data sheets and other documentation to help me choose between them. But they all assumed the reader already knew which they’d want! It turns out this is an instance of a complete beginner tripped up by basic knowledge in the field. These numbers indicate the RF frequency the device operates on: 868 MHz vs. 915MHz.

These are frequencies of the ISM (Industrial, Scientific, Medical) radio bands, open frequency range that people can use with minimal regulatory requirements. People who have worked with ISM RF would have recognized 868 MHz as the ISM band common in Europe and 915 MHz for North America.

Well, we’re all beginners at some point. At least now I know.

Texas Instruments has a whole set of products for people who want to build RF solutions in the ISM radio band under the SimpliciTI brand. I like the fact that these hardware components are available, but I’m less thrilled with the fact the software development is based on tools by IAR Systems. I’m barely a beginner on Microchip’s MPLAB X, I really don’t want to learn another development stack right now.

I already have a set of things I want to gain proficiency on and have to choose where to spend my time. So as interesting as the TI smart watch development platform is, I’m going to have to set it aside as a distraction.

Sorry, TI!

Supercon 2017 Fun: Other People’s Projects

The Hackaday Superconference 2017 was full of people who have a long list of project ideas. And it is also a venue where it’s easy to chat people up and ask about their projects.

Here are some highlights from people I had a chance to talk to:

Yesterday’s post mentioned Ariane Nazemi’s Compaq Portable, the original luggable PC. While he is very obviously skilled at keeping old PC running, he also does some pretty cool modern stuff. The talk was about mechanical keyboards and his Dark Matter keyboard in particular.

Photo from Atom Computer web site’s Project Dark Matter page.

I was quite encouraged to learn that making my own custom mechanical keyboards wouldn’t be as crazy as I thought they might be. I’m rather particular about the feel of my keyboards, and the encroachment of cheap membrane keyboards meant I had to pay more and more for the mechanical keyboards with the feel I like. I’m now well into the gamer keyboards of the ~$100 range. Which, according to Ari, is to the point where I might as well start building my own. I’ll give it serious consideration.


I had the chance to chat with Sarah Petkus after her talk about her robotics projects, looking at robots from a refreshingly different perspective than most robot tinkerers I’ve met. Her projects are “personally expressive”, more works of art than functional tool. But they’re not just static sculptures! The projects are still real machines built from the same mechanical principles I’m familiar with, but they were born out of very different motivation.

I have not considered robots from her world view, and it was mind-opening to try to see and think about robots in a different way.

And it was a pleasure to meet Noodle in person.

Photo by Twitter @cameronjblocker

Sarah said Noodle doesn’t walk very well just yet, and there are a lot of challenges to solve on the way to get there. I have ambition to know about control systems for leg-walking robots, but I’m not there now. Perhaps, if I ever get there, I can help her teach Noodle to walk. (Or better yet, help Noodle learn to walk.)

I was impressed by the Tomu project: an ARM microprocessor that fits mostly in a USB port and costs roughly $10. It is in the very early stage of development and like almost all open source projects, could use the help of more people. The creator was at Supercon to spread the word. As an incentive to join in the effort, people who do something useful and submit a pull request on Github will receive a unit. I’ll look into this in more detail later.

The creator of OpenMV was walking around and showing off units and giving demos. This project is at a much more advanced stage than Tomu was. It’s a product versus a project getting off the ground. As a result the demo is less a recruitment for the effort and more of a sales pitch. Still, it looks pretty cool and I’m definitely interested in machine vision. Once I learn enough about vision to understand what OpenMV can and can’t do for me, I’ll evaluate if I’m interested in buying.

Supercon 2017 Fun: The Original Luggable PC

I named my Luggable PC project after the original IBM PC clone by Compaq. The Compaq Portable was the computer that started the PC clone market that is still going strong today. It picked up the nickname “luggable PC’ because it was roughly the size and weight of a sewing machine. I’ve seen pictures in books and on web sites, and occasionally I see a unit on display in a museum somewhere. I never expected to see and touch a running unit.

So I was pleasantly surprised (and amazed!) to see one at Hackaday Superconference 2017. It was brought in by Ariane Nazemi, who gave a talk about mechanical keyboards and brought the Compaq as one of his visual aids showing old-school mechanical keyboards. Chatting with Ari I learned one of his hobbies is to restore old computers to running condition. So the original luggable was not just a demonstration piece, it was an actual functional computer.

One of the optional equipment available for the Compaq Portable was a Computer Graphics Adapter. The CGA resolution of 320×200 is has long since been surpassed by modern equipment. But it isn’t very far off from the conference badge camera’s resolution of 128 x 128. And that’s probably why Ari worked to incorporate the Compaq into his badge project. I didn’t want to bother him while he’s focused on getting it to work, but I did ask to take a picture of my Luggable PC sitting next to the original while he worked.


I had looked forward to his project presentation at the end of the conference, but I missed it because I had to take care of some administrative tasks. Alas.

It was great to have these two sit side-by-side and see over thirty years of progress in PC hardware evolution.

(Cross-posted to Hackaday.io)

Supercon 2017 Fun: Big Screen + Little Screen

I brought my Luggable PC Mark II (Rev B) to the Hackaday Superconference 2017. Its primary purpose was to be my development workstation as I dug into the source code for camera badge hacking. Its secondary purpose was to serve as conversation ice-breaker since the Supercon crowd includes the kind of people who would appreciate it. It accomplished its mission on both fronts!

One fun experience that came out of the weekend was sitting down in the badge hacking area next to the person behind the PaperBack project. He thought it was hilarious that I had the biggest screen on the table and his was the smallest. One discussion led to another and we decided it would be fun to have my computer simultaneously drive its big 24″ screen and his 6″ PaperBack screen.

We had to borrow a DVI to VGA connection from another helpful person in the badge hacking area, and there were some further fiddling with wiring connectors and display settings. (Including several reboots between Ubuntu and Windows since they each provide different ways to customize display parameters.) But eventually we got my Luggable PC to talk to his PaperBack as an external display.

PaperBack closeup

I put our respective Hackaday.io project pages on each of the displays. His PaperBack showing his project page, and my Luggable PC screen showing its own project page.

PaperBack and LugPCmkII

This was a completely random project done mostly just to see if it could be done. Exactly the kind of curious exploratory spirit that was pervasive throughout the conference.

(Cross-posted to Hackaday.io)

Supercon 2017 Badge Film “In the Back Alley”

My Superconference 2017 camera badge project concludes with the 1-minute short “In the Back Alley of Spercon.” I entered it into the short film festival and was ecstatic to have been selected as the winning film!

I recorded a bunch of footage during the day on Saturday, but once the sun went down the camera could no longer record usable footage. So I switched efforts to putting together a presentation of what I’ve recorded. Since the camera badge has no audio capabilities – no microphone nor speaker – it was going to be a silent film by necessity. I followed precedence for silent films, using the text capabilities of the camera badge app framework to put up static text which give context to the moving pictures.

I started with the ambition of writing a short film editing app on the phone, and quickly decided that would take more time than I had. I switched to hard-coding the sequence of text and videos into a single app that I could run on the camera badge. You can still see my original intent in the filename “avitrim.”

Once running, I had something I could show to other people. Friendly curious people had asked about my project in progress Friday and Saturday, and now I could press “Go” to show them the results. Unfortunately that wouldn’t work for the film festival, where they intend to put it up on the big screen. I talked to Hackaday Mike and he suggested I record the badge app in action and put it up on YouTube.

I tried a few different cameras and they all exhibited problems trying to record the footage playing on the OLED screen. Blooming, flickering, and loss of color saturation to various degrees that I struggle to correct with camera settings. The least-bad version came from my cell phone’s camera so that’s the one I uploaded to YouTube.

Playing the YouTube clip on my TV indicated the video was good enough, but the audio was not. I held my breath during the recording so people wouldn’t have to hear my breathing, but the microphone picked up other background sounds. To cover up this annoyance, I went to the YouTube royalty-free music library and picked out a music clip that’s roughly a minute long. It’s not exactly my favorite song but it’s far better than random background noises.

(The project described in this post is documented on Hackaday.io and the source code is publicly available on Github.)

Supercon 2017 Badge – Now Recording Time Lapse Video

I arrived at the Supercon badge hacking area Saturday morning and immediately got to work. I picked up where I left off – looking for the place in the code where I can change the frame playback rate to be higher than the 1fps capture rate. Once done, a test run confirmed that the automatic power-off will shut down the camera during a time-lapse so I added a line to reset the powerdowntimer counter during a time-lapse capture.

According to the plan, I should now take what I’ve learned and write a dedicated time-lapse capture app. But as I’m successfully recording time-lapse footage, the motivation to do has dropped drastically. I’d rather walk around and try to record fun footage around the conference. So with that, I’ve abandoned the previously planned “phase 2” and “phase 3”. I’m now more interested in utilizing my time-lapse video capability instead of continuing to invest time refining it. Time is an extremely limited resource on this weekend project!

The badge is not taking full advantage of the sensor, so the lack of resolution and crispness is not a surprise. But since we’re getting so little out of the sensor, we can use all the help we can get. This is why I was both excited and felt sheepish when I realized that I had been filming for half the day with the protective plastic still covering the lens. Removing it didn’t make as much of a difference as I had hoped but hey, every bit counts.

Increase Resolution

Once the sun went down, I stopped shooting footage. There is not enough low-light capability to obtain useful video. Returning to the computer, I started brainstorming the best way to present what I’ve captured. I started trying to write a rudimentary video editor (just to trim frames before and after the parts I wanted to keep) but I had no luck navigating the AVI data structure.

With the ever-ticking clock, I changed tactic: instead of an editor, I’m going to write an app that is hard-coded to play specific video files in order, and a few blocks of text in between. Just like silent films of old. I’m confident this less-ambitious application could be finished by Sunday afternoon.

(The software project discussed in this post is publicly available on Github.)

Supercon 2017 Badge – Software Orientation

With the focus on getting the panning base up and running before Supercon weekend, I haven’t spent as much time as I had wanted on software side. The camera badge source code was released a few weeks ago and were constantly getting updated as the weekend got closer. (Differences between the prototype and production boards, plus other fixes.) I had wanted to keep up to date with the software but my project investigation and the pan base took up all the time I had to spend on this project.

As soon as I had two bases up and running, I went to the early check-in and badge hacking session Friday afternoon. It started at noon and I thought showing up at 3pm would still allow some time to work. I did get some time to work, but I also found that plenty of people arrived before I did and there were no table space remaining.


Oh well. At least I have the badge in hand now. The first thing I did was to perform a quick test. The camera badge came with a video record option, which I intend to dissect for my time-lapse video app. But until then, I could do a real-time video captured while panning on my base to show the basic concept works.

Another bonus of getting the badge in hand is that I was immediately more productive learning the code. The source code was informative, the documentation online was helpful, but my brain needed the anchor of actually seeing the code running. It’s was a great help to play with a menu with my hands, then go back to read the code drawing that menu. The code made a lot more sense after seeing it in action.

I dove into the basic app support framework, and after I understood the basic structure, switched to analyzing the camera app. By the end of the evening I understood enough to know how to modify the camera app to restrict the video recording frame rate to one frame per second. This artificially limited rate much more closely resembles what I would want to do in my time lapse app.

Unfortunately the playback frame rate is “accurate” in the sense it tries to play one frame per second. I have more learning ahead of me before I start writing my own time-lapse app. As a short term workaround, just to see things work with what I have, I copied the file to my computer and used ffmpeg to convert the frame rate of my end-of-evening milestone video.

(The project discussed in this blog post is publicly available on Github)

Supercon 2017 Badge – Pan Base is Turning

After the mechanical bits were assembled yesterday, I worked on the simple PIC program I’d need to drive it. This involved refining the exploratory code into something that resembles an usable device. Things like no longer running on a fixed program but read the potentiometer I wired into the circuit to dictate motor control. Fortunately most of the hard work is done by MPLAB X boilerplate code, I only had to weak a few things here and there to end up with the functionality I want.

(The MPLAB X project file is publicly available on Github.)

I also 3D-printed the remaining layers of the enclosure – the battery tray, a minimalist lid, and the little flexible clips that hold them all together. The layers are an extremely tight fit because the wiring plugs were longer than I expected. Right now they’re pressed against the bottom of the battery tray which is not good for connector health. I’ll increase the height for the next iteration to give everything more headroom.

Pan Base Assembled

The good news is that everything runs. The bad news is that it doesn’t run very well. I dug a digital camera with a built-in time-lapse mode, set it on top of the base, and shot a few clips. The jittery motion of this cheap DIY pan base is very clearly visible in the resulting video. There’s a reason professional photography pan heads cost a lot of money – they have much smoother bearings and better motors for fine control.

Since the conference kicks off tomorrow, I’m going keep forging ahead with what I have. No time to find better motors or bearings. There are a few issues that I might be able to fix in the PIC software, but the sticky jittery motion from the motor and bearing isn’t something I expect to be able to fix in code.

Well, I can hope the jittery motion is not visible in the default 128×96 resolution of the camera!

Supercon 2017 Badge – Pan Base Mechanical Assembly

Hackaday Superconference 2017 kicks off tomorrow! Clock is ticking for me to complete my preparation work. My 3D printer is hard at work churning out iterations of my motorized base for panning photo/video. I had originally intended to drive the whole works with my three-cell lithium lion battery pack built from cells salvaged from a Dell laptop battery pack. The battery power will go straight to the power coils of the stepper motor and a voltage step-down converter will reduce the voltage for the ULN2003 chip driving the steppers and my PIC16F18345 running a program to run the works.

The stepper motor is designed for nominal operating voltage of 5 volts, but the actual limit on stepper motor operation is the amperage running through its coils. I thought I could drive the coils with pulse-width modulation and keep the power under control. The batteries power is about 12 volts, so a 40% duty cycle should be a good approximation.

But real life got in the way of my plan with these unipolar stepper motors. As the coils are energized and de-energized in the PWM cycle, magnetic field and electrical current were getting sent elsewhere in the motor in ways I didn’t understand. Causing the motor to behave erratically instead of just turning at a lower power.

If there wasn’t a looming deadline, I would hit the web searches to learn and understand what’s going on so I could fix the problem correctly. But I do have a deadline and needed a quick fix. “Just” running the motor at full power isn’t a solution. The motor could run at ~12V but it gets very hot. If I was only using the motor to turn infrequently, this might be OK. But a camera pan base is constantly turning slowly.

In order to keep the coils energized with a lower voltage, I changed the power supply to a 4-pack of NiMH AA batteries. Their nominal voltage of 4.8 is close enough for my purposes. It is smaller and lighter than the Li-Ion pack and also eliminates the need for the voltage regulator. The trade-off is a drop in power capacity… which may or may not be important. We don’t know yet. I guess I should pack a NiMH battery charger.

Once the stepper motor power was sorted out, I added a potentiometer to give manual control of rotation direction and speed. Once I finish 3D printing a case around this, I will have a minimal implementation of the mechanical base.

Pan Base Mechanicals

Supercon 2017 Badge – Time Lapse Pan Base

It’s Wednesday and a concrete plan is way overdue if I want to make a project for Supercon 2017 this coming weekend. The badge is a little digital camera so I started thinking about camera accessories that I could build. Since I won’t have the camera itself until Friday, ideally the accessory has some baseline functionality that I can build before I get the badge itself.

There are tons of accessories for photography, but when the goal is to find something both electronic and mechanical, that narrows down the list. Browsing through a photography catalog, I considered a few accessories and settled down on one thing: a pan base. Useful for taking panoramic photos or time-lapse videos, it boils down to a little mechanical platform to turn the camera at a controlled rate as it does its thing.

And most importantly: I can build something basic by this weekend and build upon it through the weekend as time and progress allows. This incremental development means if I don’t get to them all, I’ll still have something neat to show off. This minimizes the risk I’ll get to the end of the weekend and have absolutely nothing to show.

Phase 1: Base Mechnicals

Build the electrical and mechanical parts of the pan base. Digging through the boxes of parts on hand, I think I have everything I need to build the base itself: I have a small slow stepper motor, an associated controller board, a thrust bearing for everything to spin on, and batteries. A PIC with a simple program should be enough to drive the controller board for a slow photography panning motion.

Pan base parts

Hopefully I can get it all put together by Friday, ideally with manual control so it can run by itself.

If this is all I could do, it should be enough to put the camera badge on top and turn on video recording mode for a video that pans across the field of view.

Phase 2: Camera Time-Lapse Mode

If I get the mechanical base working on its own before Friday, it’ll give me time to dive into writing the software for the camera. I’ll need to understand the sample code enough to know what pieces I need to copy/paste to build a time-lapse video app for the camera. Hopefully it’s as simple as taking the video recording application and slowing the frame-rate down.

Once I know the code necessary to gather images and put them in a sequence, I’ll worry about creating the UI to control things like time-lapse speed.

If this is all I could do, it’ll be enough to create cool time-lapse panning video clips to enter into the video contest.

Phase 3: Camera+Base Integration

This is the stretch goal in case everything above was easy and smooth (ha!): Integrate the camera and the base so the time-lapse application controls the panning base. The UI will allow control of not only the frame rate, but also the rotation speed as the time-lapse runs. The camera badge already has a simple API for I2C communication, so I’ll probably have to write code to talk to the PIC controlling the stepper motor via I2C. Either that, or have the PIC32 on board the camera talk to the stepper motor board directly. Whichever is easiest to get running by the end of the weekend.

If I can get this far, I can feel proud at what I have accomplished over Supercon 2017.

Let’s see how far I get. It’s time to get to work!


Supercon 2017 Badge – Pivot for Project Risk Reduction

The calendar does not lie – it is now Tuesday and Superconference starts Friday. After a day of playing with mTouch on the Curiosity board, I’m no closer to a project that captures my fancy. Time to take off the curious explorer hat and put on the project manager hat. (Assuming that it’s not already too late to do so…)

The fact is that I won’t have the camera badge hardware in my hands until Friday. Despite all the help Microchip tries to give us with libraries for doing mTouch, capacitive touch is finicky and will require tuning. On top of having to get oriented with the rest of the hardware. On top of the rest of the conference going on over the weekend. I don’t want to be so consumed by the project that I miss out on interesting things happening.

I’m sure there are hardware hacker types who has accumulated enough skills and experience to put together something in a short time. I have ambition to build up to that skill level, but I have to accept the fact that I’m not there today. And I’m probably not going to get there by the end of the week. Time to change the focus to something more predictable and less risky for the sake of getting something up and running this weekend rather than risk having nothing at all by the end of the weekend.

The new ideals:

  • External components interface with the camera badge in some way to add to the camera badge functionality.
  • External components do not require the camera badge itself for its basic functions, so I can start building it and debugging it before I get the badge Friday.
  • Integration with camera badge to be kept as simple as possible.
  • Integration should not be “none” – it’d be pointless to build something that works just as well without the camera badge.
  • Even if all integration efforts fail (at worst, integration is “none”) I want to have enough to demo the idea even if it doesn’t work.

The above ideas led me to think about building an electro-mechanical camera accessory. The gears in the brain continue turning…. but soon physical gears will turn, too.


Microchip “Curiosity” Development Board and its Zero Ohm Resistors

When I purchased my batch of PIC16F18345 chips, Microchip offered 20% discount off standard price for its corresponding Curiosity development board (DM164137). I thought it might be interesting and added it to my order, but I hadn’t pulled it out of its packaging until today.

Today’s motivation is the mTouch button built onto the board. As part of my investigation into projects I might tackle with the Hackaday Superconference 2017 camera badge, I found that the capacitive touch capabilities of the MCU is unused and thought it might be interesting to tie it into the rest of the camera badge. Before I try to fabricate my own touch sensors, I thought it’d be a good idea to orient myself with an existing mTouch implementation. Enter the Curiosity board.

Looking over the board itself and the schematics on the user’s guide, I noticed a generous scattering of zero ohm surface-mount resistors. If I had seen zero ohm resistors in isolation, I would have been completely mystified. Many electronics beginner like myself see a zero ohm resistors as something that does nothing, take up space, and there’s no point. For those beginners, a web search would have led them to this StackExchange thread, possibly the Wikipedia article, or maybe the Hackaday post.

Curiosity Zero OhmsBut I was not introduced to them in isolation – I saw them on the Curiosity board and in this context their purpose was immediately obvious: a link between pins on the PIC socket and the peripheral options built on that board. If I wanted to change which pins connected to which peripherals, I would not have to cut traces on the circuit board, I just had to un-solder the zero ohm resistor. Then I can change the connection on the board by soldering to the empty through-holes placed on the PCB for that purpose.

This was an illuminating “Oh that makes sense!” introduction to zero ohm resistors.

Maytag Top Load Washer (LAT8826AAM) Lid Switch + Fuse Module

Today’s distraction came courtesy of aging appliance. Specifically, the 20+ years-old Maytag top-loading clothes washer stopped working this morning. It has just started doing a load of heavy laundry that was out of balance and shut down when the tub started shaking. This itself has occurred before, we just had to redistribute the load and restart. Except this time pulling the knob failed to restart the machine. There was no sign of life, not even the power “ON” light.

Given that the machine acted as if it had no power, I first checked the house circuit breaker, verified the machine was plugged in, the easy things. After the simple checks were out-of-the-way, I started looking for a circuit breaker or a fuse built into the machine. A web search turned up several mentions of the lid switch which I initially ignored. During normal operation, an open lid would prevent the wash cycle from starting, but the power “ON” light would still be on. Since that light was dark, I had decided the lid switch couldn’t have been the problem.

That was the wrong decision.

The lid switch is actually a module that included the switch and a fuse. This fact didn’t sink in until I found this page, which described how to test continuity with a multimeter and cautioning that improper switch module installation may blow the fuse inside the module.

I removed the lid switch module from my washing machine, tested with my multimeter, and confirmed it was not behaving as it should. I am annoyed that Maytag did not design the fuse to be easily replaced. The whole module had to be replaced as a single unit: it was held together by fasteners that were clearly not intended to be removed. While I had the tools to remove them, it is a permanent removal.

Maytag Lid Switch

Once opened, the fuse was quickly found. The red arrow in the picture below points to a black piece (now broken in two pieces) that looks and feels like plastic but is electrically conductive.

When intact, this piece of fuse material holds the “LINE” terminal always in contact with the “MACHINE” terminal. When the washer lid is open, there is continuity between “NEUT”(RAL) to “MOTOR”. When the washer lid is closed, “NEUT” loses its connection to all other terminals, but “MOTOR” is put in contact with “LINE” and “MACHINE”.

The narrow neck of the fuse material is now broken, which also broke the usually always-on contact between “LINE” and “MACHINE”. When the washer lid is open, none of the terminals have continuity with any other terminal. When the lid is closed, “MACHINE” is in contact with “MOTOR” but that doesn’t do any good as “LINE” is disconnected.

Maytag Lid Switch Fuse

Now that I know how the module incorporates a fuse in addition to the lid switch, it was easy to rig up a quick test to see if the rest of the machine works. A successful test gives me the confidence a replacement module will bring the washing machine back up and running safely.

The next question is why the black piece broke. Was it from old age (innocent) or because there was a problem causing excessive amperage flow (worrisome)? The multimeter found no obvious short on the washing machine. And since the machine has been working for more than two decades, age is a plausible explanation. I’ll try the replacement module first. If the fuse blows again, I’ll have to dig deeper.


SevenStock 20

Today was SevenStock 20 and I attended with my RX-8 in her BB-8 Halloween costume. Last year I attended SevenStock with the costume only partially completed. This year it is complete but a little faded from running around over the past year under SoCal sunshine. It was still plenty distinctive in the row of RX-8 lined up in the show & display area. Many people took pictures, some even took me up on my hint and posted on Instagram tagged with #rxbb8.

Out of all the cars on display, the one that stood out to me was ironically not a rotary-powered vehicle at all. It was a Mazda R360, Mazda’s first car built in 1960. By modern standards an adorable tiny little thing. It was on display at the Mazda corporate area along with other Mazda vehicle currently on the market. Which meant the little 1960 Mazda was utterly dwarfed by the modern Mazda SUVs on display.

Mazda R360 Next To Current Mazda SUVs

There were many powerful speed machines on display, but I kept coming back to admire the little R360 that can barely reach highway speed. There are four seats in the car but I don’t see how four adults can fit in this little box. It looked closer in size to a kid’s Power Wheels car!

SevenStock takes place on the infield of the Auto Club Speedway and the track itself was open during the event for people who paid a fee and can pass safety inspection. There was a sizable contingent who love the idea of driving out on the oval but for one reason or another passed on the high-speed track time.

This year the organizers tried an experiment: a “parade lap” to get a taste of driving on a banked oval via a bit of token track time. The thundering herd was led by the trio of historical rotary-power race cars brought by Mazda, and we stopped a few times on track for the scattered pack to organize. Here’s a picture taken during one of the on-track stops.

Rotaries On Track

The price of admission for the “parade lap” was $15, and I thought it was well worth it for the novelty value of taking my car on a real high-speed track. Even if we were only going at city-street speeds.

Reading the PIC32MX1XX Datasheet As A PIC16F18345 User

A review of the Hackaday Superconference 2017 “camera badge” hardware provided adequate orientation but no lightning strike of project inspiration. Today I did find the project page for last year’s Supercon badge as well as a summary page of some things people have created with the 2016 badge. People have done some really cool things with that badge serving as foundation. I’m feeling intimidated but also determined to keep trying to see what I can devise.

Today’s tactic: Dive into the data sheet for the Microchip control unit at the heart of the 2017 badge, the PIC32MX170F256D. No matter what else happens, it would be good to have an overview of what the chip can and can’t do. I was also hoping that a review of the data sheet will unveil something about the chip that would inspire a project. Since I’ve already read the PIC16F18345 data sheet back-to-back, I hoped the familiarity with Microchip conventions will give me a head start.

The first surprise was the size (length) of the data sheet. Only 344 pages when the much simpler PIC16F18345 chip had a 491 page document. It didn’t take long for me to figure out why, since every feature section started the same way: a disclaimer that the data sheet was only the summary and tells me I need to do more reading if I want the details.


Well, that explains the size! For my purposes today, it’s no big deal. In fact it is helpful since the summaries mean I don’t have to press “Page Down” as often.

There are some comfortable commonality with the PIC16F18345 I’m familiar with: Timers and comparators. Digital I/O and analog input (ADC.) Communication via SPI, I2C, UART. And all these peripheral modules are mapped into a memory space so everything is accessed via memory reads and writes. And finally: a big focus on power management.

There are some differences that I might miss in the PIC32MX1XX:

  • PWM seems to have gone missing, unless there is a much more advanced component that can serve similar purposes but I don’t recognize it as such.
  • I/O pins are much less powerful. The PIC16F can handle up to 50mA on any single I/O pin and up to 250mA total. The PIC32MX can only handle 15mA per pin with 200mA total.
  • Narrower voltage range: Unlike the super flexible and relaxed PIC16F that is happy to run with anything from 2.3V to 5.5V, the PIC32MX prefers to stay within 2.3V to 3.6V. The maximum is listed as 4.0V, so it might be dicey to run this thing on a single rechargeable lithium cell – the nominal voltage is 3.7V but a fully charged cell might be up to 4.2V.

The PIC32MX uses a different instruction set (MIPS32 M4K) and that’s no surprise. I expect to be mostly isolated from this fact by writing in C and letting the XC compiler worry about the instruction set. The PIC32MX also requires more support circuitry. Whereas the PIC16F can literally connect directly to a battery and it’ll start running. Again I’m mostly isolated in this case because the camera badge is already built for me and all the support components are already on board.

And now, on to the things that might be interesting. I started with the title description: “32-bit Microcontrollers (up to 256 KB Flash and 64 KB SRAM) with Audio and Graphics Interfaces, USB, and Advanced Analog

The first thing to catch my eye: USB, backed by this promising-sounding bullet point on the cover page: “USB 2.0-compliant Full-speed OTG controller“. USB OTG would let us plug-in USB peripherals and greatly expand the possibilities of what we can do. Alas, my hopes were dashed when page 2 clarified that USB OTG is only on the PIC32MX2XX series and absent on the PIC32MX1XX we have on the camera badge. So that’s out.

The “Advanced Analog Features” bullet items seem to mostly center around support for capacitive touch sensing, mostly around their “mTouch” design. Since their reference implementation involves copper traces and plates on a printed circuit board, that won’t be directly applicable to me. But perhaps this type of support circuitry can be hacked into something fun.

I have yet to explore the world of audio electronics, so sadly the audio interface features are mostly gibberish to me. I had higher hopes for the “Graphics Interfaces” side of that claim and… I came up empty-handed. There’s nothing that obviously said “graphics” to me on the feature set. The closest thing I can find is the PMP (Parallel Master Port) peripheral which is good for talking to display panels, and is indeed already employed on the camera badge to drive the 128×128 OLED screen.

So in the category of “stuff that the chip can do, but isn’t already being used” the best candidate at the moment is the analog circuitry to support capacitive touch. Since I don’t have time for a OSH Park PCB, it’ll have to be something creative. Perhaps something as primitive as taping down loops of wire to cardboard or 3D-printed plastic parts.

The gears in the brain keep churning…