Maker Pro
Maker Pro

sampling communication lines without interfering the signal

Hermy

Jul 12, 2014
6
Joined
Jul 12, 2014
Messages
6
Hi guys,

i'm pretty new on this discussion board and i'm not sure if my question is in the good section. i'm a hobbyist, so trying to keep things simple and cheap.

i would like to use Arduino to sample (eavesdrop) on a hotshoe communication cable of a flash cable (camera to flash) so that i can intercept the the data packets used in the communication protocol.

by just tapping into the cables via a breadboard and sampling the line voltage state via
Code:
  pinMode(PIN_IN_HOTSHOE_CLOCK, INPUT);
i notice that the camera does not recognize the flash attached, and the flash does not recognize the flash trigger signal that is being sent.

therefor. are there electronic schema's that allow the sampling of the line state without interfering on the cable
(e.g. pulling the line low or high)

one thing to note here is, the communication is bi-directional, so an opto-isolater would not work.

thx in advance for pointing me into a good direction!

H.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
I am not familiar with the Ardunio but if it inputs are the same as a micro then you should be able to connect straight to the data lines. But how the data is transmitted I dont know, is it just clock and data? You may need the clock also to work out the data.
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Just looked up Hotshoe. Does it use data or is it a level? I noted you said data packet.
Adam
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
As long as the data line voltages are within the Arduino's power rails, and the I/O connections go straight to the AVR pins with no other components involved, connecting the Arduino to the data lines shouldn't cause a problem. It will add a little bit of capacitance but that should be all. Make sure the pins are set to input mode!

If you don't know much about the hardware protocol, it might be best to start with a logic analyser. You can get USB logic analysers for less than $100. Then you can figure out what peripherals (if any) you should be using in the Arduino to receive the data - for example, the SPI, UART, or input capture peripherals.
 

Hermy

Jul 12, 2014
6
Joined
Jul 12, 2014
Messages
6
Hi Guys

thx for the replies.

just to be sure that we are all talking about the same thing. ultimately i would like to use arduino to steer a hotshoe flash via the native communication protocol.

however, i am trying to implement this via the following information
http://cms.diodenring.de/electronic/microcontroller/110-ittlanalysis#physical_layer
-- you will notice that it's a rather slow communication protocol, so arduino would be able to capture the different state transitions


however, i notice strange behaviour in the communicatoin protocol so i would like to debug this somehow.
as krisblueNZ says, i would like to use my arduino in the first phase as a logic analyzer trying to capture the communication between the camera and the flash.

the camera / flash uses 3.3 v for logic level, whereas the arduino uses 5v.
i have a small component to do this level shifting (bi-directional). however, as said before, if i hook up my self made logic analyzer, the camera does not recognize the flash and cannot steer the flash via the communication protocol.

would it make sense to hook into the communication lines by connection them to a transistor (or mosfet?) in order to make sure there is a high impedance and thus not interfering with the logical levels of the communication lines?
what kind of circuitry does a logic analyzer use to resolve this issue?

thx already a bunch for your replies!

Herman
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Thanks for the link to that description of the interface and protocol.

He says that the circuitry uses a 4V supply, not a 3.3V supply.

A logic analyser has high-impedance inputs that won't affect the signals significantly.

Is it possible that your circuit is affecting the signals? What are you using to do the level shifting?

Can you look at each of the signals with an oscilloscope to see what voltages they use for high and low levels?

It might be best to use a quad voltage comparator such as an LM339 (http://www.onsemi.com/pub_link/Collateral/LM339-D.PDF). This will allow your circuit to monitor the signals without affecting them significantly, and you can set the threshold voltage for each input monitor to be half way between the nominal high and low voltages, for best reliability.

For clean data acquisition you should use some positive feedback to create hysteresis in the comparator. This will ensure that the output switches quickly and cleanly as the input transitions from one level to the other. See Figure 2 on page 4 of the data sheet linked above.
 

Hermy

Jul 12, 2014
6
Joined
Jul 12, 2014
Messages
6
Hi Kris, thx for the reply!

i'm using the following component to do the level shifting (Logic Level Converter Bi-Directional) -switching between 3.3v (hotshoe) and 5v(arduino)
https://www.sparkfun.com/products/12009

my apologies, a logic analyzer or oscilloscope are not really in my toolset at hand... (i know it should be :) )

thx for pointing to the circuitry of the comparator, i dont have the components at hand now, but i'll surely test it next weekend!

i'll keep you posted!

H.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yeah, that circuit will affect the signals. Here's what I suggest.

269351.001.GIF

This diagram shows four identical inverting buffers, with individually settable input voltage thresholds.

Inputs come in at the bottom left. The circuit's 0V rail must be connected to the 0V rail of the camera-flash interface. Outputs connect at the top right; the circuit must be connected to the 0V and the +5V rails of the Arduino circuit. The four outputs duplicate the four input signals, but they swing nearly fully from 0V to +5V. They are also INVERTED compared to the inputs.

Each comparator compares the voltage at its inverting ("-") input (from the circuit being monitored) with the voltage at its non-inverting ("+") input, and drives its output low if the inverting input voltage is higher. In the other case, its output is pulled up to +5V by the 1k pullup resistor.

The voltages on the non-inverting inputs are set mostly by the trimpots, but a small amount of the output voltage is fed back to the non-inverting input to create hysteresis, which ensures that the comparator will switch quickly and cleanly around the threshold voltage. Look up hysteresis on Wikipedia if you're not familiar with it. The values shown give a hysteresis (difference between rising and falling threshold voltages) of about 170 mV.

The transistor and speaker shown at the right may be useful when setting the input thresholds. Connect the resistor to each of the signals, and cause some activity on the camera. While activity is in progress, you should hear clicking, buzzing or beeping in the speaker, as it reproduces the signal activity. Adjust the corresponding input threshold trimpot in each direction until the sound stops, then set the trimpot about half way between the two extremes.

The LM339 comparators will compare voltages down to 0V but only up to (VCC - 1.5V) which in this case is 3.5V. You can't set the input threshold any higher than that. You could avoid this limitation by using a comparator with rail-to-rail inputs such as the Microchip MCP6544 (http://www.digikey.com/product-detail/en/MCP6544-E/P/MCP6544-E/P-ND/870263) or the Texas Instruments TLV3704 (http://www.digikey.com/product-detail/en/TLV3704CD/296-34485-5-ND/1669455, SMT only). (These devices both have a different pinout from the LM339 and they both have push-pull output stages, so the 1k pullup resistors are not needed.)
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
If the high signal is > 3V you should have no problem reading them on your Arduino without level translation.

Bob
 

Hermy

Jul 12, 2014
6
Joined
Jul 12, 2014
Messages
6
Hi Kris,

i finally got around to test your schema and it works well!

the camera detects the flash nicely and the communication paths are not interefered to communicate to the flash for firing commands.

now there just seems to be something strange with the arduino digitalread command that gives inaccurate reading results (even with stabil inputs -- pin to ground)
but i guess that'll be for another forum :)

many thx for helping me out there!

H.
 

Hermy

Jul 12, 2014
6
Joined
Jul 12, 2014
Messages
6
Hi All,

i've been tingling a bit futher with the setup. i've been able to successfully monitor the lines to sample the communication.

however, now i'm trying to implement a driver to communicate with the flash unit.

i notice that the lines are not always fully pulled to ground. i'm using a bi-directional level shifter to shift from 3.3v to 5v (arduino mini pro 5v), but i'm measuring about 1,82v on the 5v side of the level shifter when the line is inactive. the Arduino reads this as a logical "1" (arduino DUE aswell as the arduino mini pro 5v)

is there some circuitry that would allow me to maintain the bi-directional aspect of the communication, while forcing the line to '0' to make sure the reading is correct?

on the url as mentioned earlier (http://cms.diodenring.de/electronic/microcontroller/110-ittlanalysis) there is a whole circuitry proposed, but i'm a bit surprised to find fet's and transistors in there... would it be possible to solve this issue with only the zener diodes as proposed by the circuit?

looking forward to your insights on this!

Herman
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
What's the bidirectional level shifter IC you're using?
 
Top