Very simple LANC controller - Page 1
Forum section: electronics / beginners

author: salamander
author_rank: Contributor
timestamp: September 15, 2014, 04:32:56 pm
content: Hi, I'm seeking a bit of advice.I would like to design and build a simple LANC controller, it's just a simple pushbutton and an indication LED (maybe two color - ready/recording).The priority is low cost and small footprint.My problem is the choice of the Microcontroller, I have some experience with Atmel chips, so I was thinking about an AtTiny ... could anyone help me?Thanks a lotI looked overhttp://www.boehmel.de/lanc.htmso I kind of know what I'm dealing with.

author: fcb
author_rank: Super Contributor
timestamp: September 15, 2014, 04:52:48 pm
content: You can do LANC with pretty much any micro. I used to make a LANC product (it did more than just LANC) and that had an PIC18Fxxxx micro in it - you can do LANC with a PIC10F if you want.

author: salamander
author_rank: Contributor
timestamp: September 15, 2014, 05:00:49 pm
content: Thanks for answerI'm just curious, I've read some articles on the internet about controlling LANC and I have 2 questions:1) Is the micro fast enough to not just send the command, but also read back the data from the cam?2) I read about timing issues with different cameras (Sony/Canon), do you have any experience with that?

author: fcb
author_rank: Super Contributor
timestamp: September 15, 2014, 07:07:21 pm
content: 1. Yes, even if you bit bang the interface. From memory it's only 9600 (I did the project perhaps 10years ago).2. Yes, there is a small difference HOWEVER if your implementing basic functions (I was also reading TC) it should be fine.

author: babysitter
author_rank: Frequent Contributor
timestamp: September 16, 2014, 07:55:59 pm
content: Old but might be a reservoir of information what Mijo K did years ago...http://lea.hamradio.si/~s51kq/DV-IN.HTM

author: Richard Crowley
author_rank: Super Contributor
timestamp: September 16, 2014, 07:59:25 pm
content: http://www.boehmel.de/lanc.htm

author: salamander
author_rank: Contributor
timestamp: March 21, 2015, 05:33:17 pm
content: Hi guys, I need to revive this topic.I have a semi-working remote, but I ran into a problem. The thing is, when the camera is powered down and has the display closed and I power it up via the remote (by pulling the data line low) the camera only powers up for a few seconds and then shuts down.I have a hypeye controller here, which keeps the camera on when its plugged in, I actually probed the it and found the data line, which is sending some data in byte 2 and 3, but I am unable to find out the scheme, because it isnt sending it all the time and the commands are changing.Does anybody know how to keep the camera on by LANC commands?

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 21, 2015, 11:22:07 pm
content: What camera? Keeping the identity secret probably won't be very helpful.It seems quite possible that the camera simply assumes that nobody would want to use it with the display closed, and there is no code to countermand that assumption. it may be just the way the camera was designed and has nothing to do with LANC.Some cameras also have a small viewfinder (eyepiece) and pulling it out serves the same purpose as opening the display.

author: albert22
author_rank: Regular Contributor
timestamp: March 22, 2015, 12:10:00 am
content: Wow. I am surprised that somebody is is still using lanc, I implemented it about 15 years ago on a 16c84 and then ported to a 16f84, for a sony camera TVR66 with nighvision that was new at that time. Following the same page that you linked. At that time there was another page with more info about the protocol.As far as I remember the power on was done by pulsing the data line low by 16mS (an entire frame) and then on again. And the power off by sending a specific command (5e). I think that the camera stayed on for several minutes without sending any commands.

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 22, 2015, 12:17:00 am
content: Quote from: albert22 on March 22, 2015, 12:10:00 amSony cameras, from consumer to semi-pro continue to use LANC extensively.

author: salamander
author_rank: Contributor
timestamp: March 24, 2015, 12:38:10 pm
content: Quote from: Richard Crowley on March 21, 2015, 11:22:07 pmMaybe I wasn't clear on this.So I will try to explain againI have a working controller - a Hypeye D Pro, which is able to keep the camera (Sony HDR-CX105) powered on, even in "closed" state. I was able to probe the command lines and found out that the controller is sending some data to camera in byte 2 and 3 (normal commands are sent in byte 0 and 1).So, I am trying to reverse-engineer this to my controller, but I have no idea what commands to send and when (It seems random at first glance, but it has to have some sort of scheme).I also found this pagehttp://www-e2.ijs.si/damir.vrancic/personal/TRV900/Cameras/default.htmWhere the guy writes about sending 0x43 and 0x53 to the camera.Thanks for any ideas

author: salamander
author_rank: Contributor
timestamp: March 29, 2015, 02:27:40 pm
content: So, I cracked the "keepalive" packets, but I would like to ask if anyone can help me with my circuit design.I would like to be able to turn on the camera via the REC/PAUSE button, but I simply don't know how to design that circuit.so:while the camera is turned off, the data line is +1Vto turn the camera on, I need to put a low resistance/short between the data line and ground (pull the data line low)after that the camera sends +5V on the power lineso, is it possible to pull the data line low with the rec/pause switch, without interference to it's current functionality?thanksI attached my current circuit

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 29, 2015, 03:19:07 pm
content: You could put in a tiny relay that would connect the pushbutton switch directly across the data line when there is no power.Then when the power arrives, it can pull in the relay and connect the pushbutton to the Arduino input pin.Athough I am rather surprised that you can draw enough current out of the LANC port to power an Arduino.

author: salamander
author_rank: Contributor
timestamp: March 29, 2015, 03:45:38 pm
content: Yeah, it works with Arduino just fineI was thinking about a relay, but I will need to "shrink" my design to be as small as possible (port it to ATTiny) and I'm afraid a relay would be too big. Isn't there a "smarter" solution?

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 29, 2015, 05:34:31 pm
content: There are relays the size of a DIP IC. An alternative might be a depletion-mode ("normally on") FET.

author: salamander
author_rank: Contributor
timestamp: March 30, 2015, 08:59:15 am
content: OK, i will look into it. Still hope I'll find a simpler solution.And I will share my "keepalive" packet solution as soon as possible, stay tuned

author: salamander
author_rank: Contributor
timestamp: April 27, 2015, 07:19:08 pm
content: I attached the circuit design I'm using.Can anyone help me choose the device I need? JFET or tiny relay ? I was searching for something I could use, by came up with nothing.It needs to connect the button to data line to pull the line low, then, when the camera is activated, disconnect the button from the data line.Thanks guysEDIT: anything I could use from this shop?http://www.gmelectronic.com

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 27, 2015, 07:49:34 pm
content: http://www.gmelectronic.com/rr1u05-200-ece-p634-395

author: salamander
author_rank: Contributor
timestamp: April 27, 2015, 08:17:47 pm
content: Quote from: Richard Crowley on April 27, 2015, 07:49:34 pmThank you so much, I wasn't even sure what I was searching for.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 27, 2015, 08:28:32 pm
content: You are welcome. I assume you can figure out how to connect it. With the coil directly across the camera GND and +5V, then the relay will activate when the camera powers up. Then you can use the "normally closed" (NC) switch contacts to connect the high side of the button directly to the data line. As soon as the camera powers up and applies power to the relay coil, the NC switch will DISconnect the button from the data line.You can return the favor by sharing your Arduno code.As soon as these gadgets arrive, I will be working on a project to send LANC over that control circuit of this fiber extender...http://www.camplex.com/product.asp?item=CMX-HDMIFSo I need to simulate the camera back at the control end to accept the LANC and translate into a simple serial data stream,and then convert it back to LANC at the camera end. I figure I can do that with a little Arduino at each end.

author: salamander
author_rank: Contributor
timestamp: April 27, 2015, 09:41:29 pm
content: Well, I have the code on GitHub, but it's lacking comments (some are still in czech) and it's actually quite crude ... but it works, somehowSo excuse the state of the code for now.https://github.com/Salamander0/LANC-Control/blob/master/LancControl.inoI will add comments later on, but I think it is pretty obvious what I'm doing.PS: I suppose ELM624 won't help you in this case