Arduino Intervalometer – Update

Intervalometer_2+2Since I first made my arduino intervalometer two years ago, I have used it several times and come to the conclusion that I could make a few improvements to it. The first change I wanted to make had to do with powering the unit. The original design allowed for an external power source and while this allowed for maximum flexibility, it also made the device somewhat unwieldy. Whenever I wanted to setup for a timelapse shot I had to not only bring the intervalometer but also a mintyboost or other power source as well as a power cable. The other major change I wanted to make was to reprogram the timing ranges to something more useful.

Intervalometer_2+3Intervalometer_2+1In order to power the unit I could have simply placed a mintyboost inside the intervalometer and changed the wiring accordingly, however, I did not want to have to open the device to change batteries. To get around this and still be able to provide the 5V power I needed I decided to use a lithium polymer rechargable battery. This requires both a charging circuit and a voltage booster to convert the battery’s 3.7V to 5V. Luckily Sparkfun Electronics makes just a device that charges the battery via a micro-USB port and is also very compact. Since the intervalometer draws only 28mA while running I chose a 1000mAh battery which not only fits inside the case it should also power the device for over 30 hours, more than enough for a typical timelapse session. Now I have a completely self contained, rechargable intervalometer.

For timing ranges I changed the low range to 1-60 seconds in 1 second steps and the high range to 5-300 seconds in 5 second steps. I think this should end up being much more useful since most of the timing intervals I have used are under a minute in duration and having the capability to more finely tune that interval will be very handy.

Arduino Word Clock

I first saw a clock with this type of design on the Make Blog over a year ago. It is an incredibly clever idea, but the $1000 price tag is a bit much for my taste. I had seen a few attempts at a DIY version but most of them were still too complex or expensive to build. Needless to say when I saw this Instuctable I got really excited. It is based off of another Instructable, however, it simplifies the design and construction to the point where I felt confident that I could build it.

I followed the Instructable pretty closely, with the following exceptions:

LEDS:  I got my LEDs from Evil Mad Science, which sells packs of superbright 5mm LEDs in various colors. This project requires a pack of 100 white LEDs. For current limiting resistors I used 470 Ohm instead of 1K Ohm. This allowed me more flexibility since I can dim the LEDs as much as I want, but I can never make them brighter. The LEDs I used are very efficient and only draw 4.8mA with a 470 Ohm resistor, so the maximum power draw for the clock will be about 150mA. Consequently power usage is not an issue since I used a repurposed cell phone charger as the power supply and it can provide 700mA at 5V.

Letter Mask:  I had to use 4 transparencies stacked in order to get the mask dark enough. I also used a wider border for the letter mask to cover up some imperfections around the edges of my transparencies. For LED diffusion I used some translucent plastic folders that I found at an office supply store. I got a multicolor pack so that I could try different configurations and decided that a combination of one gray and one white folder cut to fit in the frame was the best looking and most functional choice.

LED Holder:  Instead of a cardboard LED holder I used foam poster board. This is a much stiffer material and makes the holder much sturdier, however, it is also thicker so I had to make the light baffles 1″ high rather than 1-1/8″.

Circuit Board:  Since the wiring on this project is fairly complex I decided early on that I wanted to keep the circuit board as simple as possible. In order to accomplish this I used two Radioshack breadboard matching printed circuit boards. These are great boards since they have power buses running down the sides of each board and they have plenty of room for the 7 chips necessary for this project. This made it very straightforward to scratchbuild an Arduino on one of the boards and then wire it to the other chips. Note: when building an Arduino in this way you need an FTDI cable which plugs into the 6-Pin header on the board in order to program the Arduino.

I mounted the boards side-by-side on a piece of acrylic to make it easier to work with. I also wired the board such that I could add a photoresistor in the future to allow for dynamic LED dimming (its wiring is bundled separately for later use as shown in the photos). Instead of wiring headers I just wired directly from the circuit board to the LEDs using multicolor wire to differentiate which word group I was wiring to (you can see each ULN2003A’s bundle grouped together in the photos).

The size of these boards prevented me from trying to mount them inside the picture frame, however, mounting the boards on the back wasn’t a problem. As shown in the photos I had use some stacked foam board as spacers between the back of the picture frame and the wall to keep the board from rubbing agains the wall. I also changed the power socket mounting from the back of the frame to the bottom by cutting a notch in the wood and gluing it in place.

Conclusion:  The biggest problem I had with this project was dealing with a slightly imprecise LED layout. This resulted in some of light baffles partially blocking the wrong letters. After removing the problem baffles, however, I found that my diffusion layers worked well at making up for any discrepancies due to LED placement as well as reducing cross-letter light bleed to an acceptable level. As far as the code goes the only changes I made were done to make use of external pull-down resistors instead of internal and to clean up the code a little bit since some of the comments no longer made sense. I really like this project. It is not only cool looking, but it is useful as well.

Arduino – Parallax RFID Reader

A few months ago I saw some Parallax RFID readers at Radio Shack on clearance and decided to pick them up since they were such a good deal. I have wanted to make an RFID related project for some time after seeing this episode of SYSTM.

Here are some pictures of my test setup. As you can see the reader’s LED changes from red to green when it is reading a tag.

Peggy 2 LED Matrix

The Peggy 2 is a 25×25 LED matrix kit from Evil Mad Scientist Labs. Ever since I first saw the Peggy kit I thought it was one of the cooler kits available. I finally got around to getting one of these awesome kits and it is a sight to behold. By far the largest kit I have ever built, it is also the best quality kit I have come across. The Peggy 2’s circuit board is probably twice the thickness of a normal printed circuit board, a welcome feature for such a large board since the added thickness makes the board very rigid. You can purchase the Peggy 2 in a variety of kit configurations; I got the so called awesomeness bundle which includes a power supply, extra pushbuttons, and 640 diffused 10mm LEDs in the color of your choosing (white in my case).

The build itself took around 2 hours to assemble the control circuitry and another 4.5 hours to solder all of the LEDs. It’s a bit of an undertaking, but when you’re done it’s a great feeling when all 625 LEDs light up. To program the Peggy you use the Arduino IDE and download the Peggy Library. I haven’t experimented too much with it yet, but I did try out some of the demo programs from the library and you can see what the Peggy can do in the video below. I look forward to playing with this project a lot in the future.

Arduino Intervalometer for Time-lapse Photography

Arduino-Intervalometer3Arduino-Intervalometer2Last fall when I built my first intervalometer and then used it for some time-lapse photography, the limitations of such a design became apparent. With an analog timer the circuit is limited by component values to function in a fixed way. The timing ranges cannot be changed without rebuilding the circuit and there is no way to be truly precise in your timing. A few months ago I came across this design for an Arduino intervalometer which is very basic and requires reprogramming for any timing changes. After some planning I decided to take the best features of my original intervalometer and combine it with an Arduino’s flexibility to make a much more versatile intervalometer.

Key features to keep from the original were:

  • Camera interface isolation
  • Timing range options
  • Battery or AC adapter power options
  • Camera connection flexibility
  • Manual controls

Additional features that I wanted to add were the following:

  • Power supply flexibility
  • LCD readout
  • Start/Stop the timing cycle

Arduino-Intervalometer1Arduino-Intervalometer-SchematicIn order to maintain what worked best in the original design I simply copied it directly over to the new version. I used the same relay isolation for shutter triggering, as well as hard-wired pushbuttons for manual focus and shutter control. I also used the same 3.5mm jack to connect to the camera as the original. For power I decided to use a coaxial power jack as I had previously but this time I did not place a battery inside the enclosure. Instead, I made an adapter cable with an N style coaxial DC power plug on one end and a USB plug on the other end. With this cable I can power my new intervalometer from any 5V USB power source (PCs, wall adapters, MintyBoost, etc). In order to keep this build as simple and inexpensive as possible I decided to use the Arduino Pro and a basic LCD for a total cost of $36. The Arduino Pro is the same as a standard Arduino, except it uses all surface-mount components and has no USB interface. This keeps the cost down and reduces the board size. The LCD was simple to wire requiring only +5V, ground, 6 data lines and a dimmer potentiometer input. The final features were all implemented in the Arduino code.

I ran into a few problems while developing the code for this project:

  • How to adjust the timing interval value
  • How to start & stop the timing cycle
  • How to switch timing ranges

For adjusting the timing interval I had originally planned to use pushbuttons, however, after playing with the idea I decided against it. I found that it was much quicker and more user friendly to use a potentiometer as a virtual selector switch. In order to do this I used the map function, to divide up the potentiometer’s analog input values into the specified number of steps.

Starting and stopping the timing cycle was not as easy as it first appeared because the simplest way to wait a specific amount of time between events is to use the delay function. The problem with this is that while the program is delaying for the set amount of time, no other commands are being run and inputs are not recognized. To get around this I used a technique I found on the Arduino website which blinks an LED without using the delay function. Instead it sets a preset interval and then checks how much time has past using the millis function until enough time has gone by to trigger the desired event. This allows the processor to keep scanning the code while the timing cycle is taking place. Now if I want to cancel the timing cycle I can do so without resetting the Arduino.

To switch timing ranges I used this clever piece of code that allows you to use one button for two functions. When the button is pressed the Arduino keeps track of how long it was pressed. For short presses it performs one function and for longer presses it does another. I used this method to implement both timing range switching as well as toggling between set mode and timing mode as shown in the video below.

After getting all of my code together I assembled my new intervalometer in a 6″X4″X2″ project box from Radioshack. This is somewhat oversized for these purposes, but it’s cheap and readily available. Overall I am very pleased with this project. The responsiveness of the interface is very good and it triggers my camera shutter perfectly. The two timing ranges I preset in the unit are 5-60 seconds in 5 second steps and 30 seconds to 10 minutes in 30 second steps. These should cover the most common intervals I will use, and I can change them at any time if I have to. This is by far the most complicated Arduino coding that I have done and it was a great learning experience. Check out the video below for a demonstration of the device.

 

Note: the LCD requires the updated LiquidCrystal Library, checkout this tutorial if you are using version 0016 or earlier of the Arduino software.

Arduino Punk Console 8 Step Sequencer

APCAPC-faceThe arduino punk console is a simple tone generator that is capable of making some cool audio sequences. I’ve always enjoyed playing around with different audio equipment (see my analog synthesizer) and this looked like a cool project when I saw it on the Make Blog. It is a fairly straightforward project that uses an arduino to handle all of the switch and potentiometer inputs and generate the tones. What is especially fantastic about this is the flexibility afforded by having a reprogrammable controller instead of a hard-wired sound generator. That said I haven’t modified the original code yet.

APC-insideWhile the original project was good (see also this Instructable), I made the following changes for my version of the arduino punk console:

  1. Eliminate the LCD screen – I wanted to make my version as cheap as possible and I thought the LCD was somewhat unnecessary for a simple project such as this since it doesn’t display very valuable information.
  2. Scratch build the arduino board – Similar to other DIY arduinos (see here & here) I’ve done before based off of the Boarduino design, I had the parts and building it myself cut the cost of the unit.
  3. 9V AC adapter power – I have found it is much more convenient to power many of my projects with an AC adapter instead of batteries as it saves having to access the inside of the unit for battery replacement and the portability provided by battery power is rarely necessary.
  4. Substitute 5K ohm potentiometers – I’m not sure why the original project used 100k ohm potentiometers, but I had a bunch of 5k’s around and they worked fine.
  5. No speaker – I was planning on using an external amplifier so I replaced the speaker with a mono 1/8″ audio jack.
  6. Eliminate the volume control potentiometer – Again, because I am using an external amplifier I don’t need another volume control.

Check out the video below of the sequencer in action:

Freeduino (Arduino Clone Kit)

freeduinoThe Freeduino is a great kit for those interested in the Arduino platform. It is essentially identical to the Arduino Diecimila, but made with through-hole components to allow for easy assembly as a kit. I assembled mine in about 30 minutes. Unlike my homebrew Arduino, the Freeduino shares the Arduino’s form factor and therefore is interchangeable with the pre-assembled board (including compatibility with the various shield kits that are available for the Arduino). Another benefit of the Freeduino is that, due to its onboard female headers, it allows for prototyping without the use of a solderless breadboard.

Pictured above is a side-by-side comparison of the finished Freeduino kit (on the left) and my scratch built Arduino.

Panel Meter Clock

panel_meter_clock1There are several versions of this project, including one which can be purchased as a kit (The Chronulator). In this case I based it off of the one featured in Issue 13 of Make Magazine (original code and schematics). I liked this iteration as opposed to The Chronulator because not only can I easily build it from scratch using an Arduino board, it also has a seconds display

panel_meter_clock2In order for panel meters to tell time the Arduino pulses three of its outputs according to what the clock demands. For example, if it is 6:45 the Arduino will pulse the hour meter output 50% of the time and the minutes meter output 75% of the time. The pulses occur so fast that the meters can’t react in time, consequently it appears as if they are receiving a constant supply of current. Since the Arduino’s outputs are 5VDC and the meters were chosen to read 1mA maximum, then a resistance of 5000 Ohms is necessary between the outputs and the meters. 5000 Ohms is not a standard resistor size so I used some parts I had lying around in my junk box, in this case 4700 Ohm resistors and 1000 Ohm potentiometers. The potentiometers allow you to adjust the total resistance of the circuit enabling you to set the peak value of the meter to the correct reading (1mA).

panel_meter_clock3To finish the project I took an 8″x6″x3″ plastic enclosure from Radioshack and cut holes in the lid to mount the meters. I also placed the mode, hour set, and minute set buttons on the top of the enclosure. To finish it off I added a power connector for a 9V power brick which will be the power supply for the clock (in the lower left corner of the circuit board you can see the power circuit consisting of a protection diode, a 5V regulator and 2 capacitors which together supply 5V to the Arduino from the incoming 9V supply).

In order to make the panel meter faceplates read time instead of current I had to make a new set of scales for the three gauges. I started with the templates available on The Chronulator website (I particularly liked the VU meter as you can see in the photo). Since these are vector graphics images you can easily resize them without losing detail like you would in a bitmap image. I used a free conversion tool called FreeSVG to convert the files from PDF to SVG (Scalable Vector Graphics) format which can be read by the free, open source vector graphics editor Inkscape. Note: I believe that the new version of Inkscape will include the ability to open PDFs.

I used Inkscape to resize the faceplates to match the dimensions of the panel meters I had purchased (which were larger than the template). I also inverted the color scheme of the template since text on a white background is more visible than with a black background. I printed the new faceplates out on 4″x6″ glossy photo paper (which really shows off the colors of the scale better than regular paper). After cutting out the new gauges with a razor blade, I then used rubber cement to glue each of the completed faceplates onto the original aluminum gauges. I allowed the finished gauges to dry overnight and they went on without issue.

Total cost was about $60 for my scratch built Arduino, 3 panel meters, pushbuttons and enclosure.

This is an excellent project to get your feet wet with the Arduino, and it looks great too.

Arduino

arduino_boardarduino_protoboardIf you have been following this blog at all you probably noticed that I have done a fair number of microcontroller projects. In my experience working with the PIC and AVR microcontrollers I ran into a number of issues:

  1. The PICBasic programming environment , while easy to learn, only works on Windows
  2. The C programming environment for the AVR requires more effort than I wish to put into a casual hobby enterprise and I have been unable to get it working in Linux

As I looked for more project ideas I noticed a lot of people using the Arduino development board. The Arduino is an open source hardware and software environment similar in concept to the BASIC Stamp (except it’s not expensive). Basically all the Arduino does is provide a standardized microcontroller board using the AVR ATMega168 processor and various power, I/O, and programming connections. They can be purchased as a completed board for around $35 (several versions of unassembled kits are also available). The biggest advantage from my perspective is that the Arduino software is truly cross-platform since it runs in Java and therefore can be used in Windows, Mac OSX and most importantly for me Linux.

One version called the Bare Bones Arduino removes the standard USB-serial adapter from the board itself and instead substitutes a FTDI USB-serial cable to connect the board to your PC. This is done to minimize cost since the adapter cable is a one-time $20 dollar purchase that can be used with an infinite number of compatible boards instead of paying for the adapter chip on the standard Arduino every time you get a new board. Another version of the Arduino called the Boarduino modifies the form factor of the circuit board into one more convenient for use on a solderless breadboard. otherwise it is essentially the same as the Bare Bones Arduino in that it also uses the FTDI adapter cable. Both of these boards are completely interchangeable with the Arduino.

While these are good products, I decided I wanted to build my own version from scratch to better fit my electronics setup. I used the schematic from the Boarduino website to base my design on, but I used the same form factor as the Bare Bones Arduino. Since I use a Graymark 808 Protoboard which has a built in power supplies I removed the power circuitry from my design. In its place I simply put two headers, one for +5V and one for Gnd that connect to the protoboard’s power supply (as shown in the pictures above). I also reduced the number of headers (which stab into the solderless breadboard) used to fit the Radio Shack PC board I used for my layout. I retained the power select jumper to choose whether the board is powered by the USB programming cable or the protoboard’s power supply. I also left the two indication LEDs, reset button, and the 6 pin ISP and USB programming headers as they are on the Boarduino.

Total cost for my homebrew Arduino was $9 (not including the USB adapter cable).

Having never dealt with the Arduino’s software package before, I wasn’t sure what to expect. It is a simplistic Java application which provides a very user friendly environment to write your programs (or sketches as they are called) in. The programming syntax used is similar to C, but the environment has many useful functions already built in so it’s very easy to do simple tasks such as set a pin as an output or toggle an output on & off. As someone who has used other languages, PICBasic for example, I can attest to how intuitive these functions are when compared to manually setting register ports in BASIC. Like in C you can also create your own functions and call them, making this a very powerful language despite its simplicity.

The installation of the Arduino software is fairly straightforward, even on Linux, and I encountered no issues. In Ubuntu it entails downloading the application from the Arduino Software page and following their well written instructions. These mainly involve installing Java and removing a package which inadvertently thinks the Arduino is a braille reading device and grabs your computer’s USB port. Left out of the instructions is an issue which caused me some problems; the Arduino software should be run with root privileges in order to gain access to the USB port and consequently the Arduino board. This is done by opening the terminal and executing the following commands:

cd /home/username/Arduino-0010 (navigates to the Arduino software’s folder)
sudo ./arduino (runs the Arduino software script with root permissions)

The application will now launch. Once running I selected my board under Tools – Board – Arduino Diecimila(currently the newest board design and bootloader) and picked my USB port under Tools – Serial Port – /dev/ttyUSB0. Since I built my Arduino from scratch, my ATMega168 did not come pre-burned with the Arduino Diecimila bootloader. The bootloader functions as a sort of operating system for the microcontroller, allowing you to transfer files over a serial port instead of having to re-burn the entire firmware every time you change your program, thus simplifying the entire process. In order to burn the bootloader I plugged my AVR programmer into the 6 pin ISP header on the board and selected Tools – Burn Bootloader – w/ USBtinyISP. The software displays its progress on the bottom of the screen and lets you know when it has finished burning the file to the chip. To check if the bootloader is running properly follow this guide (since the various bootloaders behave differently). Next I wrote a simple LED flasher sketch and after plugging in the FTDI cable I successfully uploaded the sketch to the board and it ran perfectly.