Go Down

Topic: ATtiny 85 to trigger Canon camera using IR LEDs and laser tripwire (Read 4 times) previous topic - next topic

Manticorp

Hey everyone,

I'm using Arduino and ATtiny to trigger my camera using IR LEDs. I'm using the great library found here:

http://sebastian.setz.name/arduino/my-libraries/multi-camera-ir-control/

I managed to set up my Arduino fine as a trigger - whenever I trip the laser the camera triggers almost instantly (I think there's probably about a 1-5ms delay) and I even hooked up a mode switch (trip forever or trip once).

Here's the basic circuit (sorry for the basic schematic - just whipped up on a whiteboard):



However, when I try the code on the ATtiny, suddenly the camera no longer fires. I've tried plugging a normal LED where the IR LED is and I can see that it's firing - it's just not triggering the camera for some reason.

I've tried using 3.3V input and 5V input for the ATTiny and the IR LED but no dice.

Here's the device wired up:



My guess is the timing on the ATTiny isn't precise enough to trigger properly - but I have no way of testing this.

Does anyone have any suggestions?

I'd also appreciate any feedback - this is about the third circuit I've ever built (blink!) so any general advice would be great :) I'd really like to get this is a standalone item.

The good part is, it works fine with the Arduino!

johnwasser

Your schematic shows a transistor grounding the cathode of a diode connected directly to Vcc.  Is that the yellow LED?  Shouldn't there be a current limiting resistor somewhere in there?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

MichaelMeissner

If I recall the IR protocol, it flashes the IR light for precise periods.  It might be the library you are using is tuned towards 16Mhz, and perhaps you are running the ATtiny85 at a different speed like 8Mhz or 20Mhz.

Manticorp


If I recall the IR protocol, it flashes the IR light for precise periods.  It might be the library you are using is tuned towards 16Mhz, and perhaps you are running the ATtiny85 at a different speed like 8Mhz or 20Mhz.


Ah yes of course, I am running the ATtiny at 8Mhz! The code for the library shows this to fire the Canon camera:

Code: [Select]
void Canon::shutterNow()
{
for(int i=0; i<16; i++) {
    digitalWrite(_pin, HIGH);
    delayMicroseconds(11);
    digitalWrite(_pin, LOW);
    delayMicroseconds(11);
  }
  delayMicroseconds(7330);
  for(int i=0; i<16; i++) {
    digitalWrite(_pin, HIGH);
    delayMicroseconds(11);
    digitalWrite(_pin, LOW);
    delayMicroseconds(11);
  }
}


Does the delayMicroseconds() function depend on the speed that chip is running at then I assume? Would I be safe enough in just halving all the times to get the same effect without having to use a crystal do you reckon?


Your schematic shows a transistor grounding the cathode of a diode connected directly to Vcc.  Is that the yellow LED?  Shouldn't there be a current limiting resistor somewhere in there?


It is a yellow LED that I just used to visually test if the rest of the circuit was working, but you're right I should have had a resistor in there really! My bad.

Thanks for your help!

Erni

Maybe it is a timing issue due to the attiny using internal oscillator. The Arduino use a crystal .

You can tune the internal oscillator (I just don't know how, but Coding Badly has a TinyTuner)


Go Up