Archive for Circuit

Camera Axe 3.0

Purchase the Camera Axe at this store.

I’ve done a lot of refinement since releasing the original version of the Camera Axe.

The Camera Axe is a tool for photographers to trigger cameras or flashes based on signals from various sensors. In this version there are two ports for sensors such as a microphone, a motion detector, or light sensor; and there are two ports for camera/flash devices. The Camera Axe is useful for stop motion photography where an action happens too quickly for human reflexes (photographing a popping balloon, lightning, or a milk droplet splash). Other uses can be to catch things photographers don’t want to wait around for such as birds flying to a bird feeder or surveillance of people walking down a hallway. The possibilities are endless. The hardware and firmware for this device are all open source under Creative Commons Attribution 3.0 License meaning that it’s possible to adapt this platform for specialized uses.

Below are a few links important links for this project:

  • Build Guild – Detailed step by step information on how to build your own Camera Axe (includes full BOM and suggested part suppliers).
  • User Manual – Describes how the software menu works, lists sensor/accessors, and gives some example use cases.
  • Image Gallery – Pretty pictures taken with Camera Axe Hardware.
  • Dreaming Robots Store – My online store where I sell Camera Axe kits, sensors, and other accessories.
  • Firmware Source – Source code that controls the Camera Axe (designed to be loaded via Arduino bootloader).
  • Camera Axe PCB Eagle Files – Circuit board source files.

List of improvements for this version:

  • Decided to use smart sensors. This means instead of having a special port on the Camera Axe for a Microphone that has the amplifier built into the Camera Axe, I’ve decided to put the amplifier on the sensor. This gives maximum flexibility in sensor combination, reduces the number of ports, and makes it simpler to use the Camera Axe.
  • Flash and Cameras use the share 2 ports. This means you could use 2 flashes, 2 cameras, or one of each. In the original version you only had the option to use one of each.
  • Removed the active port LEDs. These didn’t seem too useful and I was running out of pins.
  • Added power transistors to control whether the sensor ports are receiving power. This is useful to turn off things like a laser beam sensor just before taking a photo. A way of controlling this was also added to the software.
  • A reset to factory default and a way to control LCD back light brightness were added to software.
  • Large clean up of software source to make using it and modifying it easier.
  • Left out the remote control option since it was expensive and had little demand.
  • Lots changes to the electrical components used to reduce cost and make assembly easier.
  • Much better documentation (Builders Guide and User Guide).
  • Added a store to sell it because of a demand for this from the original version.

Feel free to discuss this or other topics at my forum.

Some of those following this project might be asking what happened to version 2.0. I got to the point of ordering a batch of PCBs and I even built one. I had gone with the mentality that more is better. This monster had 6 ports and each port had a different task. While I was writing the software for this version I decided that it was going to be too confusing to use so I stopped working on 2.0.  A simplified 3.0 version was born which tried to add new functionality while keeping it simple to use.

Comments (36)

Cheap Arduino Wireless Communications

I was looking for a way to handle wireless communications between two Arduino boards. Other options like Xbee or Bluetooth were going to cost $50 to over $100. Then I found a cheap RF transmitter and receiver at Sparkfun. The total cost is only $9!

Here are a few limitations to RF solution:

  • Communications is only one way. If you wanted two way communications you’d need to buy two receivers and two transmitters which would raise the cost to $18. This is still cheaper than other solutions I found.
  • The variable gain on the receiver causes it to pick up lots of background noise. I had to do some processing with the Arduino to filter out this noise. More details about this below in the code section.
  • Bandwidth maxes out at 2400 bps, but there is a version with 4800 bps. A large portion of this bandwidth is used for network protocol I wrote that handles error detection.
  • Range is limited to a max of 500 feet.

The advantages are that it is cheap and it is pretty easy to use.

Below are some images showing how I hooked up the receiver and transmitter to two different Arduino boards. When wiring the receiver/transmitter you only need is to give them power/ground and then a pin for the TX (serial transmit) or RX (serial receive) pin. I also wired a button to the Arduino doing the transmitting, and used the LED on pin 13 that is built into my Arduino boards on the receiver so I could test this setup. The test app just flashes a button on the receiving board when a button is pressed on the transmitting board.

Here’s a picture of the my actual bread boarded circuit.

Code

Since the receiver is constantly picking up random noise I add a few extra bytes to every data packet. I add two bytes to signify the start of a data packet. Then I send the a byte address. This address allows multiple devices to work in the same area without interfering with each other. Next is the data (in my example code it’s an unsigned int (2 bytes). Lastly I send a checksum which is a simple xor of all the data bytes to make sure the data got received without being corrupted.

I broke the Arduino code into two files. If you’ve never used two files before with Arduino all you need to to is keep both files in the same directory and the Arduino IDE merges them for you. Here is the full code for the main application, and here is the full code that does the network error catching.

Increasing the Range

I did all of my initial testing without any of these improvement and everything worked fine with these devices inside the same room.

  • Add an antenna. All you need is a 23 cm piece of wire. I did this and it made it so I could reliably transmit data from one corner of my house to the other (3 floor town house).
  • Increase the voltage for the transmitter. The transmitter can use 2-12 volts. With 5 volts I got pleanty of range for my use case, but increase this if you need more range.
  • Reduce the baud rate. My test app runs at 1200 bps out of the max 2400 bps. You could drop this even further to something like 300 bps and that should help reduce transfer errors and hopefully increase range.

Thanks

I got a lot of help from the transmitter/receiver data sheets, and from this article.

I’ll mention an even cheaper idea I had while doing this. If you will always have line of sight between your devices you could setup something very similar to this with an IR LED and IR transistor. It would work like a TV remote. It won’t work for me because I want this to go through walls, but if line of sight is fine for you then you could use this code and an IR LED/transistor would probably cost under $3.

Comments (107)

Camera Axe

I made a new version of Camera AxeHere is my store where I sell them.

Camera Axe is open hardware and open software project that helps you get some of those difficult to capture photographs. It can use various sensors like light triggers and sound triggers to activate a camera or a flash. Here are a few sample images of the things this hardware has captured.

Here is a gallery with more pretty pictures. I apologize that some of them are a little blurry. I dropped and damaged my flash about a week ago and don’t have the funds to buy a new one right now. The flash now does a few micro pre-flash outputs before the full flash is triggered. This is is why some of the images have a weaker ghost images in them causing a blurry appearance. (UPDATE: Here is are some new photos I shot once I got my flash repaired. And here are some more.)

These are just a few images I’ve used to test this software/hardware. The possible uses range from taking pictures of wildlife while you’re not there to photographing a bullet piercing an apple. The fact that everything is open source offers advantages over solutions that are being sold today (beyond the cheaper price). As an example lets say you want to take pictures of wildlife at sunrise/sunset. You could modify the software so the light sensor only actives the camera at light levels that represent sunrise/sunset and then you could use the microphone to actually detect animal movement. Since the hardware is easily understood you can add new sensors as needed, one sensor I’ve thought about making is piezo pressure sensor.

Camera Axe Component List

Here is a list of the components you need to make Camera Axe.

Sparkfun
Break Away Headers $2.50
Mini Push Button Switch $0.35
Serial Enabled 16×2 LCD $24.95
16 MHZ Crystal $1.50
ATmega328 with Arduino Bootloader $5.50
DIP Sockets Solder Tail – 28-Pin 0.3″ $1.50
5V Voltage Regulator $1.25
Optoisolator with Darlington Driver – 1 Channel $1.25
0.1 uF Capacitor (4) $1.00
22 pF Capacitor (2) $0.50
10 uF Capacitor (3) $1.35
RF Link 2400bps Receiver – 315MHz $4.95
3-Pin Screw Terminals 3.5mm Pitch (2) $3.00
Super Bright LED – Green (4) $3.80
DIP Sockets Solder Tail – 8-Pin $1.50
Diode Rectifier – 1A 50V (2) $0.30
Custom Circuit Board PCB $21.43
Mouser
NPN Transistor (2) $0.54
Plastic Enclosure $7.62
3.5 mm Audio Jack (4) $1.40
Push Button Switch (6) $7.80
1M Ohm Potentiometer $0.90
Op Amp $0.33
9V Battery Holder $1.05
1/4 Watt Resistors * 47 (1) * 220 (4) * 1K (1) * 10K (14) * 100K (1) $2.52
McMasters Carr
#2 Spacer – 3/16″ OD, 3/16″ LENGTH (4) $1.04
#4 Spacer – 3/16″ OD, 5/16″ Length (4) $1.16
Undersized 4-40 Nut (4) $3.28
Undersized 2/56 Nut (4) $5.23
2-56 Bolt – 5/8″ Length (4) $4.64
4-40 Bolt – 3/4″ Length (4) $5.09
Total Cost $119.23

Getting the bill of material cost significantly under $70 should be pretty easy if anyone want to make 10’s of these. Many of the parts above start significant volume discounts at pretty low quantities. Also some of the hardware from McMasters I only needed 4 of something but I had to buy a pack of 100 so building multiple (or finding a supplier where you could buy 4) would decrease the price by about $15. You could reduce the cost the the PCB from $21.43 to about $6.50 if you ordered them in quantities of 17 from BatchPCB’s supplier Gold PhoenixPCB (I’d really suggest using BatchPCB until you know what you’re doing). Lastly, redesigning the board to use surface mounted parts would lead to large cost savings.

Camera Axe Hardware

I designed this circuit and PCB board in Eagle. Eagle is a powerful circuit and PCB design tool. You can get a free version for non-commercial use. This is the first PCB I ever designed and must say that Eagle combined with these four great Sparkfun tutorials (1, 2, 3, 4) really got me up to speed. I then sent my design to BatchPCB. It took a little over a month to get my test board back, but it worked great. Here are my eagle files for this project and the Girber files I sent to BatchPCB. If you install the free version of Eagle you can look at and modify my schematic and board layout. Below is a picture of this boards schematic for those who don’t want to install Eagle to look at it.

Being my first board I made a few mistakes with the PCB that I’ll correct if I ever print more boards. Luckily all my mistakes were minor and the board I printed works fine.

  • Rename “Light” to “Sensor” on the silkscreen since that is a better description.
  • One of the bolt holes is one grid point off center so I should make sure all the bolt holds are centered.
  • I should label the value of the Potentiometer on the silkscreen (1M ohm).
  • The silkscreen for the RF receiver is missing +5 for one of it’s pins.
  • The LEDs are too bright and the 220 ohm resistors should be replaced with something larger.
  • The schematic is correct, but the parts I used for the focus and shutter are ECB transistors.  These have an odd pin layout for transistors (1=emitter, 2=collector, 3=base).  Switch these to a normal transistor (1=collector, 2=base, 3=emitter).

After I got the PCB back, it was just a matter of soldering all the components in place. If others want to build this and want more detailed directions on soldering the circuit board components into place, I may be willing to write an instruction guide to assist in this.

Enclosure

To make the enclosure I designed the holds I needed to drill and the few places I needed to cut with my Dremel in Inkscape. Then I just printed that out onto some sticky paper and had the pattern I needed to cut out on the box. This worked out pretty slick. Here is the cutout pattern I designed (drill/cut template, final sticker template).

Software

I used an ATMega328 with the Arduino bootloader for my microcontroller. This means I could use the very popular and easy to use open source Arduino development environment. I used version 0014, but newer versions are usually backwards compatible with older ones. You can download the Arduino development software here.

In order to download software to this board you will need this programming dongle.

Here is the software I wrote for this project. I’ve created this video that demonstrates some of the features of this software.

Flash Trigger

Female Hotshoe (Cheaper ones available, but this one has is good quality) $16.50
3.5 mm Extension Cord $5.24
External Flash (I assume you already have one)
Total Cost $21.74

This allows you to plug the flash into Camera Axe. While Camera Axe can trigger your camera directly, if you need an instantaneous capture you should use the flash. This page gives the expected shutter lag for many cameras. The flash reacts to it’s triggering in well under a millisecond.

Notice: Camera Axe assumes you have an EOS compatible flash. Some older flashes use high voltages to trigger them. If you use one of these high voltage flash units you will likely blow Camera Axe’s optoisolater and need to replace it. I use a Canon 580EX flash, but there are many other options. Here is a list of flashes that should be safe.

Camera Trigger

Plug to trigger your camera (Price varies by plug (see below) under $5.00
Audio cord with 3.5 mm plug $3.15
Total Cost $8.15

The higher end Canon DSLR cameras (20D, 30D, 40D, 50D, 5D, 1D) have a a special Canon Plug called N3. I have not been able to find this plug for sale anywhere, but you can buy a cheap Chinese trigger for these cameras on Ebay for under $5 and use the N3 plug from it. I have a 30D so this is what I demonstrate here. Canon’s lower end cameras (300D, 500D, 1000D) use the much cheaper and easier to get 2.5 mm jack. I’m not sure what Nikon use, but I’m sure a little research will figure that out.

Sound Sensor

Electret Microphone $0.95
Audio cord with 3.5 mm plug $3.15
Total Cost $4.10

Electret microphones like this need some serious amplification. Luckily I put all that amplification on Camera Axe’s PCB. You can adjust the sensitivity of the microphone with the potentiometer on Camera Axe’s PCB. Just play with it until you find a sensitivity you like.

Light Sensor

Photo Transistor $0.42
Audio cord with 3.5 mm plug $3.15
Total Cost $3.57

Most photo transistors filter out visible light and only trigger on IR light. I did some searching and found this one that triggers on visible and IR light. This is nice because one of the uses I had for this was to use it in conjunction with a cheap $5 laser pointer (search Google or Amazon) to create a laser trigger. All you do is point the laser at this and when the beam is broken you trigger the camera or flash.

Another good use of the this sensor is taking pictures of lightning. It will make getting night time lightning less work and you can even get daytime lightning which is something human reflexes can’t manage.

Remote Control

RF Link Transmitter – 315MHz $3.95
Other parts ???
Total Cost ???

I put a receiver in Camera Axe so I could trigger it remotely. The transmitter I put in along with this receiver should have a range of about 200 ft, but I have not verified this distance yet. I did verify the remote works at closer ranges by putting together a breadboard circuit to verify it. The circuit is extremely simple since this device just needs power, ground, and a serial transmit wire to send the it the signal. Maybe I’ll make a nice remote someday, but until then you’ll need to design your own if you need this feature. Here is the Arduino software I used to test this feature.

Comments (76)

DIY Outdoor Time-Lapse Photography

Update: Check out my latest Camera Axe project for a much more robust device that handles this.

There is a beautiful overlook of Worcester Massachusetts near my home.  I wanted to build a weatherproof camera box that automatically takes one picture an hour so I can make a time lapse video of the changing seasons.  One requirement was to keep it cheap and already had a Fuji F30 point and shoot camera.  If I had a Canon Powershot I would have used CHDK, but instead I hacked this together using an Arduino and my F30 camera.

The basic premise is to run an Arduino as a timer and once an hour it turns on a relay.  The reason for the relay is minimize power usage while the Arduino is running as a timer.  When the relay is powered up the servo and camera also get turned on. Then the Arduino uses a servo to turn on the camera and take a picture.  A 5 volt regulator is used to make sure the system could provide enough current to the servo and camera.  After seeing how little current my camera draws, I realized I could have used the 5 volt regulator on the Ardunio board, but the regulator is cheap so there is no harm in using it like I did.  You want to make sure the coil on the 5 volt relay you choose uses less than 40 mA or you will exceed the max current draw from an Arduino pin which could damage the Arduino after extended use.  If you want to use a relay with a greater than 40 mA current draw you should use a circuit like I described in this article.

This project only cost me $20 for the cheap lawn mower battery because I already had the camera, Ardunio, servo, 5v regulator, power plug, wire, wood, and paint. If you had just the camera and Arduino then a trip to Radio Shack and Home Depot would get you the parts you need for about $25.

Here is a block diagraph showing my system.

Here is a test video I made with it. The software I used to splice together the jpg images was the free JPGVideo. The video was just a quick indoor test of the system. I set it to take a picture every two minutes and it took about six hours for the ice to melt. This gave me about 180 images that I converted to this video. Next, I am going to use it to record a hardwood floor installation and then I’m going to setup outside to record the seasons. If I get any really cool videos I’ll try to update this article with them later.

Some of the most interesting data I collected during this project was the current use from the 12 volt battery.  The current draw when the relay is off is only around 0.07 mA.  I had no idea the Arduino used so little power (0.84 mW)!  The current draw when the relay and servo are on is around 210 mA.  The current draw with the relay, servo, and camera is around 300 mA. But remember these higher current draws only happens for a few seconds while you are taking a picture.

Below are some picture of the box I made. Note that these pictures were taken before I put on a plexiglass cover over the camera.  You can see I put a cheap lawnmower battery in there.  I’m not sure how long it will last, but I ran it for over 2 weeks and everything is still fine.  I suspect it would run much longer.  Just doing some napkin calculations yield 0.07 mA * 24 + 300 mA * 20/60/60*24 = 42 mA per day.  These batteries don’t say how many Amp hours they hold, but I’d be shocked if it’s under 10 which gives me 238 days of use.  This doesn’t matter to me though since my memory cards need to be swapped out every 2 weeks.  Another option for longer run times would be attaching a small solar panel to this system.

Here is the Arduino code I used:

// Maurice Ribble
// 3-5-2009
// http://www.glacialwanderer.com/hobbyrobotics
// This program uses a servo to triger a camera to take a picture every x minutes.
// The code depends on the built in servo library.  Arduino version 0013 has it.

#include 

// This is the pin you need to attach the servo to (only 9 and 10 are valid)
#define SERVO_PIN           9
#define RELAY_PIN           2

// These are the servo values that correspond to camera controls
// These will need adjusting for each setup
#define CAMERA_ON           100
#define CAMERA_PIC          80
#define CAMERA_NUEUTRAL     90

#define MINUTES_BETWEEN_PICS 1

Servo g_servo;

void setup()
{
  pinMode(SERVO_PIN, OUTPUT);
  pinMode(RELAY_PIN, OUTPUT);

  // Use serial to help debug
  //Serial.begin(9600);
  //Serial.println("Setup");
}

void loop()
{
  static int minutes = MINUTES_BETWEEN_PICS; // Start with a picture so we know it's working

  if (minutes >= MINUTES_BETWEEN_PICS)
  {
    digitalWrite(RELAY_PIN, HIGH);
    g_servo.attach(SERVO_PIN);
    g_servo.write(CAMERA_ON);
    delay(5000);
    g_servo.write(CAMERA_PIC);
    delay(5000);
    g_servo.write(CAMERA_ON);  // My camera turns off if you press on again
    delay(5000);
    g_servo.write(CAMERA_NUEUTRAL);
    delay(1000);
    g_servo.detach();
    digitalWrite(RELAY_PIN, LOW);

    delay(44000);
    minutes = 1;
  }
  else
  {
    delay(60000);
    ++minutes;
  }
}

One future improvement I might make is to add a light sensor so I can take pictures only during a sunset. Anyone else have other ides for improvements? Let a comment with your ideas.

I left out some of the details like the power plugs I used for my camera because every camera will be different, but if you have questions just ask and I’ll do my best to answer them.

Comments (11)

Lightning Shutter Trigger for a Camera

Update: Check out my latest Camera Axe project for a much more robust device that handles this.

From Public DomainI knew there were devices that could trigger a camera to fire during a lightning strike, but their circuits were more complicated than I wanted to make. I’m a software guy not a hardware guy so I decided to use an Arduino and that allowed me to write a little code that made the circuit much simpler.

Before I got started I looked at this wikipedia article about lightning so that I could verify this project would work. It has a lot of interesting information about lightning, but the most useful piece of data in the wikipedia article is the time lapse shot of a lightning strike. From the time lapse photo I was able to determine the duration of a lightning strike is about 100 ms. Then from this page I found my Canon 30d camera has a shutter lag of 65 ms. I know from a past project that if I use a reverse biased photo transistor to detect light it has a response time under 1 ms. The last piece of delay is the software running on the Arduino board and since it’s running at 16 MHz I am sure I can run a tight loop that takes under 1 ms. Adding up all the delays, I get 67 ms which is still much less than the 100 ms duration of a lightning strike so I was pretty confident this would work before I started work on the prototype.

The circuit I used to detect the light from the lightning was a very simple circuit that looked like the above circuit diagram. I used a cheap infrared photo transistor because that’s what Radio Shack had. I noticed that the sun, my house lights, and lightning all pump out plenty of infrared light for this circuit to detect. If this circuit is not sensitive enough try changing the value of the resistor. Larger resistance values should help sensitivity when there is only a little infrared light and smaller resistance values should help sensitivity when there is a lot of infrared light.

I also needed a circuit to trigger the camera. I already have written a short tutorial about how to do that here.

The last thing I needed to do was write some software. At first I thought I’d just have a threshold value that triggered the camera. That would work, but I’d need to calibrate the threshold value to different values depending on the environment. Instead I have the software look for a rapid change in the amount of infrared light detected. This works great because lightning causes a very rapid change.

Here is the code.

// Maurice Ribble
// 6-1-2008
// http://www.glacialwanderer.com/hobbyrobotics

// This code uses my camera trigger and lightning detector.
// It waits for a sudden change in the light intensity
// and then triggers the camera.

#define SHUTTER_PIN 7
#define LIGHTNING_TRIGGER_ANALOG_PIN 0
#define TRIGGER_THRESHHOLD 5

int lightningVal;

void setup()
{
  pinMode(SHUTTER_PIN, OUTPUT);
  digitalWrite(SHUTTER_PIN, LOW);
  Serial.begin(9600); // open serial

  lightningVal = analogRead(LIGHTNING_TRIGGER_ANALOG_PIN);
}

void loop()
{
  int cmd;
  int newLightningVal = analogRead(LIGHTNING_TRIGGER_ANALOG_PIN);
  Serial.println(lightningVal, DEC);

  if (abs(newLightningVal - lightningVal) > TRIGGER_THRESHHOLD)
  {
    digitalWrite(SHUTTER_PIN, HIGH);
    delay(1000); // May want to adjust this depending on shot type
    digitalWrite(SHUTTER_PIN, LOW);
    Serial.println("Shutter triggered");
  }

  lightningVal = newLightningVal;
}

Here are a few example pictures from Adam Bell. He used this blog to make a lightning shutter trigger. Traditionally lightning is captured at night. This lightning shutter trigger could do that (while you sleep), but where this device creates new opportunities is photographing lightning during the day. Peoples’ reflexes just are fast enough to get pictures like these. Thanks for the examples Adam!

Here’s a link to John’s Flicker page where he’s used this method to take some really nice lightning photos.

Comments (94)

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »