Driving a stepper motor with an ATTiny85

Tim Sunerton is currently a student in the Art Dept at The University of Reading and wanted to power a number of roller blinds with motors so that they would move up and down. He had already produced one which moved the blind down into a trough of paint and then lifted this back up again and smeared the paint onto a canvas (see Tim’s Blind). The blind was powered by a NEMA17 type stepper motor, a motor driver and an Arduino Uno. To attach the motor to the blind, a coupling was fabricated using the 3D printer.

For the current project (four blinds) and as an exercise in making things smaller I suggested that the blinds could be powered by ATTiny85 microcontrollers, as we don’t need all of the ports that the Uno offers. I built a test rig using some stripboard, a voltage regulator (plus a few capacitors) and an ATTiny85. The first image shows the ATTiny85 on the stripboard:

ATTiny85 with voltage regulator

ATTiny85 with voltage regulator

The two wires coming out of the left side of the board connect it to the power supply (in this case a bench power supply @ 12V); the wires at the right power the stepper driver and provide the pulses to drive the motor:

Stepper motor driven by an ATTiny85

Stepper motor driven by an ATTiny85

The ATTiny85 was programmed by piggy-backing on an Uno, which I have to say is very easy, although I eventually decided to make a programmer shield for the Uno so that you can just plug in the ATTiny85 directly into the shield and program it without needing to connect any wires. (Note: the stepper motor above was not used for Tim’s blind project – just for testing. He used much larger motors for his project).

I made three of these boards and Tim used them in his project. We also had to fabricate 4 new adapters for the blinds. One of the blinds was quite big, and even though Tim used a higher torque motor, the weight of the canvas on the blind pulled the blind down against the force of the motor. This was a bit of a problem, and the solution seemed to be in gearing the motor in some way to increase the torque. After a little thought, I came up with this:

Worm gear

Worm gear


A worm gear that would increase the torque by an order of magnitude, and stop the blind from pulling down. Here’s the work in progress as we tested out the motor driver (and killed it, though fortunately had a spare) and programmed the microcontroller for speed and the correct number of rotations:

Worm gear and Uno

Worm gear and Uno

We used the Uno for this particular arrangement after having blown the original driver. The motor was later attached to the frame using the bracket that we fabricated with the Cube:

Stepper motor bracket printed using the Cube

Stepper motor bracket printed using the Cube

Note the lack of hole in the centre of the front mount. Whoops. We later drilled a hole using a pillar drill.

Advertisements
Posted in Uncategorized | Leave a comment

Visual Programming for Arduino

ModKit have produced a visual programming environment for Arduino devices, based heavily upon the Scratch project at MIT. The ModKit Micro IDE uses the Scratch drag and drop interface for assembling simple programs which can be directly uploaded to the Arduino device, simplifying the process of writing Arduino sketches. I tried creating the basic ‘blink’ sketch using ModKit and it took less than a minute (about 30 seconds) to figure out. It uploaded without problem and worked just fine. Here is the blink sketch in ModKit:

ModKit interface showing the basic 'blink' sketch

ModKit interface showing the basic ‘blink’ sketch

Unlike the standard Arduino IDE, the program is not logically separated into setup and loop, but is all in one location. This was a bit puzzling at first, but doesn’t make a difference to the functioning of the code. The first block in the window shown above is the set up for the pinMode, that instructs the Arduino device to make pin 13 an output (rather than an input). The larger block underneath the pinMode is the loop structure, called ‘forever’, and takes the place of the loop function in Arduino. Inside the forever block are the two instructions that switch the LED on and off, and two delays. At the top of the window there is a ‘play’ button which compiles and uploads the program to the Arduino. It’s that easy.

There is a facility to observe the generated code, although this (at present) does not translate into C, but something in between. For instance, the forever block represents while(true) {}, so (like the rest of the Scratch/ModKit language) is basically a syntactic sugaring to remove the complexities of C programming.

I am looking forward to trying this out with some groups of students and some of my colleagues (Kate!) to see how well it works in the wild. For simple programs it seems to be a great way to get to grips with writing sketches for the Arduino, bringing programming to a wider audience.

Posted in Uncategorized | Leave a comment

Sensory Labels

We had our showcase events last week at the British Museum in London, where our group of co-researchers from the Tower Project demonstrated their multisensory ‘labels’ to the public. The response from the public was excellent, and the group did a fine job of explaining what they had created and why.

Below are the multisensory labels (twelve small sensory labels, plus the larger ‘chocolate box’) and some images taken at the event. You can see more of the event photos at the sister site SensoryObjects.

The twelve sensory labels created by the Tower Group

The twelve sensory labels created by the Tower Group

Designed by Adelana, and based upon a diamond ring she saw in the Enlightenment Gallery

Designed by Adelana, and based upon a diamond ring she saw in the Enlightenment Gallery

Sensory Label designed by Judith

Sensory Label designed by Judith. She wanted the sound to be triggered by bending the leather sandal that she made. The sound also triggers using a touch sensor on top of the box.

Sensory label designed by Tim

This sensory label is based upon objects from Egypt that are in the Enlightenment Gallery. The engraved design resembles Hieroglyphics, and the soundtrack tells a story about a trip to Egypt, from the designer’s perspective.

Sensory label designed by Michael

This sensory label is based upon a plate in the Enlightenment Gallery which originated in China. The soundtrack plays a collection of sounds relating to food (that could be placed onto the plate, and music related to China.

 

Julie's Heron

This sensory label has an engraving which was designed to resemble a heron that is in the Enlightenment Gallery.

 

Sensory label designed by Justin

This sensory label was inspired by the Warwick Vase. It reminded him of a football cup …

Sensory label design by Kelly

This sensory label was inspired by the statue of Paris in the Enlightenment Gallery.

Sensory label designed by Ryan

Sensory label designed by Ryan

 

Posted in Uncategorized | 2 Comments

Preview of new multisensory cushion controller

Here is a preview of new version of the multisensory cushion controller box. Unlike the previous version, which used an Arduino Uno and Adafruit Waveshield, this one uses a Lilypad MP3 player and is powered by a LIPO battery (not shown in the images). The battery is plugged into an Adafruit lipo charger, which is permanently connected to the MP3 player. The Lilypad MP3 player has built-in amplification which is loud enough to power the Visaton K50 speaker without needing an external amp. This new controller box is about 20mm thinner than the last version, and shorter. The whole controller box is 140mm x 70mm x 25mm and about 100g with the battery.

Preview of cushion controller

Preview of cushion controller

Posted in Uncategorized | Leave a comment

Photo Engraving for Sensory Labels

We have been experimenting a little more with the laser cutter and tried out a variety of settings for engraving photographic images. The early attempts were either too dark or had poor image resolution, and it turns out that the latter depends largely on how well the image is converted to a bitmap which the LaserScript can use (1-bit bitmaps only). A fellow laser cutter from the LaserScript forum (Dave) converted a photo for us which worked really well when we engraved it, so we did the rest of the images in a similar way. Using Photoshop, we scaled each of the photos to 15cm x 11cm, converted them to greyscale and then saved as a bitmap using diffusion dither at 300DPI. The settings on the laser cutter were: speed 300, power 20 and scan gap 0.05, with bi-directional mode switched off. This gave a really clear engraved photo, though on reflection I think we could probably have increased the power to 22 or 24 to make them a little darker. Perhaps we’ll do that for the next batch. One nice little trick we have learned is to tape the wood down to the laser bed using masking tape to keep it flat – simple, but effective!

Here are some of the results of yesterday’s cutting and engraving. In the first image you can see the pieces of the boxes we are cutting out for the sensory labels. The image does not do the actual items justice – they’re much nicer than this in real life!

Cutting out the box parts, and engraving the photos

Cutting out the box parts, and engraving the photos

Closeups of the sides and tops:

Top panels of box

Top panels of box

Sides of the box (holes for sound)

Sides of the box (holes for sound)

Here are couple of closeups of the engraved photos:

Holding a cup

Holding a cup

I like the one below as a concept – an engraving of Tim holding his engraved image. An engraving of an engraving.

Tim showing his engraved picture

Tim showing his engraved picture

We still have a batch of parts to cut and some more photos to engrave. Then there is the big task of assembling all of them and adding the electronics.

Posted in Uncategorized | Leave a comment

More Engravings for the Boxes using the Laser Cutter

A few of the original engravings didn’t turn out as well as we’d hoped, mostly because the line drawing were too thin or too light, so didn’t convert well to 1-bit images. We asked the group members to do the drawings again, but with a thicker pen/pencil and make them as large as possible on the paper.

The images were scanned at 300 dpi, converted to greyscale, thresholded to get the clearest 1-bit image and then saved as 1-bit bitmapped images. The size of the image was set to 15 cm x 11 cm, and the images inverted.

On the laser cutter, we set the speed to 200, power to 20 and scan gap to 0.05 for engraving. This was a bit experimental, but appeared to work well for the 3mm birch plywood. As you can see below, the resolution of the engraving is really good, and the images came out really well. They also feel good to touch, with clear outlines.

I have since learned that there is a simple method for calculating the correct scan gap, for a given dpi of image. It is:

DPI to Scan Gap = 25.4/DPI

For example, a 300 dpi image would then have a scan gap of 0.085 using this formula. I’ll be try a slightly lower dpi on the next engraving, and so reducing the scan gap and seeing how much different this makes to quality and speed!

All four new engravings

All four new engravings

Sams Shell

Sams Shell

Katy's Snake

Katy’s Snake

Ashley's Bird

Ashley’s Bird

Adalana's Ring

Adalana’s Ring

 

Posted in Uncategorized | Leave a comment

Prototype Sensory Boxes for the British Museum Collection

Each of our co-researchers from Tower Hamlets was given the task of drawing their favourite (or preferred) object from the enlightenment gallery at the British Museum. The drawing was to be kept simple, as we wanted to engrave each one onto wood and then use this engraving for the front, of what will eventually be, their sensory box. Each of the completed sensory boxes will eventually be placed alongside the real object in the enlightenment gallery for our (one day) exhibition in January. the process for engraving is described below.

Each of the images was first scanned and saved as a greyscale image. This is one of them (drawn by Ryan):

Ryan's scanned image

Ryan’s scanned image

The images were cropped to 15cm x 11cm and set at a resolution of 300 DPI, as we wanted them to be approximately the same size as a postcard. The images need to be converted to 1-bit bitmaps so that they are compatible with the laser cutter software. This was easy to do in photoshop: first change image mode to greyscale, then set the mode as bitmap. Then you can save the image as a 1-bit bitmap. We also inverted each of the images to get:

Ryan's picture inverted

Ryan’s picture inverted

The reason for doing this is that the laser cutter will remove the background and leave the sketched lines as a relief. We prefer this way of engraving as the result is much more tactile.

Here’s the machine which we used to engrave and cut out the pictures:

LaserScript LS3060 laser cutter and engraver

LaserScript LS3060 laser cutter and engraver

It’s a LaserScript LS3060 with a 60W tube. It’ll cut 8mm acrylic or plywood, possibly even 10mm. For the engravings (and the box which is decribed below), we used either 3mm birch or 3mm poplar plywood. The poplar is slightly softer wood so requires a lower power setting. However, we didn’t know this at the time, so the poplar engravings appear darker than those cut from birch.

The picture were merged into a single large bitmap which is approximately the same size as the cutting area of the laser cutter. This allowed us to engrave and cut a whole batch of images, rather than one at a time. It took about 1.5 hours to complete each set of engraving from a sheet of plywood, and the results are shown below:

Images engraved using birch plywood

Images engraved using birch plywood

The second set of engravings used poplar plywood, and as you can see they are darker:

Images engraved using poplar plywood

Images engraved using poplar plywood

We also created a very simple box which has the same length and width as the images so that an image can be attached to the front of the box. The one below has dimensions 11cm x 15cm x 3cm and is just about deep enough to include some simple electronics, including a speaker, MP3 player and battery:

Prototype box cut out using the laser cutter

Prototype box cut out using the laser cutter

When assembled, the box looks like this (this one has an engraved image attached to the top):

Prototype box with an image attached

Prototype box with an image attached

Posted in Uncategorized | Leave a comment