8 years, 11 months ago.

use the mbed as a switch with no additional components

I'd like to use the mbed to trigger a Canon camera using the camera's remote shutter input. This remote shutter input consists of three wires: a) FOCUS, b) SHUTTER, c) GND. The remote shutter works by, first, shorting the FOCUS to GND, waiting a delay time (e.g., 100 msecs), and then shorting the SHUTTER to GND. This works for a Canon remote shutter where the input connector to the camera is a 2.5mm stereo jack.

This can be mechanized with a transistor switch. However, is it possible to implement this using the mbed device with no external components, just by connecting the three remote shutter wires to the mbed pins?

.. Jim

I measured the voltage between the camera focus and camera ground and its 3.3V. Same for the trigger wire. I can short the focus wire to ground and see the camera focus and then the trigger wire to ground and see the camera fire a picture.

So I connected the camera ground to mbed gnd and the camera focus to pin 27 and the camera trigger to pin 28 (I2C pins). Put p27 and 28 into DigitalInOut. Started a Ticker to cause the triggers to occur every 3 secs. The focus is supposed to be shorted to ground for 20msecs, followed by a 100msec delay, and then the trigger is shorted to ground for 20msecs. This works fine in another setup using a transistor switch. For this case, I get a good trigger once at the start, and then I get no further triggers. Any ideas?? Jim

Below is the code:

<<code>>

  1. include "mbed.h"

DigitalInOut focus(p27); DigitalInOut trigger(p28); DigitalOut led(LED1);

Ticker FocusEvent;

void FocusEventAction(void) { led = 1;

focus.output(); focus = 0; wait(0.02); focus.input(); focus.mode(PullNone);

wait(0.10);

trigger.output(); trigger = 0; wait(0.02); trigger.input(); trigger.mode(PullNone);

led=0; }

int main() { focus.input(); focus.mode(OpenDrain); trigger.input(); trigger.mode(OpenDrain);

perform the focus event at 2 sec intervals FocusEvent.attach(&FocusEventAction, 3.0);

led=0;

infinite loop where the focus/trigger events will occur every 2 secs while(1) { }

} <</code>>

posted by james kain 31 May 2015

3 Answers

8 years, 11 months ago.

Since I think all your targets are 5V tolerant, it should be fine as long as the open voltage of the device is 5V or less.

Then you can make a DigitalInOut as OpenDrain output. Or alternatively switch it between PullNone input and low output.

8 years, 11 months ago.

the NXP series ('812,'1768) that I am familiar with have an open drain (open collector?) on the I2C pins. usually 20ma capable current. They might have a weak pull up function- but I'm not sure [many of the Digital pins have pull up/downs available]

8 years, 11 months ago.

The mbed outputs may be used to control the camera directly as long as the voltage and current stays within the safe limits. The camera switch input is probably pulled up to a relatively low voltage (check that). However, note that mbed/NXP inputs are 5V tolerant only when the mbed is powered on. Connecting mbed and camera or other devices and switching them on/off independently may still lead to damage. Also note that plugs or pins that you touch may be damaged by static electricity. Protection (eg resistors, diodes) is needed and it makes sense to use a low-cost and easy to replace external transistor driver instead of exposing an expensive mbed to possible fatal danger. The LPC1768 I2C0 does have open drain outputs, but these pins are not accessible on the LPC1768 mbed. The I2C pins that are exposed (eg p9/p10) have weak pull-up outputs.