We explore all kinds of technologies, starting from programming, electronics ending in the photography sector. A bit for everyone.

Friday, September 22, 2017

Arduino: Char Array Problems

While programming an embedded system based on ATmega328p, I have encounter some char array problems in the C programming language.


I had a char array of exactly 8 chars ending with /0:
char a[] = "///////0";
It had trouble reading a[0] many times. For some still unknown reason, when I had:
char a[] = "10000000";
it would corrupt some memory addresses close to the array and it never work as I wanted. The problem is not the '/0' at the end. '/0' it's NOT the null terminator (NUL character in ASCII). The null terminator is '\0'. I tried this with both, the C compiler in the Arduino's native IDE and the C compiler in the Atmel Studio 7 (with the Visual Micro installed) and it was the same exact thing. So, what's wrong? I still don't know, but I'm writing this blog post, because I fixed the problem by adding a random character in the front and in the back that would be never read by any actual code. Just for storing purposes. I can't reveal the whole code, but because of the trouble that I went through I don't recommend using char arrays now at all... :D

The solution code for me was:
char a[] = "/10000000/";

- Mitko
Share:

Tuesday, September 19, 2017

Make a Shutter Release Indicator for any camera!

Following my previous post, I have done and tested a little schematic for a indicator whenever the shutter actuates (whenever the shutter is released). Check the demo video here.

So, we know that the CENTER PIN on the hot-shoe is connected to the GROUND whenever the camera takes a picture (when opening and closing the liveview, that doesn't happen). This automatically triggers the flash. There is a little catch that I explained in the previous blog post.


But this schematic is just good enough for successfully indicating a shutter release. 

As I discussed in the previous blog, the camera keeps the CENTER PIN connected to the GROUND until there is no current flowing to the CENTER PIN i.e. the flash is already triggered. That makes the situation a little bit complicated, so to workaround this issue I have put Q1 transistor to pull the current through the LED to the ground whenever the flash is trigger. That way the LED will flash just for few milliseconds. (I think the schematic is understandable, for any questions, leave them in the comments.)

Some schematic notes:

  • The switch in this virtual schematic acts as the flash triggering IC in the camera. There is no switch in the real world.
  • D1 is the LED which indicates the shutter release. You can put a series resistor for current protection, but because that's just 3V and a small pulse, I had no current limiting resistor.
  • R2 is a current limiting resistor for both, the Q2 and when the shutter is released, the R2 is directly connected to GROUND.
  • R1 is a current limiting resistor too.
That's it! You now have a shutter release indicator that could be used for wireless remote triggering!

Camera used: D5200
Software used to create the schematic diagram: Circuit Wizard

See you next time!
- Mitko
Share:

Sunday, September 17, 2017

How does a DSLR trigger a manual flash unit

If you want to detect a shutter actuation or build a DIY wireless flash trigger, it's not as straightforward as it seems, there is a thing you would need to have in mind.

A week ago, I got my first manual flash (from late 80's). I was worried about putting it on my DSLR, because on few places I read that the so-called "trigger voltages" of some old flashes are 250V which would certainly damage the sensitive electronics in my DSLR. So, I measured the voltage that the flash unit gives between the CENTER PIN and the pin on the side of the hot-shoe mount (GROUND PIN). The voltage was just over 12V, I decided to risk it and put the flash onto the DSLR. And... It worked perfectly fine!

Having a manual flash with just two pins, made me wonder what would it take to trigger the flash with (let's say) Arduino Nano remotely from the camera. From an online schematic, I learned that the flash gets triggered by connecting the CENTER PIN to the GROUND PIN. That easy! It is essentially completing the circuit on one of the transformers side, so the other can light the lamp very brightly. I guessed that there is a transistor in the DSLR that simply connects these pins together.

NOTE: Online I found other schematics which suggest very high voltages through the CENTER PIN, which could be bad for ordinary low voltage low amperage transistors. (That's if you want to put a transistor in between).

Going further, I wanted to learn is this all there is to it (when the camera shutter goes down, the flash is triggered for few milliseconds and than it should go back to normal). But what I discovered is a little bit different...

Here's how I hooked up an LED with a simple 3V battery supply that was acting as a charged flash unit through R1 (47Ohm) directly giving power to the CENTER PIN.


I inserted the modifies hot-shoe on my Nikon D5200 and actuated the shutter once. As predicted the LED turned off, but I guessed just after few milliseconds it will come on again (just like a quick pulse). That never happened. The LED didn't come on until I restarted my power supply. Here's a video of the whole action: https://www.youtube.com/watch?v=Z2YFKX_Ie7E

So what this tells us, is that the camera is pulling through the flash's trigger voltage until the flash is empty (in our case with the battery acting as a flash, until I turn the battery off, the camera is still going to pull the voltage to the ground and not give any to the LED) Then it stops, and of course that flash's going to recharge again. 

If you want to see the LED flash, you would need to use transistors to restart the battery voltage. I don't have currently time for creating a schematic, but it's going to be fairly easy. I just wanted to learn what the camera does and in the future maybe build a DIY wireless flash trigger.

Some other day, I may extend this. It was just a simple learning project for today.
- Mitko
Share:

Contributors

Powered by Blogger.