Controlling camera shutter using I.R. remote

tt92

Member
The top trace is the one from the $1.90 six-in-one remote from Hong Kong.
The second trace is the one from picaxe.
Audacity does not pretend to handle input like this but the timing is measurable.
Edit: This is my second-last attempt and my trace is inverted. What I am outputting now has positive-going pulses.
 

Attachments

Last edited:

tt92

Member
Well, I've had another go. :)

You can adjust the IR LED current by varying the 100 ohm resistor. You could probably up the base resistor value without problem. And you could change the BJT to a 2N7000 mosfet, as Michael2727 suggests, too.

The base resistor and the 1N4148 diode provide AND logic.

Edit: You could probably drop the 100 ohm altogether by using a larger resistor on the base of the transistor. I know from experience that 100k on the base of a BC548 will limit the collector current to around 20mA or thereabouts. I'm not sure what 47k might limit it to, but you could have a play.

Another unknown is how a large base resistor might affect the PWM waveform that comes through to the transistor. The large resistor and any internal transistor capacitance might create an unacceptable delay, and kill the PWM signal.
I made this and the output looks the best I have achieved so far. Alas, the camera ignores it.
I will try altering the pulse length(s), perhaps with a bit of a loop, and see if the camera responds to anything.
I believe that the perceived brightness of the IR LED as seen in the camera display (as white) is an indication of the current flowing throught the LED. The brightness of the LED from this circuit is similar to the brightness of the hand-held remote.
I must be getting close.
 

boriz

Senior Member
Would this work?


When PIN starts to go high, at the point Q2 starts conducting, all the charge current for the cap is passing through the LED. When PIN gets to above 5v – (LED forward voltage + Vbe) The LED stops conducting. (the cap continues charging through Q2 be). This makes a very brief but high current pulse through the LED. When PIN returns to 0v, the cap discharges through R1 ready for the next pulse.

Adjust the value of C1 for pulse brightness. Adjust the value of R1 to fully discharge C1 during the PIN=0v intervals.
 

boriz

Senior Member
Or better still.


When PIN is low, the transistor is off and the cap charges via R1 to 5v. No current flows through the LED.

When PIN is HIGH, the LEDs cathode is grounded and C1 discharges through LED giving a bright, short flash.
 

boriz

Senior Member
When using this sort of high current pulsing of LEDs, the important thing is that the LED junction temperature doesn’t get too high. To start with, try R1=1k and C1=1nF. Then increase C1 until you get the flash you’re after. R1 should be chosen so as to fully charge C1 during the PIN=LOW periods. Keep the duty cycle as low as possible. You will prolly need a ‘scope to get it bang on.
 

jodicalhon

New Member
Good ideas, boriz, but a bit too much fiddling with R and C for my liking. The RC combination must not unduly affect the 38kHz PWM waveform while providing a high peak current. A quick breadboard of your second circuit suggests C1 ~ 10uF and R1 ~ 100 ohms for a peak current of around 50mA. Optimizing the result would need further substitution of values.

Similar, or better, results can be achieved without the fiddling with R1 and C1,

This is for 38kHz PWM @ 50% duty using the second circuit I posted, but omitting the 100 ohm LED resistor.

Using a 2N7000, with 10k on the base, gives an average current of 70mA, so a peak of 140mA.

A BC548 with 10k on the base gives an average current of 25mA, so a peak of 50mA.

A BC548 with 1k on the base gives an average current of 60mA, so a peak of 120mA.

Duty cycle changes could be used to vary the average current without affecting the peak.

The base resistor is necessary to provide AND logic in conjunction with the gating diode.
 
Last edited:

eclectic

Moderator
tt92.

When I built my Nikon circuit, it worked at short range.
Therefore, I can now "Amplify" the current, when I pinch one of the circuits offered.

However, your problem appears to be code.

More questions.

1. Can you post the program you are using?

2. Can you borrow, or gain access to, a "real" storage oscilloscope.
Then do accurate measurement and comparison of the two wave-forms.

e
 

eclectic

Moderator
I've just tried the attached circuit.

Works well. Quick, simple and cheap.

My two LED's in series, connected to 3V = ~23mA continuous current.
Obviously, other IR LED's will need to be tested, first.

e
 

Attachments

Last edited:

tt92

Member
tt92.

When I built my Nikon circuit, it worked at short range.
Therefore, I can now "Amplify" the current, when I pinch one of the circuits offered.

However, your problem appears to be code.

More questions.

1. Can you post the program you are using?

2. Can you borrow, or gain access to, a "real" storage oscilloscope.
Then do accurate measurement and comparison of the two wave-forms.

e
I will try to post the program.
I have no chance of getting to a decent oscilloscope.
 

Attachments

tt92

Member
Eclectic asked me to post my program. It occurs to me that I posted it as a .bas
Should I have posted it as, say, .txt?
 

BeanieBots

Moderator
Might be better to post it as code:

Code:
'G4pulsetest
'with PWM
'14-9-08 19:00
'Send a series of pulses to an infrared LED
 
symbol outpin = 4
symbol ledpin = 1
symbol startlength =  360                  'was     240             
symbol onelength   =  180                   'was    120                     
symbol zerolength  =  90                   'was     60                    
symbol silence = 60                       'Inter-bit pause
output outpin
'========================================
low outpin                                'set start status of outpin
pwmout 2,25,0
'=======================================
'delay in here. Red LED for three seconds
'for fiddling time
high ledpin
pause 2000
'==========================
pwmout 2,25,53
pause 1000
'==========================
'___________________________________________
low ledpin
main:

for b2 = 1 to 5
pulsout outpin,startlength
'538D F807 0101 0011 1000 1101 1111 1000 0000 0111

pulsout outpin,zerolength
pulsout outpin,onelength
pulsout outpin,zerolength
pulsout outpin,onelength

pulsout outpin,zerolength
pulsout outpin,zerolength
pulsout outpin,onelength
pulsout outpin,onelength

pulsout outpin,onelength
pulsout outpin,zerolength
pulsout outpin,zerolength
pulsout outpin,zerolength

pulsout outpin,onelength
pulsout outpin,onelength
pulsout outpin,zerolength
pulsout outpin,onelength

pulsout outpin,onelength
pulsout outpin,onelength
pulsout outpin,onelength
pulsout outpin,onelength

pulsout outpin,onelength
pulsout outpin,zerolength
pulsout outpin,zerolength
pulsout outpin,zerolength

pulsout outpin,zerolength
pulsout outpin,zerolength
pulsout outpin,zerolength
pulsout outpin,zerolength

pulsout outpin,zerolength
pulsout outpin,onelength
pulsout outpin,onelength
pulsout outpin,onelength
pause 100
'========================
next b2
'========================
'temporary endloop
endloop:
high ledpin
pause 100
low ledpin  
pause 100
goto endloop
goto main
Then people can scroll (or not) rather than having to download.
 

tt92

Member
How disappointing.
I have Googled for days (really! days!) and tried a dozen combinations of pwm frequency, duty cycle, and bit-durations. The cameras resolutely ignore all my efforts.
There is an answer, and there are people who know what it is, but I don't think I am destined to be one of them.
I am going back to my interim scheme whereby the picaxe switches a solid-state relay which turns on a butchered cheap remote from ebay. It is not elegant and offends me, but it works and the ghastly hardware is hidden inside a battery-box and will see the light of day only when I open it up to change batteries.
Thanks again to all who took an interest.

Tony
 

bgrabowski

Senior Member
I have managed to decode the Canon protocol with assistance of Duncan Louttit from Swallow Systems, a legend in micromouse circles. The bit pattern is as previously stated but both Header and Footer pulses are needed.

Header:
IR on for 9000us
IR off for 4400us

Bit Pattern:
Space between bits: IR on for 640us
Zeroes: IR off for 480us
Ones: IR off for 1600us

Footer:
Following last space
IR off for 40000us (40ms)
IR on for 9000us
IR off for 2120us
IR on for 640us

In the programme below the "on" times have had to be signficantly reduced to allow for the time it takes to execute the commands. The way I kept this manageable was to run at 8MHz and use Pulsout to an unused output pin.

The timings have not been optimised and may be at the extreme of their tolerances but I can confirm that the programme operated a Canon G5 with the same bit pattern as discussed in the earlier threads.

For practical applications I would suggest an interface which allows a higher current through the LED as the range is just a few cm from the camera with the set-up described in the programme.

Code:
'Canon Camera Remote for Picaxe 18X
'Version 1
'Oct 2008
'Bytes used 214
'
'Output Connections
'Pin 4 must not be used
'Pin 3 = PWM to base of Darlington BCX38B via 1K
'Pin 1 = Connection to base of BCX38B via 1N4148
'diode pointing towards Pin 1
'IR LED connected between +V and BCX38B collector
'via a 100R resistor
'BCX38B emitter to 0V
'
'Timing Data all in 5us units
symbol header1 = 1770
symbol header2 = 780
symbol space = 105
symbol zero = 25
symbol one = 242
symbol footer1 = 7786
symbol footer2 = 1780
symbol footer3 = 350
symbol footer4 = 120
'
'Programme
init:
setfreq m8            'set Picaxe frequency to 8MHz
'
start:
pwmout 3,52,105   '38kHz for 8MHz clock speed
low 1                   'IR LED off
pause 200            'arbitrary pause
'
pulse_stream:
pulsout 1,header1  'IR at 38KHz on for 9000us	
pulsout 4,header2  'IR off for 4400us
pulsout 1,space	
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,zero    '0
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,one     '1
pulsout 1,space
pulsout 4,footer1 'IR off for 40000us
pulsout 1,footer2 'IR on for 9000us
pulsout 4,footer3 'IR off for 2125us
pulsout 1,footer4 'IR off for 640us
pause 500         'arbitrary pause
end
 

tt92

Member
For the record.
I have used acrylic's circuit and the program from bgrabowski.The black box is a container for four AA cells with a built-in on/off switch.. The picaxe and its circuit fits into one of the battery slots and the other three slots are used for batteries. The little bump on the underside of the box near the front is the I.R. LED. It points in the general direction of the receiver in the front of the camera and works well.
Once again, thank you all. This is a friendly forum and I hope to be a continuing part of it.

Edit: I don't know how I posted such an enormous picture.
I have much to learn.
 

Attachments

Last edited:

tt92

Member
Some thousands of pictures later, on seven Canons, (four G2s, one G3, and two G5s) things are still a little confused. I am missing lots of shots. I am taking an exposure every ten seconds and most of the time it works but not always. If I look at the I.R. LED on the display screen of the camera, the flash is nowhere near as bright as the flash from the Canon I.R. remote. If I decrease the value of the 100R resistor between +V and the LED, the flash gets brighter. If I don't use any resistor, the flash looks about as bright as the Canon remote looks, and the device works as well as it does with 100R but no better.
The Canon remote seems to have a sequence of flickering flashes and my little device has one flash with no discernable flickering. Sending the pulse sequence two or three times in a row seems to make no difference to the hit rate.
Curiouser and curiouser.
 

eclectic

Moderator
@tt92.

Looking at the photo in your post #59.

IR LED's emit light forward, at angles of ~ 10' – 30'.

I wonder how much light is getting to the Canon's detector
and how much is "wasted"?

A couple of quick and reversible possibilities.

1. Make a simple reflector, using say Al foil. (R on the pic.).

2. Bend the bracket.

e
 

Attachments

tt92

Member
Surprisingly, it makes little difference.
I have aimed the LED at an angle, made a sort of cowl that reflected the beam, and in tests I have pointed the LED directly at the camera sensor from distances varying from an inch or two to about a foot. The hit rate is about the same in each case.
My first efforts were Heath Robinson contraptions that had the LED on a stalk dangling from the battery box and pointed directly at the sensor. I was quite surprised to find that the LED was equally effective pointing straight down. (as it is in my enormous illustration.)
I want to solve this because it puzzles me, but for the time being I keep reminding myself that the whole effort is aimed at geting good images of small, timid birds. So, in the meantime, I have three PIR movement detectors at different points around the target pond, all triggering one box that starts two cameras, each of which should take six pictures at ten-second intervals. So the hope is that the little guy will trigger at least one of the three sensors, and each of the two cameras should get at least some of its scheduled six shots. Some of these tiny little birds are in, bathed, and out, is a few seconds.
 

tt92

Member
Each of these Canons has a USB port. It is possible to control the camera and to download pictures to a laptop. Breeze Systems sells a program to do this, and we used it successfully for nearly two years to photograph lyrebirds, every ten seconds, unattended, for about 90 minutes each session until the laptop battery ran out. Back then the maximum capacity of a camera Flash Card was something like thirty shots. Now, with a two-Gig Flash Card, we can get a thousand shots in a session without the need for a laptop.
I could do away with all this IR remote control effort if I could only find how to activate the Canon shutter via the USB port. I don't want to control anything but the shutter, I don't want to download the image to a laptop. I imagine it is a matter of sending a series of pulses and someone knows what they are but no-one at Canon will tell me.
I asked, they acknowledged my request, got back to me in a week or so to tell me that they had "escalated" my query, and then after another week or so they emailed me to say they had "no answer" to my query.
Then they sent me a very involved multiple-choice form in which they asked me to evaluate their response.
I wonder if I got the picaxe to send the same pulses that the I.R. remote sends, but send them to the USB port. I wonder if I would destroy a camera by trying it.
 

hippy

Ex-Staff (retired)
USB is much more than a simple series of pulses even for something incredibly mundane. It's a full multi-byte bi-directional protocol with lots of handshaking and high-speed timing requirements at all times.

Yes, you could well destroy your camera ( or the parts of it ) by simply sending pulses into its USB port.
 

tt92

Member
The story so far.
We now have a total of six Canon G2s controlled by my little black boxes, together with two Canon G5s.
Originally, the I.R. signals were sent to the cameras every ten seconds, and if the camera missed one, it was twenty seconds between exposures. Now the signal is sent out every half second, and the camera decides when it is ready to accept a trigger. This means that the G2s now fire about every four seconds, and the G5s every three seconds.
We have various modified PIR doorbells triggering the pulse sequence, and instead of thousands of pictures of a birdless pond, we get hundreds of pictures, most of which include a bird or two.
Once again, thank you to all who helped me onto the right track. (Read that as "thank you to all those who did all the real work").
 

Ralpht

New Member
If I don't use any resistor, the flash looks about as bright as the Canon remote looks, and the device works as well as it does with 100R but no better.
The Canon remote seems to have a sequence of flickering flashes and my little device has one flash with no discernable flickering. Sending the pulse sequence two or three times in a row seems to make no difference to the hit rate.
Curiouser and curiouser.
Use at least 10R but not down to no resistor at all.

Is that flickering on all the time or only just as a prelude to something happening?
If it is only just before an event occurs, there might be more of a preamble in the data stream than what is assumed, and it might be important.

Also, in the past I have worked with IR and RF equipment that used a "Keep Alive" transmission to prevent the reciever from going to sleep (Stand by)

Could that be happening to the cannon if nothing is happening over some time? Maybe it is asleep and takes too long to wake up when an event occurs, therefore losing a few shots in the process. Some cameras take a long time to get from Off / Standby to Ready - some of them about 500 - 750 milliseconds.

Purely a wild guess but might be worth investigating.

Ralph
 
Last edited:

boriz

Senior Member
If you examine my circuit diagram, you can see that the IR LED will be on for only a tiny fraction of the actual ‘output high’ time. The Capacitor discharges very quickly. The point is that the LED gets a very high shot of current, much larger than the normal steady state maximum. This creates a MUCH brighter flash than just using a series resistor, even a very small one.

This is why your remote looks brighter. It’s probably using a similar method. With a modulated system like this, the actual pulse width is irrelevant, all that matters is the frequency and the peak brightness of the LED.

I built an LED strobe a few years ago. The 5mm white LED (nominal 3.5 vf, prolly 30mA max) was driven directly, through a power transistor, from a 9v PP3, with no ballast resistor. I never measured the peak current but it was prolly over half an amp. The pulses were very short and the LED junction had time to cool between pulses. It worked well. I took it camping and ‘froze’ my pee while relieving myself behind a bush :) Ahh, happy days.
 
Top