WiFi Christmas Tree

Based on an old IKEA JULEN I created a WiFi enabled Christmas tree!


The JULEN tree is at least 10 years old, probably older and has been sitting around in storage without seeing much use. The 10W halogen + 2 W AC motor and ancient AC/AC transformer was a major reason. By using some WS2812B pixels and a Spark Core it can now be controlled from anywhere with an Internet connection and uses at most a fifth of the power!

First look at the TinyDuino

A few days ago I finally got my TinyDuino with various shields, it took a while since I had chosen at least one shield that only recently became available. It’s one of the first projects I backed on Kickstarter actually!

This thing really is tiny! Everything so far has worked out of the box, the motor driver shield will require some soldering of pins that were included but no hurry right now. I loaded the default Arduino blink example and it worked fine, so went ahead and downloaded the examples for the LED shield and the accelerometer shield. Something weird in the LED one though, I couldn’t get it to work properly before I added some debug code. Backing out the debug code showed that doing a Serial.begin() call in setup() made it work. No clue what’s going on there, haven’t used Arduinos at all before. With that working it didn’t take many minutes before I simply had to do a little copy & paste operation to create this little demonstration:

Note that I didn’t have any CR16xx coin batteries available, but that a CR2032 fits well enough. :-)

Assembling the Crazyflie

I actually did assemble the Crazyflie the day after my last post but didn’t finish this one until now. My tweet that night summarizes it nicely:


The assembly instruction on the bitcraze wiki are pretty straightforward, at least now that they have been tweaked a bit, they were a bit more tricky when I did this. I used one of those cheap 3rd/helping hand things to make it slightly easier, but my soldering skills that are reasonably good when working with larger items and pads were definitely put to the test.

The 3rd hand helped a lot, wished the magnifying glass was better though.

The 3rd hand helped a lot, wished the magnifying glass was better though.

Using some tape to hold down the wires is definitely recommended!

Using some Scotch Magic tape is recommended if you want to keep your sanity.

Using some Scotch Magic tape is recommended if you want to keep your sanity.

After an hour or so of nerve wracking soldering of the tiny wires I was done. M3 and M4 are decent, M1 OK but M2 is very close to being bridged. Don’t want to mess with it again though since it does work.

The sad results of my soldering.

The partially sad results of my soldering.

Put propellers on, and connected the battery and charged it. Was nice to see all the motors spin as they should.

Put the propellers on and powered it up to see if everything seemed to be working.

Put the propellers on and powered it up to see if everything seemed to be working.

Afterwards I got one of my PS3 controllers connected and after some fiddling with the mappings I could fly it with some success. It sure is crazy! It will take some practice to get it fully under control, and it would be nice to fly with a full sized RC remote instead. With the centering analog sticks of a PS3 controller you only have half the travel available for the throttle which makes it quite sensitive.

Crazyflie has arrived – setting up on my Mac

For a long time I’ve followed the work of the guys at Bitcraze on the tiny quadrotor Crazyflie. I ordered it from Seeedstudio as soon as the pre-order became available and was happily surprised about the quick shipping from Hong Kong after it was finally shipped! I’ll include some photos of the kit below.

Unfortunately running the computer client needed on a Mac isn’t well documented but proved to be fairly easy (note that I haven’t flown it yet though). I already use MacPorts on my MacBook Air that runs Lion so I preferred getting all or most of the dependencies installed using it. A condensed version should be (including an optional update in the beginning):

port selfupdate
port upgrade outdated
port install libusb
port install py-pyusb-devel
port install py27-pyqt4
port install py27-pygame

I already had python27 installed, but it should get installed as one of the many dependencies regardless. I also have /opt/local/bin in my PATH and /opt/local/lib in my DYLD_LIBRARY_PATH already. This is also a good opportunity to do a “port install mercurial” so you can clone the crazyflie repos from bitbucket. After cloning crazyflie-pc-client I could then start bin/cfclient and the UI came up. It seems like the radio dongle is working but there’s no crazyflie to connect to since I haven’t gotten that far yet… Only issue right now is that the Python process uses 100% CPU continuously, I really hope that’s only a bug related to it not being connected to something. And it won’t exit properly either so I have to kill -9 it. :-)

Traceback (most recent call last):
  File "/Users/ckk/oss/crazyflie-pc-client/lib/cfclient/ui/main.py", line 410, in closeAppRequest
NameError: global name 'app' is not defined

I’ll bring out my soldering iron tomorrow to have a go at soldering the motor connections needed, meanwhile I’ve been putting the motor in the motor mounts and started looking at which propellers to use to begin with, I have plenty since I bought some extra in addition to the extra ones already in the kit. Might also print the very nice looking enclosure for the radio that’s already up on Thingiverse. If I finish the assembly tomorrow I’ll then have to start looking at getting one of my PS3 controllers connected to my MBA.

The way everything was packaged, very bare bones and not much protection for the accessories.

The way everything was packaged, very bare bones and not much protection for the accessories.

The Crazyflie box.

The Crazyflie box.

The box and the extra accessories I added to my order.

The box and the extra accessories I added to my order.

After opening the lid of the box, very nice looking!

After opening the lid of the box, very nice looking!

The USB radio dongle, antenna and one of the propellers.

The USB radio dongle, antenna and one of the propellers.

The main Crazyflie PCB/frame, one of the motors and the battery.

The main Crazyflie PCB/frame, one of the motors and the battery.

First successful prints on the Printrbot Jr

[Please read the Printrbot Jr assembly posts first for some context]

After switching to Slic3r and doing some very basic configuration it failed at slicing the Mini Mr Jaws that went really wrong before. So instead I took the very similar Mini Mr Alligator and it sliced perfectly fine. It was with both excitement and some trepidation I pressed print… But it turned out to a close a complete success, the only bad thing was that I hadn’t saved the bed dimensions correctly in the Slic3r settings so the print got placed in the uppermost quadrant of the bed. Amazed at how well it turned out given the very minimal calibration!

The next print i tried was simply doubling the size, it also turned out well after issues with the first layer not sticking. Had to switch out the tape, then it worked fine.
The Alligators!

The Alligators!

After these two successes I wanted to try something very different, and that also showed that a printer like this can’t just print smalll solid toys and similar. So I went to Thingiverse and grabbed a vase I’d liked earlier, one of the variants of the Kochflake vases. Tried different slicing settings to get rid of the top filled layer and chose a perimeter (wall thickness) of 2. This print took quite some time, almost 2 hours, and especially the height was very close to the maximum height available. The Z rods were at the end inside the top two linear bearings.

The print looks very nice. Had two issues, one was the first layer where the second half of the infill didn’t stick correctly and bunched up a bit. On the second layer that meant that the extruder nozzle bumped into them but it still went pretty good. The other problem is that you really can’t use the same (high) speed for the top layers. The instability of Jr when Z gets high means there’s plenty of layer misalignment problems for top centimeters.

I also have a very anoying and loud vibration issues with the X axis unfortunately, not sure what to do about it.

The Kochflake vase

The Kochflake vase

Closer look at the vase

Closer look at the vase

Printrbot Jr assembly part 4

After spending lots of time with other things, such as re-purposing an old Eee PC for use with the printrbot, I finally sat down with the build again.

Left to do was testing the Eee, getting the printrboard mounted and the cabling worked out as well as some initial calibration work. First of all I had another look at the Y axis, the belt really did need tightening. Just tightening it by hand again and adding a new zip tie felt like a bad idea since getting the zip tie off to tighten it every time isn’t fun, I really don’t want to damage the belt. Without anything printed to use and nothing else that could be reused in a sane way I once more turned to using filament pieces and it worked out quite well actually!

Quick and dirty filament tensioner.

Quick and dirty filament belt tensioner.

Closeup of the sharpened filament ends

Closeup of the sharpened filament ends

I’m a bit worried though since I seem to have an issue with the top Y rod being slightly longer than the other. The loose fit of the top rod in the front extrusion mount and the belt mostly pulling on the bottom part the makes the extruder tilt slightly forwards. The loose fit is my fault, it was extremely tight at first so I couldn’t get the rod in, I then sanded too much probably. Solutions such as trying to grind one rod slightly, switching rods with the the longer one at the bottom instead and possibly using epoxy to make sure they aren’t so loose are solutions I’ve contemplated. But I’m leaving it for now to see how bad it is when printing.

Then I finished the zip tying of the cables, hooked them up again to verify everything worked with the Eee (and it did, running Fedora Core 18 with pronterface) and then started to try getting the board into the base. Had to re-route some cables and redo some zip ties but finally I got it in place. And it still worked, was a bit worried. :-) Heat dissipation really won’t be good in that small unventilated space but given how small it is it’s not easy to do something about. Also not sure how hot it gets during printing.

Printrboard going in.

Printrboard going in.

Printrbot fully assembled!

Printrbot fully assembled!

Continued with lubricating the Z rod, used a liquid lubricant with PTFE, which seems to a favored method. Have some weird resonance noise during Z movement now, helps if I tap the rod. Perhaps it has slid down and is barely touching the motor shaft? Not a big problem. The wobble is under control at least.

Then I mostly followed the getting started guide and did max X and Y measurements, result was 136×120 mm but I could probably squeeze in another millimeter or two with some adjustments. Or mod the bed to stick out longer in the front, there’s lots of unused Y reach that’s not being used now. I covered the bed in masking tape, haven’t found a local source of 3M blue tape yet, the best wide masking tape I could find was yellow Tesa tape which claims it can stay on for 8 days without leaving residue. With the tape on I could perform the bed leveling, using a piece of paper. It’s not perfect, but hopefully good enough?

Continued on with feeding filament into the extruder, had to adjust the idler pressure, it was too high it seemed like, very hard to get the filament in. Then I heated up the hot end in Pronterface and extruded some plastic. Took quite a few careful extrusions of 5 mm at a time before I got a result, was a bit nervous for a while after hearing horror stories before of melted plastic filling up the extruder and making mess. But it went fine, clear strings of PLA were squeezed out of the nozzle! Time to calibrate E, which was pretty easy.

Extruded PLA when calibrating the E value.

Extruded PLA when loading the filament and calibrating the E value.

Since skeinforge is nicely packaged in Fedora Core 18 I thought it would be nice to have a go at using it instead Slic3r. So I did a rough configuration of skeinforge, had to google a lot. I know now a lot of gcode compared to before… When I thought it was fairly OK I went ahead to try to print my test subject, the Mini Mr Jaws. It did not work out very well… I thought things looked quite weird when the skirt was printed and then the craziness just continued, way too much PLA was being extruded so I aborted the print. It does look fairly promising though, if I can get the extrusion right. It seems to stick very well onto the tape.

Fail aka my first blob.

Fail aka my first blob.

By that time it was after midnight so I gave up for the day since the print takes a pretty long time (pronterface guessed 51 minutes). The next day I went to get some tools that can be useful. The IR thermometer was a lot of fun, I’ve already used it a bit in the kitchen, on members of the family, bath water etc.

Bought some more tools; micrometer, feeler gauges, spatulas, wide razor blade, IR thermometer, hobby knife set and moisture absorbers.

Bought some more tools; micrometer, feeler gauges, spatulas, wide razor blade, IR thermometer, hobby knife set and moisture absorbers.

I had another go at the skeinforge settings but have given up for now and instead packaging up the latest version of Slic3r on my main Linux box to use it instead. Hope to have a new post up with a successful print soon!

Links to the other parts of the build: part 1, part 2 and part 3

Printrbot jr assembly part 3

Time to have a go at the extruder, a little tricky since there is a good set of instructions for the wooden part of the LC extruder, but neither that or the Jr guide has any instructions for the gears, motor, hobbed bolt, the hot end itself etc. Luckily there’s nice instructions in the Printrbot Plus guide and also some in the Jr youtube video (part 5).


Extruder parts


Extruder pieces laid out as in the step-by-step guide. Note the discrepancies…

Compare the picture above with the one in the guide and you’ll see that I have missing screws (again), perhaps they were intended to be included in the printer kit, I guess there might be different revisions with/without screws for both the extruder and the different printer kits. More on this later.

It wasn’t that difficult to keep the stack of pieces aligned before trying to put the screws in, then it got much trickier. I realized that instead of hex keys, toothpicks or other weird things I had the perfect material available! I simply snipped of few pieces of my 3mm filament! You need a pair of pliers to hold the small round washers of plywood at the ends still though, otherwise they’ll just rotate with the screws.


Extruder stack with filament pieces to help with alignment.


Assembled extruder.

After the assembly I realized that two screws I had left was either enough to secure the hot end on the extruder, or to mount the extruder to the printer. I used those two 1 inch 6-32 screws to mount the hot end. Luckily I had investigated metric equivalents to 6-32 and found that M3.5 was close. Unfortunately no store that’s close had smaller than M4 but I did buy some 25 mm M4s with both regular and nylock nuts the day before. These proved to work pretty well to mount the extruder! The head of the screws are bigger so no washers were necessary, the only problem was the nuts that were smaller so I had to use pliers to hold them in. They probably weren’t necessary though, the M4 did self-tap the hole and held on nicely even without the nuts.


Testing using M4 screws to mount extruder.


Added the hot end, about to mount the extruder.

After putting in the screws that keeps the hot end in I moved on the hobbed bolt with the big gear. Geting the bolt all the way through into the big gear took a significant amount of force but it seems good now. I put it in to verify that I had a reasonable amount of pressure against it and it might even be too much, will have to see how it works in practice. When I tested on a piece of filament, turning the big gear by hand, it was pulled through very nicely and had small indentations on it after it’s encounter with the hobbed bolt! I fastened the hobbed bolt with a nylock nut, I had both available since one of them came in the printer kit bag of screws and nuts, but the regular nut did not work very well even when just turning the gear by hand. It also seems like it might be a good idea to put a washer between the gear and the bearing, seems to be a bit of friction there right now.

My small white pulley gear was way too tight, almost impossible to get on the motor shaft so I used a small needle file to make the center hole slightly bigger. Which allows it to (as recommended) self-adjust when turned with the big gear. My gears look very rough, but they seem pretty OK. When turning them by hand it feels like there is an occasional stutter though but I’m hesitant to try to randomly file away bits and see if it helps, I’d rather try to print new ones if they are a problem (unless it proves to be really bad of course).


Extruder mounted, added stepper motor and the other bits and pieces.

Then I went back to some things I postponed earlier. The Z coupler was the first. When turning the rod by hand now that the Y/Z sandwich is mounted and the nut captured the wobble no longer seemed that bad. I want to see how it works like this first before I take any further action. Next up was the Z endstop, I pulled it out, added a top nut and then did a much better rough adjustment, too at least prevent the hot end from smashing into the bed.


The Z endstop after adding a nut and adjustment.

I also took the single very long remaining 6-32 screw and a nylock nut and added them on the rear end of the Y assembly since I realized that without it being there and adjustable the extruder went well beyond the end of the bed before hitting the end stop switch. While fiddling with the end stops I had a look at the X one. Which of course had issues as well… I moved the longer 6-32 screw and its nylock nut on one of the ends of the X rods back to where I had it been originally so it hit the end stop. Not sure why I moved it before, I believe one of the pictures in the guide confused me and caused me to move it, I do remember being confused later on about having a nut sticking out where there was no reason for it and to check on it later. That’s probably why I left the screw hole by the end stop empty, then I obviously forgot about it. Tip: Have a notepad next to you while building to make note of things like this instead of relying on remembering it.

Finally it was time to do the first tests! I pulled off the lid of the base and pulled out the Z and X cables, hooked them and the rest of the cables up to the printrboard and powered it on. A green LED turned on which felt very promising. Connected the USB cable to my Macbook, launched Pronterface that I installed a few days ago and after selecting the right serial port it connected!


printrboard connected temporarily for testing, lots of cables.

Fun to play around with stepping back and forth on X, Y and Z to begin with. Once more the Z rod doesn’t seem that bad. Took forever for it go home but the end stop adjustment was pretty good, will fine-tune it when I’ve added tape to the bed and leveled it. The X one was also good but when I tried the Y home button things went bad. It moved in the wrong direction (which I hadn’t realized before) and pulled pretty hard on the belt when it got stuck. Not sure why; if it slipped, got stretched or any other reason but it’s definitely less tight now. Won’t tuch it until after an attempt to print though. I had seen people asking about motors going in the wrong direction on printrbottalk.com before so I simply did what I remembered others telling them and simply reversed the connector. Then it worked fine!

You can’t test the extruder with the hot end being cold so I chose to heat it up to 185 degrees. The hot end and termistor worked fine, and after it being heated up I extruded and reversed a few cm of filament (without any in the printer). Success overall! I did realize though that the extruder motor might have to be reversed also, it’s the same type of motor but I didn’t actually verify that the gears rotated in the right direction when “extruding” before.


Testing with pronterface.

Pulled the cables out again and labeled all of the connectors, used a DVD marker for the white connectors and a silver colored pen for the black ones. Simply wrote X, Y, Z and E on the motor connectors, X S, Y S and Z S on the X/Y/Z endstops. And T E on the termistor for the extruder, Ext on the extruder heating wire

To get an idea on how much slack was needed on the cables I moved the extruder to the extreme Y and Z endpoints to check. Lots of zip ties later I had run out, will have to try to find my bag of small white ones to continue. So all that’s left before the first test print now is to add a few more zip ties and then try to shove the printrboard and cables into the base, with some guidance from the printrbot jr video #6. And perhaps reverse the extruder motor if needed.


Result after a first round of cable management, actually might fit!

Update: Part 1 is available here and Part 2 here.