CHDK tutorial for RC AP - Scripting and remote USB triggering
Posted by: Paul René Jørgensen in CHDK, Photography, Programming, tags: ap, canon, CHDK, hack, rc, remote, scripting, trigger, usbThis is a small tutorial describing how to use a RC gear to trigger a Canon Camera loaded with the CHDK add on firmware. Using CHDK enables you to write scripts that can run triggered by a 4 volt current on the USB port of the camera.
List of parts:
- 1x old servo
- USB mini-B cable
- RC-transmitter
- RC-receiver
To make an remote controlled trigger I started by disassembling an old HXT 9g servo.



Be very careful not to destroy any of the wires. I removed all the gears, but kept the pot wires attached so I could adjust the center point.

I then removed the two green wires and used a multimeter to determine the polarity. Then I connected the wires to a spare USB mini-b connector.
![]()
There are 4 types of USB connectors. The Canon cameras using the Mini-B type. The pin descriptions according to Wikipedia are described in this table.
| Pin | Name | Cable colour | Description |
|---|---|---|---|
| 1 | VCC | Red | +5V |
| 2 | D− | White | Data − |
| 3 | D+ | Green | Data + |
| 4 | GND | Black | Ground |
Connect the positive servo motor cable to pin 1 (red wire) and the negative motor cable to pin 4 (ground). You should check and double check your wiring using a multimeter. Attach a receiver and battery to your servo and test that giving you’ll get about 4.2 volts on one side of the stick and -4.2 volts on the other. Remember the correct stick movement to generate the positive voltage. If your transmitter is programmable, remove the stick movement that gives your the negative voltage or be very careful when using remote trigger.
Now it’s time to upload a script to your camera and check if it all work.
@title Remote button :loop wait_click 1 is_key k "remote" if k=1 then shoot goto "loop" end
Create a file in /chdk/scripts/ folder of your SD card called remotetest.bas and enabled it in the scripting menu of the camera (after enabling the ALT-menu).


Attach the cables and power up the transmitter, receiver and servo. Hit the shutter button on the camera to start the script and then use the stick on the transmitter to trigger the running of the script.
Congratulations! You now have a non-mechanical way to trigger your CHDK enabled Canon camera.



Entries (RSS)