Figure 1 – LCD monitor battery box and cx700v camera on housing tray



Circuit update to underwater housing phase 2 


This is a write-up for a 2011 update to the 2008 lanc circuit project, lets call call phase 2. This update allows the use of a cx700v camera to be used in the same underwater video housing. Such a housing is called a “generic” housing. A generic housing enjoys a long life (as it is supposed to) as they can be reused for newer cameras continuously. A generic housing saves money for the owner as he does not have to repurchase the housing for every camera.  These digital video cameras have been getting better every year, allowed by my wallet about every 4 years.  Phase1 of this project is written up here http://www.lanc.graceplay.com/


1998    ccd-tr930                   My first camera , HI8 tape, just threw it in the housing and jumped in , didn’t know anything about holding camera steady or finding good shots. No lights. Lots of video noise at any amount of low light ,  Attached wide angle lens to camera.   Viewfinder was large enough to see most of the image through the rear door window. 


Text Box:  
Figure 2 - rig in 2001

2001    trv17                          Mini-dv,  fully digital picture.   Better low light. Attached two Shockwave dive lights (150 lumens each)  to the housing arms. This allowed night dives.   But lights were not proper floods . Camera had a provision for taking digital pictures and white balance but housing did not offer access to these features. Attached wide angle lens to camera.


2008    hdr-hc9  (PHASE1)    Mini-dv HiDef HDV format. (meg2)   Much better daylight clarity, better low light,. Attached a heavy wide angle lens to camera. Housing circuit boards were modified by me  to assign a button to take still pictures. See phase1.  Added small LCD monitor to rear of tray to be visible from rear of housing.  


2010   same                          Housing and camera modified to accept external flash, S2000 was attached , Video lights changed to  PROV8LED (400lumens each) .  Much more light available now.  Now  we are taking still pictures you can actually look at. Videos look better too.


2012    cx700v  (PHASE2)     AVCHD , flash memory, Much much!  better low light , much better steady shot. No need for wide angle lens  Modified housing to control camera with IR and Lanc using 10pin connection. New button assignments to access “white balance”  White balance and low light ability changes the quality level one full notch. Smaller and lighter then prior camera.  Flash can drive slave strobe like prior camera.



Phase 2 was completed dec2011, it was a little rushed, but was finished in time for the December trip. This page is the writeup of this project . Remember this project is based on a prior project which is on another page.




Figure 3 - Inserting updated circuit board into housing. Notice location of IR sender on stalk. 





  1. Allow a new camera, a cx700v to be used in the Top Dawg housing replacing the HC9.
  2. Allow access to the white-balance button on the camera.
  3. Replace the LCD power-on circuit, as the original circuit was badly built, (by me) although it never did fail it just looked it was about to.
  4. Redirect all connections to the camera via the 10pin sony a/v plug.  This reduces wires inside the housing and tangle.  New sony cameras force this update anyway as separate jacks have been removed..



These goals appear simple on the surface, but underneath its more complicated. Sony evolution of the 10pin a/v jack has introduced an obstacle, Analog video out, is disabled when the lanc feature is enabled in enabled in the 10pin. This becomes an design obstacle as the housing needs video out to feed the housing monitor while at the same time lanc control to the camera.


Figure 4 - Front view of camera on tray



Figure 5 – Camera on tray in housing,  View from front  with front port removed notice IR sender near  camera


Isolated design needs

  1. Control of the camera is via existing housing buttons, such buttons are placed with easy reach for the diver to operate the camera without struggle. Easy reach provides quicker access for camera activation so as to not miss the critter..(although if you keep the camera on and recording all the time it would negate this goal)
  2. Housing control of the camera must provide power-on and power-off. This is important for camera battery life. On boat housing assembly must not be rushed and must occur well before suiting up for the dive. o-ring inspection during door closing cannot be rushed. Any dirt (fiber/hairs) on the o-ring observed requires additional time for cleaning even maybe o-ring removal and cleaning. This unknown variable requires door closure well before the dive.  After housing door closure the camera is turned off.    
  3. Housing video monitor also responds to Camera power-on off.  This is important for video monitor battery life.
  4. Housing video monitor is the only way to confirm the camera-aim, zoom, battery-life, camera status. Without such basic information simple operator mistakes dominate. .Use of the camera viewfinder while the camera is in the housing is not worthwhile.  
  5. Single buttons presses are desired for camera functions are desired rather then complicated manual  menu navigation.


To meet above goals, the lanc interface is the only way to turn on and off the camera. (as far as I know at this time) But to obtain the other goals, video output from the camera to feed the LCD monitor, (in the cx700) the lanc interface must be turned off. This design conflict provided extra effort for this project. Control of the camera had to be transferred to the IR-remote control interface. In the this way camera control continued while the video-output was enabled at the same time..


Figure 6 - New tray configuration, one cable from camera to housing circuit board





Figure 7 – Rear photo showing lcd monitor, circuit board for the relay, battery case for the lcd power mounted on tray





Ok we are going to still use the Lanc interface but only for power-on and power-off. Outside of those events the lanc interface is turned off to allow the video output from the camera to feed the housing monitor. Toggling of the interface mode adds another dimension to the project, substantial re-programming. . These steps are reversed when turning off the camera. When the camera is on, the lanc interface is disabled but control of the zoom, record-start-stop, white-balance, and photo button will by Infra-red remote control (sony ir-commander).   This is possible as IR-codes exist for Record and camera menu navigation. IR codes exist for the following.


·         Record / pause

·         Zoom out

·         Zoom in

·         Take photo

·         Ok or select

·         Menu up

·         Menu right

·         Menu left

·         Menu down


Access to any other feature in the camera is performed by combining menu codes (left , right or select) to navigate the camera menus to the exact feature to a button to highlight and enter OK. This advanced camera function can be placed under control of one button by programming a sequence of ir-code triggered by one button. Given a menu starting point, any other menu navigation page is fully pre-predicable and the series of codes to be sent (right down select…) can be preprogrammed.  For example this was done for the white balance button or to swap between video and photo camera mode.


Adding an IR interface to the circuit boards had the following details.

·         An IR sending diode (lte302) was piggy backed with one of the existing leds, this diode was placed on a wire stalk which is bent to be positioned in front of the camera. Power needed for driving this ir-led was very low since the distance to the camera was very short.

·         The Crystal clock of phase 1 , was removed and those two 16F88 pins were re-purposed for the control of the pin 7 of the 10pin camera connection. This was possible since the 16LF88 internal clock ( INTRC) is accurate enough for IR and LANC protocol .

·         A hardwired lanc cable was removed and a 4 pin header added to the board so that either a 2mm lanc connector cable or a 10pin connector cable can be used. This 4th wire is used in the 10pin cable to connect to pin7. And this also required the following change.

·         Pin7 (sony function) from the 10pin is controlled to 3 states. To accommodate this, 2 PIC pins are used , RA0 was used for pull pin7 to ground, RA7 was used to pull pin7 to 100k to ground and RA0 and RA7 are left open to allow PIN7 to float high to detect camera on. 

·         The program in the 16LF88 was changed,

o   A separate IR sending program block was written from scratch and added to coexist with the lanc program block. Only one block is active at a time.  Transfer between IR block and lanc block had to choreographed.

o   The housing button command set was redesigned for the IR program block. Using button overloading (shift) 10 additional buttons were added in software, such as for white balance and camera/video mode.




Internal PIC clock.

A timing error could originate from a F88 clock error. Timing accuracy is needed to meet the requirements of the two external interfaces, the Lanc and IR.   Testing has shown that the camera (hc9) (and 700) is tolerant of receiving up to a plus or minus 3.8% timing error. This is within the accuracy of the internal clock in the 16LF88 (INTRC) which has a advertised stability of 1%.   Using button overloading, buttons were added to fine tune the internal clock in case there was a problem.



The sony a/v connector ,10pin interface offers a pin what is called “sony-function” (pin7) This pin required the housing circuit boards to control a  4th wire to the camera.  This pin is switched to one of the following





lanc2 circuit 16C

Figure 8 Schematic showing cx700v a/v 10pin connected to underwater housing circuit



      1      Jack is connected to right board to right-board hall effect power supply. This is used as a signal trigger to the video power switch.

      2      AH182  hall effect is powered by a cr2032 to power on the camera. It is switched by the rear magnet of the right rear slide switch.

      3      6 wire flat cable to connect right and left boards together. Boards are mounted on opposite sides of the housing.

      A     New four pin header mounted on right board since the direct soldering of the lanc cable to the board is a poor idea.

      B     New cable from right board to camera has a splice to a RCA plug.  This is connected to the LCD monitor which has a RCA jack.

      C    New float prevention resistors of 4M are place on RA0 and RA1 to ground to prevent those pins to uncontrolled floating when the camera is removed from the housing. The program will go standby mode and un-connected floating pins will cause the PIC to use more power. A 4M resistor was chosen after testing. It must pull a unconnected pin to ground without affecting a camera signal when connected.  It was noticed that 7M was too high and 500k is too low.


Lower left is the 4xAAA  battery case which powers the right circuit board. The switch on the  Next to that is the video relay. This powers the lcd monitor with a small trigger circuit from the cpu.  

For phase2 a  few connections at the F88  were changed. Ra0 which used to power the left board was reassigned to operating the 10pin function pin.  This was done because RA0 has a lower voltage logic input then RA6 and 7 which use higher input logic then RA6 is used for output of power for the left board. Fuses are employed on 4XAAA pack and 8xAA pack. 




Cable internal design (10pin)


10pin number

Purpose in 10pin

Wire color in 10pin

4 wire color, at housing

Rca jack to feed housing lcd



Audio left







Thin green



Input and output to housing


s-video ground

Shield to blue and orange





Lanc power




Only powered when lanc is enabled. 5.6v can vary with camera battery charge.  Not used in house for phase 2


s-video pin 4






Audio right







Thin black



Leave open or connect to 0k for composite video, or 100k for lanc or 30k for component video output.


Main ground

Shield also shield to yellow white and red



Considered power ground

Considered lanc ground

considered video ground

considered sony-function ground.


Composite video



Center pin



s-video pin 3





Figure 9 wiring of 10pin cable



I have seen another pinout on the internet which said the ground for the lanc is pin3.  This was not observed in the sony cable I dissected. Nor did the camera complain about the above pin choices. But for the future keep your eyes open.




Figure 10 Right circuit board with detail of 10pin lanc cable plugged in


The cable above connects the camera to the circuit board inside the housing. Cables inter-connect in the pigtail (top) the cable to the right board contain 4 wires each of those all connect to the F88. . 


PIC pin outs


Cpu Pin




 LANC cable signal wire

Lanc input and lanc output

Unintentional connection to S9 which is also connected to the LANC signal wire. S9 is triggered by Right Rear moved backwards (same as S1) but should not interfere.


Direct to pin4 of the header to pin7 at the camera

0k pull down to pin7 of he 10pin to enable video mode.  Also used as an logic detect of camera power on. This port uses 1.1v TTL input logic. This can be set by the camera 2.5v output seen on pic7.



Power to led1  and IR-LED.  



Power to led2  is flashed for program status.



Power to left sensors



Power off >  right rear switch moved backwards



Record/stop >  right rear switch moved forwards



Zoom wide >  right front switch moved backwards



Zoom closer >  right front switch moved forwards



Change Camera mode >  left rear switch moved backwards , also wired to programming port



Still photo >  left rear switch moved forwards, also wired to programming port



Button shift B  >  left front switch moved backwards and held to shift function of all other buttons.



Button shift A >  right front switch moved forwards and held to shift function of all other buttons.


Also called VPP

Master reset and programming signal



Power to the left bank hall effect sensors


To 100k to pin4 of the header to pin7 on the camera.

100k resistor to pin7 of the 10pin to enable lanc. Side. RA7 is set to ground to pull pin7 to 100k to enable the lanc interface on pin2 and pin4.

Figure 11  CPU pin assigments


Strain relief

In prior version of this project, the lanc cable was directly wired and soldered to the board. This was a mistake. This caused a failure during a trip.  Wire fatigue is amplified at a solder point without any strain relief. This was redesigned for part2. Here a 4 wire header was instead soldered on the board at that point. Then a cable with a 4 wire plug with some strain relief was used.

.. 4pinboth.jpg

Figure 12 – Board end of 4 wire  lanc cable with plug to board and underside showing strain relief




Design points and changes

  1. a
  2. b
  3. c


Led use during IR program block


Led1 and the IR-led are both connected to RA2. RA2 is controlled by the IR-program to send sony IR command codes to the camera. When this occurs led1 is also observed to flash.   Led2 is connected to RA3 and is used flash program status codes to the diver. These visible leds are placed on the rear of the right board within sight of the housing rear door window. Led1 will flash when IR codes are sent to the camera. Led2 will flash when program status is indicated to the diver. The IR-led is placed on a bendable wire stalk on the front of the right board so that it can reach the front of the camera where the camera ir port is located.


Very dim quick flash every 4 seconds

IR program in lowpower standby mode. Endurance of this is 3 weeks. Every 2 seconds the camera is tested for power on.

Dim but brighter Quick flash every 1 second

IR program is in power on mode, camera is measured for power on every 14 seconds. All buttons are monitored for IR commands

Bright flash every 1 second

AA or BB shift in effect as long as button A or B is held down

 3 bright flashes completed in 1 second

IR program block has started

 2 bright  flashes completed in 1 second

Lanc program block has started

ONE 1 second bright flash

Power reset , program reset, During first connection of AAA power supply. Will be followed by LED1 1 second flash Also occurs during a soft program reset when lanc sync is lost due to camera power off.

Figure 13  status code flashes for LED2




IR program button assignment


The housing offers 8 buttons, this is all described in the phase 1 project , see lanc.graceplay.com

The new program for IR remote control was written with a similar button layout, but there are some changes.  Button overloading is performed by 2 shift buttons, which themselves are overloaded which create 4 shift buttons. The overloaded shift is defined as AA and BB .  The AA shift is performed by pressing the A button three time and holding it down the 3rd time. Perform this following sequence in 3 seconds.

  1. press A
  2. release A
  3. press A
  4. release A
  5. press and hold A,
  6. Then any other button pressed would perform a AA function


Each press and release cycle must occur within a uniform timing interval or the shift remains shift A.  A 3.5 second time limit for the sequence is enforced, The interval of 1 and 3 press are compared , the interval of the 2 and 4 release are compared , each should be within a 30% tolerance.  Confirmation of the AA shift is by a ½ second led flash and the power on flash becomes brighter..


.video of AA video button press here




Button hit

Description function performed


Power on /. Off

Toggle power on and off of camera and video monitor

Power on is via AH182 sensor powered by cr2032 battery.
Power off is sending PIC program control transfer to the lanc program block and sending lanc code for power off.


Toggle Record or pause,

IR code for record, sent once. Toggle via perform inside the camera


Zoom to wide angle

IR code for zoom wide is sent repeatedly as long as button is held down.


Zoon to telephoto

IR code for zoom narrow is send repeataedly as long as button is held down


Switch between video or camera mode

A series of 6 IR codes are sent to menu navigate to the still-camera or video-camera mode. This operates as a toggle, selecting the other mode each time activated..


Take a still picture

IR code for photo is sent


Shift A

Hold this button down while operating any other button shifts the button definition


Shift B

Hold this button down while operating any other button shifts the button definition


Shift AA

Press and release the shift A button 3 times and hold on the 3 time to activate shift AA



Shift BB

Press and release the shift B button 3 times and hold on the 3rd time to activate shift BB


FOCUS manual

Activate manual focus, using 10  IR codes in series to navigate the menus to the focus screen

A  + record

Focus Auto

Activate auto focus

A + wide


Activate manual focus if not already activated and press the focus to near button once, if held down, then repeated hit the focus near.

A + tele


Activate the manual focus if not already activatged and press the focus far button once, if held down again then this is repeated

A + mode

Tune internal clock minus one step

Adjust PIC clock slower by one step.

A + photo

Tune internal clock plus one step

Adjust PIC clock faster by one step

B + power


IR command sent once

B + record


IR command sent once



Ir command sent once

B + tele


IR command sent once

B + mode

Subtract 1 from double shift tolerance

Tunes the timing window for operating the double shift AA or BB

B + photo

Add 1 to double shift tolerance

Tunes the timing window for operating the double shift AA or BB

AA + power

Not assigned


AA + record

Toggle RED shift between red andr neutral

This is a toggle but hitting button again reversed setting



Sequence of IR commands are sent  to navigate to the white balance screen, enable it, and hit hit one-touch


Activate one-touch white balance 

May be repeated as needed

AA + mode

Toggle screen mode program flag

Activate or disable automatic menu navigation to the spot-focus screen

AA + photo

Toggle ability to check camera power off program flag.

Activate or disable the program check every 20 seconds where the camera is checked for power off via pin7 on the 10pin connector. Camera off then forces program  standby mode in housing..

BB + power

Start the LANC program block

Transfer control from the IR-program block to the Lanc program block and stay there until power off

BB + record

Goto the focus menu screen

Just go to the focus screen  but don’t do anything

BB + wide

Goto the spot focus screen


BB + tele

Goto the main menu screen


BB + mode

Perform the pin7 race unit test

Pin7 is cycled  0k to open in varying duty cycles from 3ms to 100 ms .Led is flashed if camera power is detected.within that duration . Test duration is 30 seconds.

BB +photo

Button led test for 60 seconds.

For 60 seconds any button hit will light the led and not send any commands.

Figure 14  IR program block user button assignments


 Power  budget


Since the housing circuit boards need to operate without the lanc interface enabled, then there will be no power from the camera. An alternate source to power must be rigged. 4 AAA in a small battery case was chosen. It was placed on the ceiling of the inside of the housing.  This powers the housing circuit boards full time. The battery case had a switch on it and this would be used for transport and storage.  Full time power requires some sort of power reduction management. The existing circuit boards use considerable amount to power the hall effect sensors. The hall effect sensors can be commanded unpowered by the PIC program. The PIC can reduce its own internal power use by switching the clock from 4mhz to 32kz and disabling the internal pull-ups. We can call these steps are going to standby.  In this standby mode battery life from the AAA is 3 weeks..   The choice of 4 AAA  batteries is they are not too heavy for Velcro as compared to AA.



Figure 15    4xAAA battery case with inline fuse and diode and plug to right circuit board




Voltage ranges

A voltage regulator could be selected for low quiescent consumption but I had run out of time for the next trip. (im also lazy)  By omitting a regulator will save power and time. The PIC (cpu) does tolerate some amount of power supply noise.   Omitting a regulator requires a re-look at  battery voltage ranges as that we don’t exceed voltage limits, high and low, for any component in the circuit. . The target  voltage range is chosen by looking at two components, the PIC (cpu) and the hall effect sensor.  The hall effect sensor, US5781,  works down below 3.5 volts but loses sensitivity lower then this level. This loss becomes noticeable below 3v. So target battery voltage range was adjusted two diode voltage drops (subtract 1.2v).   Cpu switching of the led does introduce power supply noise, but it does not appear to cause any problems with at least a 1uf. When using a 0.1uf there were some problems. So 47uf capacitor was added to the existing 1uf to provide more margin. My intended battery choice is NimH but this chart also shows Alkaline can also be used.

lanc2 voltage5.jpg

Figure 16    Comparison of operating voltages for 16LF88 and US5781 to voltage available from 4xAAA batteries


Camera power on


This circuit is left unchanged from phase1. This is an AH182 hall effect sensor separately powered by a CR2032 and connected directly the lanc pin2. Note that lanc power on feature is not affected by the setting of the sony-function pin.   For the cx700v in the housing, the flipout screen must shut, so you do have to pull out the viewfinder or the camera will redecide to perform a power-off several seconds after pin2 power-on command.   


When the program is in standby mode. It is still checking for camera power on via voltage on A/V pin 7 via RA0.  RA0 can perform TTL input logic with logic threshold of 1.1 volts.  (but not RA7)  When the camera is powered on it will place 2.5v on pin7. This is detected by IR-program block in standby mode.  Then standby mode is ended, power is commanded to the right and left hall effect sensors, portb pull-up are enabled and the PIC clocked is switched to 4mhz. Power to the left sensor will activate the lcd relay which turns on the lcd monitor. Then the IR-program block sets A/V pin 7  to 100k to allow video to be send to the lcd monitor in the housing. At this point the IR-program block now begins monitoring the hall effect sensors for any diver button presses.


Camera power off

When the Lanc program is running, there was is no change to power off process.. When the IR-program is running, the same button is used for power off. When this button is hit power-off is performed by preloading the lanc command “power off” code and then starting the lanc program block That block then enables the lanc interface and then sends the power off command code to the camera using the lanc interface. When the camera is off, lanc sync is lost, the lanc program terminates using the watchdog timer,  this causes a soft reset, which is detected by the init-block, which then triggers a restart of the IR program block,  The IR-block checks for camera power which if missing, immediately sends the IR-block into standby mode... This standby mode turns off power to the left and right hall effect sensors and slows the PIC clock from 4mhz to 32kh to reduce power consumption.   The standby program does flash the led once every 4 seconds, This is a very quick flash which appears dim and does not use any measurable power. Also the standby program check the camera for power every 2 seconds.  


Camera power check

During IR-program block power on , the camera is re-checked for power on because the camera does have a setting to turn itself off after 5 minutes of nonuse. Thus detecting power off will allow the housing follow this.  The IR-program monitoring cycle performs a camera power test every 15 seconds. This test performs the following , pin7 is changed from 0k to open, and the voltage on pin7 (via RA0) is monitored to rise to TTL-on before a ½ seconds  timer expires. Scope tests show this line will rise in ? usec.  This is before the camera function detect to disable video output. Thus this quick toggling of pin7  to open and then back to 0k  is quick enough so that video output is not interrupted from the camera to the lcd monitor.


Power on

16LF88        1ma

Led + IR       10ma  part time <1% duty time.

Led               5ma  part time   <1% duty time

8x  sensors  19ma.

AQV212         3ma

Total             20 to 30 ma


Camera Power off, standby in the PIC program

16LF88        0.030ma

Led               5ma part time  .001% duty

4x sensors   10ma part time 0005% duty time

Total             0.031ma


Space inside the housing is ample for cable routing and the addition of the circuit power supply. This end on view emphasizes the wire routing from the circuit board to camera. Also shown is the battery box for the right board attached on the ceiling.  Not shown is the video monitor. Which is mounted aft of the camera.


.                             2011_endon3

Figure 17  End on view to see cable routing from camera to housing




Video switch

The relay used to power on the LCD video monitor in the housing and was redesigned in phase2 with fewer components. The prior design used 10 parts. This new design uses 4 parts. Power from the left hall effect sensors is tapped and is routed to the resistor and the diode relay driver, AQV212. Power consumption is 3ma. Output of the relay directly switches a bank of 8 or 10 AA batterys to feed the small 2.5 inch lcd monitor.



Opto relay AQV212


800 ohm Resistor, variable in this case.

500 ma fuse and in line fuse holder


2 pin plug to existing jack on right board.. Polarized


5mm dc power plug


2 pin right angle header , polarized

Figure 18  parts list for Video Switch

.picture of video switch goes here








  Praises go here



  Confessions go here


Future Improvements ideas .


Use secret lanc codes to operate menu traversing with possible better speed then IR-control. I only recently saw this discovery for sony cx series cameras. .  This information was missed in the design of the phase 2 project. I myself did not explore additional lanc codes since there are 64000 possible codes and I didn’t think there were any or have the time to search. 



v1  2-jan-12

v2  4-jan-12

v3  10-jan-12  add voltage ranges

v4  14-jan-12  add schematic

v5  21-jan-12  more content, voltage graph redesign.

V6  4-feb-12   Another general editing pass

V7  11-feb-12  More photos

V8  28-feb-12  another picture