content/opentally.rst

changeset 125
669eb33e410b
child 128
aba381b2bac9
equal deleted inserted replaced
124:ed357d9b4845 125:669eb33e410b
1 ================
2 OpenTallyLight
3 ================
4
5 :Author: David Douard
6 :Category: Electronics
7 :Tags: ITC100, Tally Ligth, Arduino, Firmata
8
9
10 A month ago, a friend of mine called me to ask for help with a technical device
11 that seemed not to work properly.
12
13 He was testing with a friend some video recording setup. They use vMix_ to mix
14 (live) video streams from 4 (or more) vide cameras (Panasonic GH5 if I'm not
15 mistaken). They also have a DataVideo ITC100_ intercom system. Now the problem
16 was: how to control tally lights via the ITC100_ from vMix_?
17
18 Surprisingly there are not so many affordable solutions on the market.
19 Eventually, they found one device, made by a small US company, that would fit
20 the needs. It's the setup of this very device that was not working properly
21 when they called me.
22
23 TL;DR;
24 ======
25
26 Go to the `project's gitlab page`_ if you want the kicad project files.
27
28 _`project's gitlab page`: https://framagit.org/douardda/opentallylight
29
30
31 The non working tally light controller
32 ======================================
33
34 The device itself is a small-factor plastic box with a USB B connector, a LED
35 indocator, plus a pair of HD15 connectors (for the connection with the
36 ITC100_).
37
38 The first unsual fact was the LED indicator was not on. But that not the only
39 bizarre stuf:
40
41 - the USB device was sometimes identified by the PC, sometimes not (and no it
42 was not a bad contact),
43
44 - when plugged to the ITC100, some tally lights immediately lighed up but quite
45 dimly,
46
47 - and no attempt to change the current and preview streams did not change
48 anything on the tally light side.
49
50 So I grabbed the device home, opened it up and tried to identify a possible
51 problem. At that time, we knew the PCB had a problem (because of the LED
52 staying off), and the seller sent a new PCB (without the case to save a bit on
53 the shipment), so I was not too worried of hacking the dead PCB.
54
55 I discovered a short circuit between the pads of the LED, and this was
56 disturbing the 5V USB supply. In fact, depending on the hability for the USB
57 ports used on the PC to deliver enought current to actually power the
58 microcontroller or not, the device was seen by the PC or not.
59
60 I though this was the problem, so I just removed the LED and it's limiting
61 current resistor: no more over current on the 5V rail, the device was now
62 properly recongnized by the PC every time weplugged it in.
63
64 I also tried to understand a bit the circuit which was in fact dead simple: a
65 PIC18F4553 microcontroller is presented as a HID device to the PC and control
66 directly (via a resistor) the pins of the HD15 connectors.
67
68 So I tried to 'reverse engineer' the "control" protocol and since it was a
69 simple HID device, I just wrote a small Python script to try all the possible
70 addresses on the first 2 bytes, using pyhidapi_. And I quickly discovered how
71 to control individual pins connected controlling the tally lights (via the
72 ITC100_). On my Linux machine with a simple LED connected directed to the HD15
73 connector, it was looking like it was working.
74
75 .. _pyhidapi: https://github.com/apmorton/pyhidapi
76
77 But once plugged on the ITC100_, it was still not working. Same erratic
78 behavior, same total absence of actual control of the tally lights.
79
80 This time I had a multimeter with me, so I took measurments on the ITC100_
81 side: each tally light signal was at 12V! and had to be pulled down to ground
82 to light the corresponding tally light on.
83
84 Since the device was attempting to control directly these signals from the PIC,
85 no way this could have ever worked. And this was sold something like 650US$
86 plus shipment...
87
88 A first prototype
89 =================
90
91 So I explained to my friends there was no possible way of making this device
92 work as intended: it was just not designed correctly. Meanwhile, one of them
93 told me that vMix also have support for controlling tally light via
94 Arduino-based setups using the Firmata_ protocol.
95
96 .. _Firmata: https://firmata.org
97
98 Since the fiasco with the "professional" device they bouight, they were really
99 on the urgent need for a working solution, like for the day after, so I spent
100 the evening building a very rough prototype.
101
102 I wanted to provide them a better solution, besides a working one. Like with
103 proper galvanic isolation between the microcontroller and the ITC100_ part of
104 the circuit.
105
106 Since I had no time nor enough optocouplers in my stash of junk parts, so I
107 just used regular non isolated 2N2222 to control the ITC100_ tally light lines.
108
109 .. image:: {static}images/opentally/proto.jpg
110 :alt: A very rough protoype of OpenTallyLight
111
112 It's a very crude protoype, but i worked! Believe it or not, but they have been
113 able to record several events with this board!
114
115 A (slightly) better protoype
116 ============================
117
118 Since we validated the Arduino and Firmata based approach, I proposed them to
119 design and build a better device.
120
121 At first, I kept the idea of using an existion arduino compatible board and
122 only design a daughter board for the optocouplers and the connectors.
123
124 I chose the Sparkfun Pro Micro: it was one of the smallest board with enough
125 pins to drive the 8 tally lights (each with 2 LEDs, the green for preview
126 signaling, and the red for signaling the recording in progress).
127
128 So I designed a first PCB (in fact several of them, but meh) using Kicad_.
129
130 In the mean time, I also spent quite some time looking for a nice aluminium
131 enclosure for the PCB. I finally found a small extruded one for a 80x50mm PCB
132 on aliexpress. It was perfect, so I ordered 5 of them.
133
134 I also decided to replace the HD15 connectors by RJ45 ones, then assemblng
135 custom cables from shielded RJ4 Cat6 ones.
136
137 So I ended up with this design:
138
139 .. image:: {static}images/opentally/opentally-pcb-1.jpg
140 :alt: A slightly better design of OpenTallyLight
141
142
143 Looks neat, but... I did not realize I put the RJ45 socket backwards! Doh!
144
145 .. image:: {static}images/opentally/proto2.jpg
146 :alt: A (not so) better proto of OpenTallyLight
147
148 In order to test is nometheless, I put the Pro Micro on the back side of the
149 PCB (otherwise I was not able to plug the RJ45 cable in).
150
151 Unfortunately, if this board worked fine on Linux (I mean the Firmata protocol
152 part, since vMix does not work on Linux), the Firmata protocol on Pro Micro is
153 not working on Windows. vMix was not able to establish the connection with the
154 Pro Micro, neither did the Firmata test program available on the Firmata_ web
155 site. I'm not sure why it did not work on Windows, but I had no time nor the
156 desire to debug this Windows evil misbehavior.
157
158 I looked in my tray of development boards, and found a few Nucleo ones that are
159 supported by the Arduino environment and have almost compatible pinout with the
160 Pro Micro. I had to budge a pair of tracks on the PCB, but I could make it work.
161
162 OpenTallyLight
163 ==============
164
165 So I designed a new version of the board. This time I stick to a good known
166 working pair: an ATmega328P + FT232RL based solution (the Pro Micro is based on
167 the ATmega32U4 which embeds the USB controller).
168
169 I wanted to use a USB B connector rather than a micro USB one (too fragile for
170 this kind of environment), and since I also wanted the design to stay small
171 enough to fit in my cute little enclosures, I decided to implement the arduino
172 on the PCB itself.
173
174 The PCB design looks like:
175
176 .. image:: {static}images/opentally/opentally-v3.jpg
177 :alt: A better design for OpenTallyLight
178
179 Which gives, in real life:
180
181 .. image:: {static}images/opentally/front.jpg
182 :alt: Front side of the PCB
183
184 .. image:: {static}images/opentally/back.jpg
185 :alt: Back side of the PCB
186
187 And the result once installed in the enclosure:
188
189 .. image:: {static}images/opentally/complete-unit.jpg
190 :alt: The completed OpenTallyLight
191
192 .. image:: {static}images/opentally/enclosure.jpg
193 :alt: The completed OpenTallyLight (enclosure front)
194
195 .. image:: {static}images/opentally/enclosure-2.jpg
196 :alt: The completed OpenTallyLight (enclosure back)
197
198
199 The good news is it worked immediately. The bad news is I forgot to put an ICSP
200 connector on this PCB. So I had to burn an Arduino bootloader on the ATmega
201 chip before I soldered it on the PCB.
202
203
204
205
206
207
208
209
210
211
212 .. _vMix: https://www.vmix.com/
213 .. _ITC100: https://www.datavideo.com/eu/product/ITC-100
214 .. _kicad: https://kicad.org

mercurial