Jan182010

Just got a 4D Systems OLED display to play with

Published by paul at 12:42 PM under Arduino | OLED display

Even though it's Martin Luther King day here in the US, UPS is still running and just delivered the display I'd ordered to play around with.

It's a uOLED-128-G1 1.5" diagonal display made by 4D Systems - 128x128 with 65k colors - with on-board micro-SD connector to hold bitmaps. Parallax sells these for $64.99 (see here) and I couldn't resist picking one up to tinker with.

Here's a photo (click for larger image) of the SMT PCB:

 

I've heard there's some documentation pulled together on these but it's going to be fun getting it to display bitmaps and things like graphs from sensor readings.

Also delivered was my copy of the Practical Arduino: Cool Projects for Open Source Hardware book - looks like I'm going to be busy this afternoon!



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Currently rated 1.5 by 66 people

  • Currently 1.500001/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Permalink | Trackback | Post RSSRSS comment feed 2 Responses

Jan172010

Arduino projects: LED 10-bar array

Published by paul at 7:39 PM under Arduino | LED Projects | Example Code | Example Movies

I finally had some time over the last two days to play with the Arduino board I picked up late last year. The Arduino is a pretty neat concept - wrapping a microcontroller up in a neat board that makes playing with sensors, displays, motors, etc and prototyping very simple. It's all open source and you can read more about it on their homepage (http://www.arduino.cc/) which also has a freeware IDE to use for programming. The board I have uses Amtel's ATmega328P processor, with 32K of flash memory and can do 20MIPS. They're very popular and opening up electronics and gadget hacking to non-techies.

Here's the 2009 rev of the Arduino Duemilanove board (image from their website, click for larger version):

 

They cost about $30 - I got mine as part of a kit from the Nuts'n'Volts magazine store but loads of online stores have them.  I just picked up some accessories yesterday from SparkFun who have the full range, including the Arduino Mega which has 54 IO pins - can't wait for that to arrive!

The possibilities for this are just endless. The IDE provides a full C++ environment with a bunch of helper classes already defined, which takes a lot out of the tedium of programming microcontrollers. If you're going to play with this, I recommend using some of the samples that come with the IDE and on their very extensive web site.

My current interest is with making things light up in clever ways so I thought I'd start off by writing a simple program to play with an LED array. The circuit's very simple: pins 2-11 from the Arduino connected to the LED array, which is connected through 220ohm resistors to ground on the other side. First time I goofed and put the resistors into the breadboard on the Arduino side of the circuit, to no effect whatsoever. Future, more complex projects will include a circuit diagram (once I find a nice freeware program to do it), and of course, correct resistor positioning :-)

Here's a photo of the board connected up and a close up of the very simple circuit (click for larger versions):

  

Don't try to use pin 1 as a digital output, it won't work.

I put together two easy programs - one to move the lit LED from right-to-left and back again and one to move the lit LEDs from the middle out to the two sides and back in again. Kind of Knightrider-esque, but also the way the old SUN machines I used at university had their status lights on the back of the machine.

The code for the first one is:

/*
  10-bar LED array
 
  Connect the LED array to pins 11-2 and through a 220R resistor to ground on the other side.
  01/14/2010
*/

void setup ()
{
  for (int loop = 2; loop < 12; loop++)
  {
    pinMode (loop, OUTPUT);    // Set the pin IO mode
    digitalWrite (loop, LOW);
  }
}

void loop ()
{
  // The loop has to start at 2 because 1 isn't an IO pin.
  // Go from right to left
  for (int loop = 2; loop < 12; loop++)
  {
    // Switch the LED on for 10 milliseconds
    digitalWrite (loop, HIGH);
    delay (10);
    digitalWrite (loop, LOW);
    delay (20);
  }
 
  // And from left to right again
  for (int loop = 11; loop > 1; loop--)
  {
    digitalWrite (loop, HIGH);
    delay (10);
    digitalWrite (loop, LOW);
    delay (20);
  }
}

And the second one changes the loop to be:

void loop ()
{
  // Start on LED 6 and go up to 10 (remember, shifted by 1)
  for (int loop = 7; loop < 12; loop++)
  {
    // Light the LED on the LHS of middle and the matching one on the RHS
    // This will light LEDs 6-5, 7-4, 8-3, 9-2, 10-1 (shifted by 1)

    digitalWrite (loop, HIGH);

    digitalWrite (13 - loop, HIGH);
    delay (10);
    digitalWrite (loop, LOW);
    digitalWrite (13 - loop, LOW);
    delay (20);
  }

  // And back down to the middle again
  for (int loop = 11; loop > 6; loop--)
  {
    digitalWrite (loop, HIGH);
    digitalWrite (13 - loop, HIGH);
    delay (10);
    digitalWrite (loop, LOW);
    digitalWrite (13 - loop, LOW);
    delay (20);
  }
}

Note there's no main() function - it's all taken care of. The wrapper calls your setup() function and calls the loop() function in an infinite loop. You only have to provide these functions and you can use all the C++ programming constructs (if you want to) or keep it pretty simple.

I took some short (5 second) movies of each program running - you can get them from SideToSide movie and MiddleToSides movie (around 2MB each).

This was just my introduction to the environment, the real fun will start with some of the projects I have lined up:

  • 3-D LED cubes (3x3x3, 4x4x4, 8x8x8 and maybe higher - I have 1000 3mm red LEDs winging their way towards me - $29.95 from Rackmount-Devices.com)
  • panel of 8x8 LED arrays controlled through MAX7219 chips
  • object recognition with a simple CMOS camera
It's going to be a fun year! This is going to satisfy not only my desire to get back into electronics and start tinkering, but also to write some nifty low-level code.

As always, let me know if this is interesting, you're doing something similar, want something explained, or you have an idea for a cool project.

Enjoy! 



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Permalink | Trackback | Post RSSRSS comment feed 4 Responses

Jan172010

Kit building: Mod Amp Kits guitar reverb pedal

Published by paul at 5:11 PM under Kit Building | Audio

My 8-year old daughter started learning to play the electric guitar in September and that gave me an idea for one of the first kits to make to brush up my soldering skills. I'm using a Weller WD1001 soldering station which is light-years better than the old unregulated soldering irons I used to use 15 years ago in the UK. I made a couple of little light-following bugs (the MK129 and MK127 - the MK127 has much better movement) and then a reverb module from Build Your Own Clone (BYOC). It had a nice PCB but when I made it there was a weird short-circuit I couldn't figure out on Christmas Eve in time to wrap it up for a present the next day (all three pins of the 78L05 regulator gave 9v!!) so decided to try another brand.

I settled on the The Verb kit from Mod Amp Kits. It uses the Belton BTDR-1 DigiLog Reverb module (here's the PDF datasheet) and has a cool green box that my daughter thinks is groovy. The kit circuit is pretty simple but I'd failed to notice that it's not PCB based - it's all built using tag strips - aaarrgh! I find tag strips *really* annoying to solder on, and this kit is especially finicky as the instructions call for the tag strips to be mounted inside the box and then the components soldered in, however the instructions are excellent and everything went to plan - the kit is very well designed and I'd recommend it.

The following photos show the build process at various steps so anyone else building this can see what it's supposed to look like. Click the image for a 1024x768 blow-up.

1) Here are the contents of the kit. There's also a printed assembly manual and the case. The manual for this kit is much better than the BYOC kit.

 

2) End of Section 1 (Drawing 2 in the manual). Note that the footswitch must be mounted with the lugs horizontally, but it doesn't matter which way up. It's a 3PDT (three-pole, double-throw) switch. The BYOC kit didn't explain this, so I wasted a bunch of time figuring out how the switch worked. Notice how close the tag strips come to the input and output jacks. I had to do some tag bending to make sure there were no short-circuits. Everything's very close together, and the box gets very crowded (as we'll see below) so I wouldn't recommend this for soldering beginners.

 

3) End of Section 2 (Drawing 3 in the manual). I liked their idea to use sleeving from the hook-up wire to insulate the unused pins on the reverb module, but it left me a little short of wire in the final stage - luckily I had some of the same color and gauge lying around (couldn't possibly have multi-colored hook-up wire inside the box - very untidy :-)

  

4) End of Sections 3 (Drawing 4) and 4 (Drawing 5). Drawing 5 doesn't give a simple representation of the footswitch wiring. Pay attention to the last line of paragraph 3 in Section 3 - I misread and soldered it - and then had to unsolder again when I realized more wires would connect to log 3 of the pot.

 

5) End of Section 5 (Drawing 5). I ended up mounting the reverb module as soon as I could to get it out the way of everything else.

  

6) Working through Section 6 (Drawing 6). Although the soldering order given in the manual is pretty good, I found it better to slightly reorder how I did things for easier access to the terminals as I went along. I also worked out how to layer the components vertically so I could solder them individually rather than trying to have 4 components balanced inside the box an solder them all at once - almost impossible. Pay particular attention to the orientation of the two transistors - they're both soldered gate-source-drain left-to-right. The images show the progression through the terminal wiring. You can see a few little nicks in the insulation on two of the wires in the right-hand of the box - testament to how closely packed everything is.

  

 

7) End of sections 6 and 7 (Drawing 6). Not quite as tidy as the image on their website but I was very pleased with my handiwork!

 

8) The finished unit from the outside.

 

Total build time was around 6 hours. We tried it out last weekend and it worked perfectly first time!

Enjoy!



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Currently rated 3.1 by 16 people

  • Currently 3.125/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Permalink | Trackback | Post RSSRSS comment feed 1 Responses