SparkFun JPEG Trigger

The SparkFun JPEG Trigger interfaces with the LinkSprite JPEG Color Camera to simplify picture taking. To take a picture, all you have to do is pull one of three digital pins to ground (D2, 3 or 4), or pull one of three analog pins to 5V (A0, 1 or 2). The on-board Arduino compatible ATmega328 is programmed to handle all the communication with the JPEG camera and the SD card.

The default firmware requires that a FAT16 formatted microSD card be inserted into the microSD socket. After you turn the board on, the status LED will turn on signifying the board is ready to be triggered. If the LED starts blinking, the SD card failed to initialize and you should make sure it's been formatted correctly.

Once the camera is triggered the board will capture a JPEG image and save it to the SD card. The file will be saved with a simple 3 digit number which is increment each time a picture is captured. While this happens, the status LED will start blinking. The camera can not be triggered again until the board finishes saving the current picture. After the JPEG Trigger has finished recording the image, the board will go back into the ready state and the status LED will go back to being solid. Each picture taken is saved as an individual 320x240 JPEG file. The files will actually carry the '.txt' extension, but they are actually JPEG encoded, simply change the file extension to '.jpg' in order to view them.

Power on the JPEG Trigger is regulated to 3.3VDC, and the on-board JST connector allows you to power the board via one of our LiPo batteries. There is also a 6-pin header on board which mates with our FTDI Basic Breakout board for debugging or other purposes.

**Note: **This product does not come with the JPEG Color Camera or an SD card, you'll need to purchase those items separately.

**Note: **Boards with the new firmware (below) will save pictures as '.jpg' files with the following format: "[name of trigger]###.jpg". If your board saves files as '.txt' they are still jpeg encoded, you simply need to change the extension, but if you like you can download the new source sketch and upload it to your board using the 'Arduino 5V/16Mhz w/ AtMega328' board profile.


SparkFun JPEG Trigger Product Help and Resources

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

1 Soldering

Skill Level: Noob - Some basic soldering is required, but it is limited to a just a few pins, basic through-hole soldering, and couple (if any) polarized components. A basic soldering iron is all you should need.
See all skill levels


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • KirAsh4 / about 11 years ago / 2

    For the next revision, may I suggest also adding the capability to offload the file. For example, have it with an ethernet port and you can have an internet enabled camera. Have the board take a shot, and offload it to the ethernet (via FTP possibly), OR depending on configuration, save it to the SD card, or maybe even both. Having a way to automatically offload the image file means you won't have to stop every so often to empty the SD card, and you can have a camera that can function forever, or till the electronics fail, whichever comes first.

    • SamL / about 11 years ago / 1

      Be interesting to try this out with an eye-fi card (the latest ones have "Endless Memory" mode).

      • JGuthridge / about 10 years ago / 1

        I think the Eye-Fi cards use a Fat32 format, and therefore wouldn't work with the setup. I'm not sure you can even get the 2Gig Eye-Fi anymore which would be required if you had non SDHC hardware to read and write to it.

  • Member #357213 / about 9 years ago / 1

    Hi guys - can I power the JPEG trigger by connecting the 1-5V pin to my Arduino Uno +5V? Or should I use a separate source...

    Also - I'm confused by the trigger pins, say for D2, do I need to hook up the 5V and GND or just the trigger pin?


  • Member #387372 / about 9 years ago / 1

    How can I send the text file created via serial or newsoftserail? So I can send the picture via Xbee and also have it saved.

  • Member #70149 / about 9 years ago / 1

    I can't tell from the previous posts if the "smoking" problem with the lipo is resolved on the DEV-10549 board. Also, are the two rows of three holes just above "Spark" for the AVI programmer? If so, which are which?

    One more thing; the source code mentions a "testing jig" and a test mode. I see no documentation on this. Is it available?

    Thanks in advance for your help!

  • Member #89899 / about 10 years ago / 1

    what might be happening? ... arduino v.1.02

    JPEG_Sample.pde: In function 'void setup()': JPEG_Sample:41: error: 'class MemoryCardDevice' has no member named 'begin' JPEG_Sample:62: error: 'class MemoryCardDevice' has no member named 'open' JPEG_Sample:73: error: 'BYTE' was not declared in this scope

  • Ted M / about 10 years ago / 1

    How long should it take to record a picture using the JPEG Trigger? I ask because I'm trying to decide if I want one, so I breadboarded up a prototype with an arduino, sd card & camera. While the system worked, it took about 30 seconds to record a picture. I admit that that could be due to a problem that I caused, but if that is the expected time required, it seems a bit disappointing.

    Also, I had to change some headers to get the software to work with Arduino 1.0; and I found a bug where the jpeg size was overflowing (it should be stored in an unsigned int). But, thank you so much, sparkfun, for the otherwise great source code!

  • Member #337342 / about 10 years ago * / 1

    We have done practices with JPEG Trigger board and LinkSprite JPEG Color Camera but we have found one problem that appear be reading memory card microSD. The problem with JPEG Trigger board consist in that blink red led even if we formatted the memory card is FAT16.

    We have used two memory cards: 1. MicroSD 1GB 2. SanDisk 2GB Both memory cards were FAT16 formatted as follows: 1. Windows format: FAT(predetermined) 2. Ubuntu: GParted > FAT16 format 3. SDFormatter software (on Windows): Format type > Quick, Format Size Adjustment > Off Despite testing, red led blink.

    Too, we downloaded the last source code for arduino that appears in this product web site. We upload this code to JPED Trigger. We perform same tests but this does not solve the problem.

    We do follow the code and found that the program ends in follows line:

    //Initialize the SD Card
    //If the card initialization fails, blink the LED and stop the program
        Serial.println(systemStatus); //Problem!!!    

    This means that memory memory card does not start well. Why can be this? What can we do for solve the problem?

    Thanks for comments.

  • Member #142426 / about 10 years ago / 1

    I've been trying to get this board to work but I haven't been able. The trigger is telling me that the microSD card is not well formatted, that the format must be FAT16, I have formatted the card using windows and the FAT option as there are only two options: FAT and FAT32, so I supposed the only FAT should be FAT16, but this is not working. Are there any special options or conditions to format the microSD card?

    On the other hand I have noticed the ATMega microcontroller in the board in getting pretty warm, is this normal?, or it may be a malfunction?

    Aprecciate your comments,

  • Member #227013 / about 10 years ago / 1

    I just got my 2nd board delivered after the 1st one acted like a toaster. This 2nd one took 4 pics and then did the same thing. To be exact - I took 2 pics, removed the card and checked them all out. Did the same again - no problem, put the card back in and turned on - toaster time.

    This is a 30 dollar dud product and should be removed until the problems are fixed. It is not ok to sell products with this kind of consistent problem.

  • As above, it seems the source code no longer works under Arduino 1.0. This line:

      MemoryCard.file.print(response[i], BYTE);

    Throws the error "The 'BYTE' keyword is no longer supported". It says that this is an Arduino 1.0 issue and to use Serial.write() instead. As suggested elsewhere, I tried changing the line to:


    Also, the included libraries throw a bunch of errors from the WProgram.h which, so far as I can tell, has been changed to Arduino.h. Changing all instances in the JPEGCamera and MemoryCard libraries seems to solve the issue. Finally, I'm getting this error and don't know what to do with it:

    In file included from JpegTrigger.cpp:39: /Users/jthompson9/Documents/Arduino/libraries/NewSoftSerial/NewSoftSerial.h:55: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)' /Applications/ error: overriding 'virtual size_t Print::write(uint8_t)'

    At the moment my board is a bit useless. Looks like the code could use a little love... :)

  • Member #279357 / about 10 years ago / 1

    Jpeg trigger and Jpeg camera are good. But The latest libraries won't work in arduino 1.0 . When will the code libraries updated for arduino 1.0.

    Also the atmega328p on jpeg trigger gets heated while under process. I have used 5volt DC supply for jpeg trigger. Why is at-mega328p heating beyond actual working noraml temperatures?.

    Also jpeg trigger make use of software serial to communicate with camera. Soft serial is little slower. Thus trigger takes time to get a picture. Again the chunk size is 32. Can I increase the chunk size to 64 or 72 or 80 to increase the speed of picture grapping process. Regards, P.R.B

  • gadget / about 11 years ago / 1

    Just starting to work with this board but a little gun shy to plug up the battery. Do we know if there is a fix to the shorting problem reported? Thanks.

    • Member #227013 / about 10 years ago / 1

      I just fired up one of these for the first time and "fired up" was not a pun. It got hot.

      This could be a disaster if it shorts out a lipo battery too much huh ?

      I need to know if there is a fix for this please spark fun. (hopefully a DIY fix).

  • Caasie / about 11 years ago / 1

    I bought a few days ago JPEG Trigger, but while I was testing the card with the Li-po battery, the card began to become very hot and emitted a burning smell and the led never caught.
    Also separately connect the FTDI and the LED starts blinking, and format the SD to FAT16 and does not change often.
    Check the continuity between 1-5 V and GND and continuity between these two pins, I think this should not be.
    Apparently there is a short circuit on the PCB.
    As I can solve my problem?
    Thanks for the support and excuse my English

  • Member #242868 / about 11 years ago / 1

    How do you load an edited source code to the jpeg trigger?

  • disabelle / about 11 years ago / 1

    is there a way so you can get a web cam and cut then usb off and solder it to this to wark insted of the 50$ camera you wants us to buy for this to work also could you add a pir motion sensor to trigger this?

    • No, sorry, it's only compatible with the JPEG camera. The JPEG camera has a serial interface (Web Cams do not), and it outputs compressed jpeg files instead of raw image data (which is what a webcam would do).
      As for adding a pir motion sensor, yes, it could be configured to work with the right pir motion sensor.

  • Facu / about 11 years ago * / 1

    Hi guys,
    i have a rare problem: the size returned by:
    count = camera.getSize(response, &size);
    is a negative number like -202453
    then, never enter to the while:
    while(address < size)
    then i get a 0 bytes .jpg files on my SD
    * i have the last code
    * the SD init its OK
    * the comunication with the SD its OK ( i tried write other files)
    * the comunication with the camera its OK (at least, the reset command return rigth bytes)
    this is one size response for example (the first 7 bytes its ok acording to camera datashet!):
    any idea?

    • Ted M / about 10 years ago * / 1

      Hah, I just ran into this problem. The solution is fairly simple, change the 'size' variable from an 'int' to an 'unsigned int'. You will have to change this in the JPEGCamera library as well as the arduino sketch.

      Sparkfun guys - can you fix this bug for us?

  • Member #95533 / about 11 years ago / 1

    What is the maximum size of the microSD card that I can use?
    I have a 2 GB card (formated with vista FAT(Default))
    Once I put in the microSD the Led goes out and never lights up again, also the board appears to get hot so I unplugged it after 2 minutes. I use the lipo battery PRT-00341 to power the board.
    Nothing is wired to the triggers and the camera is not plugged-in.
    I also had some kind of short problem with my first board that SFE replaced ( kudos for customer service :) )

    • Tadpole / about 11 years ago / 1

      Mine had some sort of short problem too. I can see exatly which chip smoked too. It worked fine with the FTDI cable attached, but on a normal li-po battery (3.7v 1A) the chip labled "BRR 98W Z345" smoked, and now has a tiny bubble on it. Cooked. Anyone have a suggestion why this could happen?

      • Tadpole / about 11 years ago * / 1

        The second board arrived and is having the exact same issues as the first one. I'm unsure as to what could be causing this. I was very watchful of my soldering, and I only powered it on for a few seconds with the li-po when that smell came back. Something is shorting the board, and I would think it is the same chip this time that is going to get fried. I contacted tech support and sent some pictures to make sure it isn't the porlarity of teh battery (I bought the battery at SFE).
        I'll let you know what happens.
        [and thanks PhillipH, I now learned that chip is actually a TPS61200]

      • Did you have the FTDI cable and the battery plugged in at the same time?

        • Tadpole / about 11 years ago / 1

          Nope. Just the battery. Polarity was correct too. I don't have to have the camera hooked up when I power it up, do I?

          • PhillipH / about 11 years ago / 1

            Definitely something wrong with these boards - mine fries the TPS61200 as well.

    • 2 GB is fine. I'm pretty sure the maximum is 4GB.
      Is your board getting hot, or just warm? You only have the battery plugged in right, not an FTDI cable too? It's OK if it gets warm. I use mine with the same battery and it's fine.
      The LED won't come on unless there is a camera plugged in. This is because the board doesn't go into the READY state until it's communicated with the camera. You can test if the board is running the code by turning the board off, removing the microSD card, and turning the board back on. The LED should start blinking indicating the SD card couldn't initialize. It might take a second or two though.

  • Member #227689 / about 11 years ago / 1

    I bought the jpeg trigger and the camera, I wired them and I powered the jpeg trigger with 5vdc (as is written on the board) at the terminals next to the battery block. When I powered it on the led lighted up and everything seemed ok (we didnt trigger it to take a picture)and the power consumption was 0. Then we powered it off and when we powered it again on we saw that the power consumption was up to 2,5A. What do you think happened?? Is something wrong?? Can we do something to fix it??

    • Please check to see if the trigger you wired up has somehow shorted the 5v and gnd rails that are located along the trigger inputs.

      • Member #227689 / about 11 years ago / 1

        No we didn't touch the trigger inputs and that's the strange that we only powered on the board with 5vdc and then we powered it off, and when we powered it again on we saw that something was wrong as the power consumption was 2,5A. The board doesn't work at all.

  • Tadpole / about 11 years ago / 1

    I plugged my 3.7v (1000mA) lipo in, and the thing started to stink like something was shorted. The LED never lit, and I'm really sad about this now. :(
    How do I return it?

  • Joe P / about 11 years ago / 1

    I ordered one of these a couple of weeks ago, and am finally getting a chance to take play around with it...
    I'd like to see the source, and that format isn't familiar to me. So, at the risk of sounding like a moron, what format is a .PDE file?

    • MikeGrusin / about 11 years ago / 1

      Here's a secret:.PDE files are actually plain ASCII text, so you can look at them with any text editor. The extension is vestigial from the Processing language.

    • Joe P / about 11 years ago / 1

      nm... downloading Arduino environment now...

  • Barring scanning the source code, what happens if you take more than 1000 pictures?

    • It'll break :( The code will get stuck in an infinite loop trying to name the new file. It would be very easy to modify to do your bidding though. Just change the '%03d' in the sprintf commands of the recordPicture function to '%04d' or however many numbers you want in there.

  • TimCole / about 11 years ago / 1

    It looks as though the ATMega328 can be reprogrammed through an ISP connector. Is there a loadable image file available for the as-shipped firmware?
    It would be very comforting to be able to reload the as-shipped firmware after mucking about with custom code.

    • The custom code was written with Arduino, and you can download the sketch above. If you only upload your custom code with Arduino, you can always revert back to the stock code by uploading this sketch.
      If you don't like writing code in Arduino, you can also get the hex file for the stock sketch by downloading the code and compiling it with Arduino and then just grabbing the hex file out of the temp directory.

  • Member #146603 / about 11 years ago / 1

    This product description indicates that it is powered at 3.3V. However, the product description for the LinkSprite JPEG camera says that it only works reliably at 5V, not at 3.3V. Do these then need to be powered separately?

    • No, you don't need to power them separately, the Jpeg Trigger has a 5V booster to power the camera and the microcontroller; the 3.3V regulator is for the SD card. There's also a voltage converter on board which allows the microcontroller to communicate with the sd card.

    • good question. when using a 3.7v lipo battery, everything worked just fine. we can look into it further and see what's the best way to use them, but a 3.7v battery got the job done in a real-world scenario.

      • tzankoff / about 11 years ago / 1

        I have a microcontroller that is powered by a 6v NiMH battery and has a 5v regulated power bus. For the sake of not using multiple batteries for multiple purposes, could I plug the JPEG Trigger into that 5v bus since it will get brought down to 3.3v anyway?

        • Maybe. The JPEG Trigger will accept voltages in the range of 1-5V. The 3.3V on the Trigger is regulated from the battery input, not the 5V rail (which is boosted from the battery input). So you may be able to plug the 5V rail from your system into the battery input of the JPEG Trigger; the only question is if the regulator on your system can handle the load.

      • Member #146603 / about 11 years ago / 1

        So, when looking through the comments on the LinkSprite, there was some indication that the problem was due to clock speed and communications mismatch. Is it possible to update the product description on the other item?

  • Member #51449 / about 11 years ago / 1

    What are the chances of this working with the eye fi cards?

    • Member #51449 / about 11 years ago / 1

      Sorry SamL. I didn't see you posted the same thing. Hopefully somebody will have an answer for us.

      • Member #246692 / about 11 years ago / 1

        seems the eye fi cards are only SDHC, while this takes microSD

  • mbrown9412 / about 11 years ago / 1

    why so many different choices for which pin to ground? are they all slightly different, or just to make it easier for more things to cause an exposure?

    • Protocol / about 11 years ago / 2

      I am assuming so you can have multiple triggers for snapping a picture. I want to make one with a capacative touch sensor on my garage door, a simple switch actuator on the inside lever (for when someone tries to lift it from the outside) and my favorite, and anti-graffiti spray paint can rattle detector (I am still trying to figure out how to do that on)

      • aknewhope / about 10 years ago / 1

        LULz let us know. That would be tricky. Analyzing sound, but I'm sure there is a IC that can do it.

    • Kamiquasi / about 11 years ago * / 1

      Presumably because the default firmware 'listens' on each of those pins:
      char cameraTriggered(void)
      //Find out if any of the digital inputs have been triggered.
      if((digitalRead(2)==LOW)||(digitalRead(3)==LOW)|| (digitalRead(4)==LOW))triggered=1;
      But each pin is broken out separately so if you customize the firmware you might be able to do something different with them.
      Which really makes me wonder why the following..

      The file recorded by the JPEG Trigger is actually saved as a '.txt' file on the SD card.
      ..applies. Given that it could be changed in the firmware to simply write with a .jpg extension:

      sprintf(fileName, "/%03i.txt", fileNumber);

      Edit: The latest source will save to .jpg. The different triggers have also been broken out in the code to give different status messages.

      • I actually tried using a .jpg file extension when I wrote the firmware, but for some reason no data would get saved to the file. I'm not sure if I was using an outdated version of the library, or if I was using it incorrectly. Either way, if you can get it to work let us know and I'll make sure the changes get into the next code version.

      • ?! Ya, I don't know about that one. I think it's a bug from a while ago (blame it on the intern!). We'll fix that line of code and get the next production batch recording to jpg.

Customer Reviews

No reviews yet.