Electronics > Microcontrollers

help needed - connecting microcontroller and dslr


I have a problem connecting a microcontroller and dslr.
First of all, the code and the hardware was tested on nikon d5600 and everything worked.
20 days later, tested on nikon d5500 and it doesnt work. (It wasnt tested by me, but I was present there and it worked, so i need to figure it out why is not working for me).

So, I am using esp32 to connect via shutter release cable so I can remotely take a shoot. I am attaching shematics and some photos.

I need your help and here are some of my conclusions.
1. The wires broked so I had to soldered them again, which may be a reason of not working because I am not specialist in it, I am doing a software. As you can see on a photo, there are black, red and white wire. I used multimeter to check, there is no short circuit and every pin works. By that, it seems there is no problem, but not 100%.

2. When I run my code, the screen on the dslr gets black as its trying to focus (when camera wants to focus, it darks the screen usually), but in the end nothing happens, which tells me some of the signal is being sent. I discovered that red wire always send the signal. If I use pin of a red wire in the code either for a shutter or focus it darks the screen but when I use white wire pin for it, it doesnt. I am not expert in a hardware, so is that normal that red wire is used to only that part or the red and the white wire has the same function? Tought there might be a problem.

3. The cable might be a problem. I am using shutter release cable specific for this dslr model.

4. Maybe I need to turn on something on my camera. I tried with manual focus, with shutter release option...

I am sorry if i need to add anything else to make it easier.

According to this:


you ground one wire to make it focus, then ground both wires at the same time to fire the shutter.  I assume the black wire is the camera's ground, and it seems the red wire is for focus.  That would leave the white wire as the shutter trigger.

If it's for remote trigger only, there is an IR remote for Nikon, or you can DIY one.  Once, I've put an ATtiny13 MCU and an IR LED inside a cigarette lighter (the kind of lighter with a LED and batteries near the gas tank).  The advantage is that no wires are connected to the camera, so no risk to fry the camera with external voltages.

The code for the ATtiny13 microcontroller was written in BASIC, but it only pulses an IR LED, should be easy to translate that to C.  The original code can be compiled with the free version of BASCOM-AVR:

--- Code: ---'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Infrared Remote Control Transmitter for Nikon D90
' -------------------------------------------------
'  v0.2
'  Written by RoGeorge
'  2010.01.03
'  Compiler BASCOM-AVR v1.11.9.1
' Description:
' DIY replacement for Nikon ML-L3 Infra Red (IR) Remote Control
' After powering up the microcontroller from the lighter's button,
'  it sends a "TAKE PICTURE" IR command to the camera,
'  then enters in power down mode.  Turn it off from the lighter's button.
' It should work with:
'  Nikon N65, N75, Coolpix 8400, 8800, Pronea S, Nuvis S & Lite Touch Zoom,
'  Nikon D40, D40x, D50, D60, D70, D80 & D90 Digital SLR Cameras
' It works (tested) with:
'  - Nikon D90
' Schematic:
'  - 1 x ATtiny13
'  - 1 x normal open micro switch between batteries (push button)
'  - 3 x 1.5V SR41 (AG3) button cells as power source
'  - 1 x IR LED between OC0B (PIN 6 = LED anode) and GND (PIN 4 = LED cathode)
'  - NO curent limiter resistor is necessary for the IR LED
' IR LED waveform out (100% modulated with 38.4 KHz carrier):
'  -  2000 us on
'  - 27830 us off
'  -  390 us on
'  -  1580 us off
'  -  410 us on
'  -  3580 us off
'  -  400 us on
'  - 63200 us off
'  - repet once again the whole sequence
' Fuse bits:
' Low: -1101010
'  ||||||++-- CKSEL[1] Clock selection
'  ||||++-- SUT[1] Startup time selection
'  |||+-- CKDIV8 Clock division ratio (1:1/1, 0:1/8)
'  ||+-- WDTON (1:WDT normal, 0:WDT always on)
'  |+-- EESAVE (Retain EEPROM at chip erase 1:No, 0:Yes)
'  +-- SPIEN (1:Disable ISP, 0:Enable ISP) *Available only HVS mode

' High:---11111
'  ||||+-- RSTDISBL (RESET pin 1:Enable, 0:Disable(PB5))
'  ||++-- BODLEVEL[1] (BOD 11:None, 10:1.8V, 01:2.7V, 00:4.3V)
'  |+-- DWEN (On-Chip Debugging via RESET pin 1:Disable, 0:Enable)
'  +-- SPMEN (SPM instruction 1:Disable, 0:Enable)
' Cal: 75
' Bill of Materials:
'  - 1 x Cigarette Lighter with white LED for case, batteries and power switch
'  - 1 x IR LED
'  - 1 x ATtiny13

 $regfile = "attiny13.dat"
 $crystal = 9600000

 $swstack = 8
 $hwstack = 2
 $framesize = 0



'select clock prescaler to 1/1 (9.6 MHz)
 Clkpr = bits(7)
 Clkpr = 0

'Ports init
 Config Portb = Output

'TIMER init
 Config Timer0 = Counter , _
  Edge = Falling , _
  Compare A = toggle , _
  Compare B = toggle , , _
  Clear Timer = 1

 ocr0a = 13
 ocr0b = 0

'Other peripherals init
 stop adc
 stop watchdog
 stop ac

 declare sub pulse1

  waitms 63

  call pulse1
  call pulse1

  portb = 0
  disable interrupts


 sub pulse1
  start timer0
  waitus 2000

  stop timer0
  waitms 28

  start timer0
  waitus 390

  stop timer0
  waitus 1580

  start timer0
  waitus 410

  stop timer0
  waitus 3580

  start timer0
  waitus 400

  stop timer0
  waitms 63
 end sub

--- End code ---

Don't know if the IR remote is still a thing in newer Nikon models.  This one was tested with a Nikon D90.  Should work with any other Nikon camera that supports the original Nikon ML-L3 Infra Red Remote.

Yes, ESP32 should work, too.  The original IR remote (ML-L3) sends this sequence of IR pulses:

--- Code: ---' IR LED waveform out (100% modulated with 38.4 KHz carrier):
'  -  2000 us on
'  -  27830 us off
'  -  390 us on
'  -  1580 us off
'  -  410 us on
'  -  3580 us off
'  -  400 us on
'  -  63200 us off
' repeat once again the whole sequence
--- End code ---

In the ATtiny13 I've used a hardware timer to generate a continuous 38.4kHz square wave, 50% duty cycle at an IO pin.  Then, on another IO pin, the on/off signal with the listed above microseconds duration is sent by bit banging.  The LED is connected between the non-stop 38.4kHz pin and the on/off pulses pin.

You should add a series resistor with the IR LED, to limit the max current through the IR LED.  I didn't have a series resistor in my schematic because the button cells batteries used there were limiting the max current anyway.

I bet the software and schematic is already there if you search for "ESP32 ML-L3 Nikon remote".  Random search result:

Another one, with an Arduino code example.  IIRC the ESP32 boards can be used with the Arduino environment, too, and programmed from the Arduino IDE (often with no code changes needed between the many different types of Arduino hardware/boards).  https://goughlui.com/2013/12/06/teardown-and-project-clone-nikon-ml-l3-ir-remote-and-emulation/


[0] Message Index

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod