3D Scanner - Part 2 - Printed Parts

3D Scanner – Part 2 – Printed Parts

With the driver board working, I need to put the turntable on the motor which means I have to build a structure around it.

Some designs print the turntable as a whole. Others print quadrants and attach them together with screws. I’m having a little problem with my prints curling. I know it’s related to the temperature of the hot end but it’s a pain to tweak when all I want to do is to print a flat circle. So, I purchased some pre-cut 7″ diameter wooden circles from Amazon (http://www.amazon.com/gp/product/B00TGFWNMI) for $10. The suggestions I’ve read talk about either painting the turntable with a rubber coating or using the non-slip rubber matting that can be cut to size. I intend to use the latter.

To build the structure, I’m working in parts and will merge some of them so they can print together.

First step, is to attach the structure to the stepper motor. The motor is a NEMA-17 size which has some specific dimension. Lots of drawings can be found online. I’m new to 3D printing so there must be some rule of thumb to apply when copying dimensions verbatim.



It’s supposed to be 42.3mm square with a 31mm gap between the screw holes. It took me several iterations to get the screw holes to line up with the holes in my design but I managed it.


Now that I have the design for the top part, I can merge that with the other parts later.

Next step is to couple the motor shaft to the turntable. The shaft is 5 mm diameter and around 21-22mm high. My first pass at the coupling is designed so that the turntable is screwed onto the coupler ( screws descending ).

IMG_3788 IMG_3791

While I didn’t allow for any slop in the coupler itself ( it’s a tight press-fit onto the shaft ), I’ve included a hole for an additional screw to clamp the coupler to the shaft. I haven’t tested this yet but I have concerns whether the coupler is too small to allow the turntable to move smoothly. I may need to extend top of the coupler in the 4 directions so that I can add more screws to attach it.




The coupler on its own is not enough to support the turntable so I have to build some support struts. Other designs include a large ring bearing but my plan is for 4 struts with a skateboard bearing on each one and the turntable sits on top of those bearings.

I designed an axle for the bearing with a split down the middle to allow the bearing to pop on but not come off without additional force.


This one took a few attempts to get right as the diameter of the axle has to wide enough to fit through the bearing hole and tight enough to allow the bearing to spin correctly. Also, the wider part seen on the left has to be bigger than the bearing hole to prevent the bearing coming off but, when both sides are squeezed together, it has to be able to fit through the bearing hole. Now you see why it took a few attempts. I’m not an engineer and I don’t play one on TV.

Anyhoo, once I had that to my liking, I designed a simple strut to attach it to.

IMG_3794 IMG_3795 IMG_3796


That was fun to do because I could use the 3D design software to take the axle I made and merge it onto a basic strut.

I took another go because I wanted to make the struts a little more aesthetically-pleasing. So, this is the final design.


To give you an idea on how this is supposed to look, imagine 4 total struts supporting the turntable:






3D Scanner - Part 1 - Driver Board

3D Scanner – Part 1 – Driver Board

I’ve been looking at a Kickstarter project from the guy who is responsible for FreeLSS. This is a 3D scanner using a Raspberry Pi to control a turntable, a couple of lasers and the Raspberry Pi camera. The software takes multiple images of a 3D object as it turns on the turntable and stitches them together to make a 3D model that can be printed.

The Kickstarter project is to put together the STL files to be printed for the structure and also to provide components for the driver boards.

Unfortunately, I was too late to jump on the bandwagon but, with the designer’s intention to make the whole project open source, there’s enough detail on the website to build the driver board and make a structure to support the components.

In another “How hard can this be?” moment, I’ve decided to take up the challenge and see if I can build this.

The hardware driver board is simple. You need something to work the lasers and something to turn the turntable when signals from the Raspberry Pi are received.

The FreeLSS site has the following design:


The A4988 chip is the driver for the stepper motor and the ULN2003A is a Darlington Array responsible for working the lasers.

I’ve made a couple of adjustments:

  1. The input voltage is 5V for everything. I understand that the designer has made a similar change but that’s only been available to Kickstarter backers. This is handy because the stepper motors I have take a 5V input. Full disclosure: I successfully blew up a couple of L9110S’ by pushing too much voltage through them. They can handle up to 12V but no more.
  2. I’m not powering the Raspberry Pi from this board. I’m happy with powering it from its own power supply. Eventually I can build something that will power both the driver board and the Pi.
  3. I’ve replaced the A4988 with 2 L9110S H-bridge chips. This was because I had the chips available and I didn’t see a need to buy another driver board for this. This will require me to make modifications to the turntable software so that it will work with my driver board. That’s the beauty of open source 🙂

With those changes, I put together the schematic:


and, after a couple of attempts at getting the board together, I have something that will drive both the lasers and the stepper motor and not get hot because of short circuits. Here’s a video of my working board.

Cinderella Clock Project - Part 2 - The Electronics

Cinderella Clock Project – Part 2 – The Electronics

With the clock face constructed, I turned my attention to seeing what I could do to get it moving.

I knew it was going to have to be wirelessly-controlled because there was no way we would be able to run a control cable from a hanging beam to the side of the stage without complications.

So I put a few ideas together. I knew that an Arduino-like controller would be simple to put together. I’d played around with building a Bareduino ( https://www.virtuabotix.com/product/bareduino-bare-minimum-16-mhz-arduino-kit/ ) and found it fun and, more importantly, inexpensive. I ended up buying the components in bulk on eBay. Now I’m hooked on getting electronics from China for a couple of dollars.

The number of add-ons that are available for the Arduino market is impressive. I knew that it was possible to get wireless transceivers so I bought some nRF24L01+ transceivers from Amazon (http://www.amazon.com/gp/product/B00E594ZX0). These have good Arduino library support. There are a couple of libraries on GitHub and I found that the maniacbug version worked for me (http://maniacbug.github.io/RF24/). Also, I found his blog entry “Getting Started with nRF24L01+” really useful, particularly the pin connections from the ATmega328PU to the transceiver itself. The blog is at http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/.

I called my project a Nerduino due to the anticipated comments from my “friends”.

Initially, I breadboarded the circuits to show that I could send and receive

The wrinkle in building the circuit is that the transceiver is *powered* using 3.3v but the ATmega32PU is 5v-powered. This meant that I needed to build a voltage regulator to drop a 5v input down to 3.3v just to power it. That adds a few more components.

A LM317T is useful for building the regulator because it is adjustable based on the resistors that are used in the circuit. More information can be found at http://www.reuk.co.uk/Using-The-LM317T-To-Regulate-Voltage.htm but the schematic required to build a 5.5v to 3.3v regulator is:


At the time I built the circuit, I didn’t have a 240 ohm resistor so I had to use a variable resistor instead but I managed to get the conversion to 3.3v




I soldered together one Nerduino with the voltage regulator and tested again

After the successful test, I soldered another Nerduino and added a control panel

I added the servo output pins to one of the Nerduinos so that it became the receiver


The servo motor was running fast and unless I added gearing to the clock hands themselves, I needed to add a speed control to the control panel and slow the motor down from there.

The circuits needed to be able to run independently of a wall power socket so I wired up a USB cable to act as a power cable from a phone charger battery that I got from work.

Once the circuitry was working, I assembled it into the clock face with the help of a friend who was there to stop me from throwing the whole thing into the trash the moment we stumbled across minor issues.

I made sure that the clock could be operated from the sound desk at the back of the theatre (i’m standing next to the camera operator).

For those interested, the Arduino sketches for the transmitter and receiver are at:




Cinderella Clock Project - Part 1- The Face

Cinderella Clock Project – Part 1- The Face

Let’s put a few things into perspective about my level of competence for things like this. I’m not presenting myself as an expert in this. I’m showing what I did. I’m not an electronics genius by any means. I have to look everything up so I couldn’t tell you the value of a resistor or put together a simple blinking circuit. I also don’t have a workshop bedecked with tools. I frustrate the heck out of my father because I don’t label all the boxes I put my screws in and I don’t have a place for all my flathead screwdrivers in ascending size. Yes, I’m that guy.

Electronics came to me at a late age. I had a kit when I was a kid and I would get onto my porch roof to put up the coat hanger antenna I made for my crystal radio. I do kind of know which end of a soldering iron to blow into but my technique leaves a lot to be desired.

I’m a member of the Mills High School Drama Guild which is run by parents of students who take part in the school Fall and Spring productions.  In particular, I help to build the sets. This year’s Spring production was Rodgers and Hammerstein’s version of Cinderella.

The Director had the following design in mind and, in particular, the all-important clock:



At the time, there wasn’t much said about whether the clock should strike 12 but I looked at the design and thought “That’s seems easy”.

So, I started this project. I bought some corrugated plastic panels from Lowes to work out sizing. I tried two approaches: Making the clock face from a single panel ( approximately 3ft diameter ) and also quadrants from 4 panels making it a 5ft diameter face. Ultimately, the bigger size was better because the clock was going to be a way from the audience. I also cut some hands.



I was originally intending for the exposed gears to mesh and to move when the hands moved. That was a stretch goal that was dropped early on because printing gears on paper and cutting around them into a strong enough material with enough precision to mesh them together so they move isn’t as easy as it sounds if you just have a craft knife. This is where a table-mounted scroll saw would have been useful. I did try with a Dremel but it’s not precise enough.

If you’ve never drawn a gear before, I strongly suggest http://www.inkscape.org. It’s a freeware vector graphics program and there are a lot of tutorials on how to use it. I found this http://www.wikihow.com/Draw-Gears-in-Inkscape and it came in really handy. I ended up drawing 2 styles of gear, printing it on regular paper and sticking the paper to the plastic to cut around. Once I cut one gear, I could use that as a template for another. Also, because the clock was going to be far away from the audience, the precision of the cutting wasn’t a high priority but I still tried my best to get them looking OK.



I ordered some Roman numerals from a clock kit on Amazon (http://www.amazon.com/gp/product/B00LL1IEJ6/). They are self-adhesive but I should have used more glue because the 12 fell off just before opening night and broke into a few pieces.

I used spray paint for plastic to paint the pieces and we stuck the gears to the clock using double-sided tape.



Some things that I would do better on the actual face:

Quadrants is a good idea when you’re carrying the pieces around but when you assemble them together, you MUST make sure that the seam is well supported and strengthened. The clock face had a tendency to fold on the seams and this made it difficult to stand up. We added some pieces of wood to the back.

This gave the clock some weight which was OK because it was hanging from a beam on set. It also gave us something to attach the circuitry, motor and battery to.



I hadn’t tested the servo motor properly to work out how to attach the hands. The hour hand was stuck at 12 so the servo only needed to move the minute hand. The minute hand had a tendency to slip on the axle even though it was secure on the screw, the screw would unwind itself it the hand got stuck. We resorted to gluing the screw into the servo motor coupling and also the hand to the screw.

The weight of the minute hand was unbalanced which meant the top of it would flop forward. I had reinforced the hand with wooden skewers to prevent it folding but there was still a noticeable lean. This didn’t matter so much for a couple of reasons. Firstly, because the audience was only looking at the clock from the front, they wouldn’t see the lean. Secondly, it meant that the minute hand had clearance to move and not catch any of the numerals or the hour hand.

Finally, the face design is more simple than the sketch. I didn’t have something to use to make fine circular lines that I could use to paint minute divisions. Painting circles at a large scale requires some finesse but I didn’t have any.

Design-wise, I was pretty pleased with it. I like the blue and gold together but I’m not sure the gold showed up when the stage lights were on it.





Thanks to a comment from one of my Facebook “friends”, who suggested I etch the name of each host name into the plastic plate on my Pi rack, I found a project for a Raspberry Pi controlled CNC laser etcher.

The details are at http://funofdiy.blogspot.co.uk/2013/10/a-raspberry-pi-controlled-mini-laser.html?m=1.

Someone tweaked the project and put together a video showing how his contraption works:

Thanks to Bryan, I got a couple of old DVD-RW drives and took them apart for the stepper motors.


The project suggests that the laser diodes in the DVD drives can be salvaged but the manufacturers of *these* drives saw fit to encase them in concrete and diamond dust so there’s no way to get them out cleanly.

What’s next is to wait for my eBay purchases to show up and I can start on the stepper motor drivers. I know I can buy them fully-assembled but there’s no fun in just clipping it all together, is there?

Introducing the Ravelox PiRack

Introducing the Ravelox PiRack

I had a random urge to rack my Raspberry Pis so I was looking for inspiration that wouldn’t tax me that much.

Dug had an original design for a single-layer Pi case which I embraced and extended to allow me to stack my 3 devices.

Introducing the Ravelox PiRack.

Initial device mounting
Initial device mounting
Top view of initial mounting
Top view of initial mounting
A closer look
A closer look

pirack14 pirack13 pirack12

The finished article
The finished article

The Pi sits in the groove in the rubber grommets.

Total cost is around $35 ( + tax ) and I bought all the materials from Lowes ( see pictures below for the details ) and OSH ( the nylon nuts ).

Each acrylic plate is 4 15/16” x 3 7/8”.

The drill holes are 1/4″. It’s an arbitrary choice but 1/4″ was the most reasonable size that I could find where the threaded rod was 6″.

For the drill hole placement, it’s important to note that it’s not uniform on the plate. The components on the Pi make it impossible to place it evenly in the grommets.

So, with the plate facing you where the longest length is horizontal, the drill holes are offset from each corner as follows:

TL = 7/8” horiz - 11/16” vert
TR = 1” horiz - 3/4” vert
BL = 1/2” horiz - 9/16” vert
BR = 13/16” horiz - 5/8” vert

Materials are:

8 x Acorn Nuts 1/4 - 20 (pack of 3 $1.24) [OPTIONAL]
12 x Rubber Grommets 9/16 OD x 1/4 ID ( pack of 2 $1.04 )
4 x Threaded Rod 1/4 - 20 6 inch ( 1pc $0.92 )
2 x Clear Acrylic Sheet 8”x10” 0.080” thick ( 1pc $2.97 )
24 x Zinc Nuts 1/4 - 20 ( 100pc $5.58 )
12 x Nylon Nuts 1/4 - 20 ( 1pc $0.69 - OSH ) [OPTIONAL]

pirack6 pirack5

The materials
The materials

pirack3 pirack2 pirack1


Darn it all to heck!

At some point between making the triumphant ( now seen as premature ) video of the input circuit working and now, the little elves of mischief have removed a vital but undiscoverable piece of the circuit that is preventing it from working.

It’s a little frustrating as I’ve taken it all apart and rebuilt it plus I’ve replaced the op-amp in case I blew the chip ( not that likely ).

So, in the absence of inspiration or serendipity, I’ve replaced it with another design from a previous post. It Kinda Works(tm) but I’m back to having a trailing voltage when then I read the ADC which means a double reading. I’ve connected up the multiplexer to drain the capacitor but it’s not draining that quickly.

So, into the box it goes and I’ll take a short break to concentrate on something else.

A little redesign

I realized that I didn’t need another ADC to clear down the capacitor. The circuit I’m basing this on uses 2 multiplexers: 1 for the input select to send on to an ADC and one to clear the capacitor for the selected drum input. The design makes sense because you’re selecting the input and those same input selections will also be used to select the clear down.

However, given that the MCP3008 (ADC) has 8 inputs, the first multiplexer is redundant.

So, I now have the ADC and one multiplexer.

I put together a test circuit to make sure that I understood how to talk to the multiplexer and that seems to be working fine.

It all works !

After giving up for a couple of days because it wasn’t doing what I wanted, I took everything apart and rewired it. This time, it functioned as I wanted it to!

There are more things that I need to do:

  1. Get another MCP3008 ADC so that it can be used to clear an input once it’s been read.
  2. Wire up more than 1 drum input using more LM324 op-amps.
  3. Rewrite the python code in C so that latency can be as low as it can be. I may attach the Raspberry Pi to a network hub/switch so that WiFi isn’t part of the equation.