Friday, August 02, 2013

Fab Academy: Final Project





An interactive mammoth toy - a modern update of a classic kids' model

I started out by planning specifically which how to split up my dinosaur kit into differentelectronic system components. I decided to use the mammoth as a prototype, and studied the shapes of all the parts available and where would make most sense to place, the input, outputs, microcontroller and batteries. This was a more complex process than I had imagined, as the number of connections between each of these components has to fit with the number of physical connections on the host 'bone' of the mammoth. Furthermore, each connection has to make two electrical connections: ground and live. So I set about trying to work out a simple way of achieveing this, coming up with a system of wirefixed into holes in the ply wood and running through the slots where the bones fit together:


I then designed my board. I decided to keep things simple, and let the input be a tilt switch and the outputs being some flashing LEDs for the eyes of mammoth. Thus I started with the hello world board with button and LED, and pulled out these components and built in pads such that these could be easily connected to the inter-bone connectors. I also wanted the thing to run off batteries, so put in a small board for a regulator should it be needed. The total list of boards was thus 1 controller board, 1 regulator board and 2 LED boards. Here is the EagleCAD board and schematic.

There's a typo above, that should be a 499 Ohm resistor next to the LED, not 499K Ohm.

Here is the cutting layout:


Milling the board was straightforward. Populating them was a little trickier as I'd kept everything quite small and tight, and soldering wires onto the pads leading to the connectors was particularly tricky. A through hole arrangement would work better, or using some low profile terminals of some sort.
Here is the finished circuit laid out on a wooden board temporarily:


Here is one of the LED boards ( to be eyes), with a correcting 499Ohm resistor soldered on top of the too large one!:


Here is the very small controller 'brain'


And here is the tilt switch to be mounted on a leg:


I had a bit of a hard time programming the board until I realised I didn't need to worry about serial ports for this - I was confused as one wasn't showing up, but hadn't realised that this does not happen when using the programmer alone. The code was made in Arduino, here it is:

/*
The circuit:

* LED attached from pin 8 to ground 

* pushbutton attached to pin 7 from +5V

created 2005

by DojoDave 
 modified 30 Aug 2011
 by Tom Igoe
 
 This example code is in the public domain.
 
 */

// constants won't change. They're used here to 
// set pin numbers:
const int buttonPin = 7;     // the number of the pushbutton pin
const int ledPin =  8;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
//#include 
//#define rxPin 0
//#define txPin 1

// set up a new serial port
//SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  digitalWrite(buttonPin, HIGH);    
// Open serial communications and wait for port to open:
//  mySerial.begin(4800);
//  mySerial.println("Hello, world?");
}

void loop(){

  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
//mySerial.println(buttonState);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED off:    
    digitalWrite(ledPin, LOW);  
  } 
  else {
    // flash LED on:
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
    
  }
}

I rigged up the circuit with a power supply and it worked fine, but with a 3v button battery it seemed to struggle. I thus decided to use two button batteies and a 3.3v regulator, which produced good results. In order to save battery I also put in a slide switch  so that the user can switch off the curent to the regulator when not in use. Here is a video of the sensor temprarily rigged to a draft mammoth, and the prototype connectors:



Finally I got onto the laser cut mammoth itself. i had to clean up the file that I'd started with, so largely redrew it in Illustrator to make the slots much more consistent and reliable. I then had to add in some holes and engraving details so that the wire could be embedded into the ply for the connection points. I did this in Rhinoceros, as it is way better for doing things that are not strictly orthogonal! Here is the final layout as a .svg.


I then got onto cutting, and made a series of teests to ensure the fit was just right with the thickness of ply I was using (3.2mm).



When I was happy with this, I went for a full cutting layout, assembled the mammoth and went about embedding the wire connections into each piece, and fitting the electronic parts to the appropriate pieces, using doublsided foam and hot glue to fix things in place. This took a wee while.






And here's a video of the finished product working!


Download all the source documents as a .zip here.

No comments: