Monday, April 29, 2019

HP Laptop Camera to USB Webcam Conversion

I have been working on hacking a Panasonic DVX100 camera.  They sell for about $100 used but they were $4000 new.  They still contain about $1000 of optics.  So I thought about using a different cameras electronics and mating it with the optics.  Then I was further sidetracked by the idea of using an old laptop camera as a USB camera.

I salvaged two laptop cameras from old laptops.  One was just 640x480 resolution but the other was 1280x960!  However the lens was glued in place making using it with the better optics not possible.  Here is a picture of the better camera.
Then, to hack the interface, the ground was metered to connect to the green wire.  Red was power and the twisted pair was the data pair.  I guessed on the twisted pair and got it right the first time.  I added heat shrink tubing later on.
Camera Green - USB Black
Camera Red - USB Red
Camera Black - USB Green
Camera Blue - USB White.

Here are the test results from https://webcamtests.com/


And finally a picture of me taken with the better camera:


Friday, April 12, 2019

Chevy HHR Car inspection P0171 code

I started about three months ahead of the inspection due date.  First I replaced the windshield that was cracked. I found a deal where it was $200 instead of the usual over $300.  Then the brakes were rebuilt and one of the wheel bearing was replaced at over $600.  Then I was quoted $300 to replace the two "GM VVT Control Valve Solenoid" valves on top of the motor.  I did that myself for $18 by buying the parts on eBay.  After that repair the check engine light went out.  Before I could get it inspected the check engine light came back on!

After checking everything and cleaning the Mass Air Flow (MAF) sensor I gave up and took it back to the garage.  As I drove it there the check engine light went out!  However it failed inspection because it had not been driven enough.  So I was given 10 days to fix it.  The garage said they had fixed a vacuum leak.  The next day the check engine light came back on!

So I spent a Saturday trying things, one at a time, to fix it. One thing I needed was something that could tell me if the problem was fixed without having to drive it many miles to see if the check engine light comes back on.  This code reader was the solution.  It read a "permanent" code 171 - fuel too lean.

Next I replaced the spark plugs.  That helped some and cleared the permanent code but soon a "pending" 171 code came back up.  As you can see the plugs were in rough shape.  I replaced them with AC Delco plugs.

Next I replaced the MAF sensor that I had cleaned earlier.  That fixed the problem.  It has some slots in it that I had sprayed the cleaner in but that was apparently not enough to fix the problem.  So after 10 days past due my car finally passed inspection.



Thursday, April 11, 2019

Panasonic DVX100 Video camera repair and modification

This started with a dream that I had three professional cameras.  At one time I had two Panasonic AG-DVC7 cameras.  My brother had them, so I asked if I could have them back.  He was happy to return them because they were both very difficult to turn on.  I have shown how to repair that problem in another blog post.  However, my research showed that the DVX100 that once cost about $4000 was now available on eBay for about $50 each needing repairs.

The DVX100 has a actual native resolution of 1546 x 990 according to some sources.  At one time there was the a modification to take advantage of this higher resolution.  I think that I might be the ideal person to revive this modification since I have lots of experience in modifying everything from LED sighs to computer monitors.

I bought two of the cameras for $85 that were in need of repair.  To my surprise they both worked!  Even the tape decks could record and play back videos.  They are missing some parts and one of the LCD screens goes crazy when you move it.



This is what the insides of the camera look like. You have to remove the top microphone assembly to get to a screw under it as well as the bottom plate to get to three screws under that.
DVX100 Cover Removed

This is the LCD side cover.  There are a lot of connectors to unplug including two that are under the microphone assembly.

This is the top of the video processor board.

This is the bottom of the video processor board.  Note the two VSP2212 video processor and analog to digital converter chips on the left side.  The third one is located on the top of the board.

Here is the block diagram of the video processor.
Here is the pin numbers to connect to.
The problem now is what do I connect to?  If I connect to the analog input then I need to have a circuit to process the CMOS output, that is not straight analog, but instead it is clock pulses followed by analog values.  I also loose the gain control circuitry (PGA).  If I connect to the digital outputs I have to connect 12 wires to each analog converter and I am limited to the sampling rate of the converter that has a maximum clock of 20 MHz or 1,500 pixels horizontally.  That is assuming that they clocked it at the maximum frequency (highly unlikely).

These pictures compare the optics of the DVC7 to the DVX100 optics.

DVX100 Lens

These next two pictures compare images between the two cameras, the DVC7 is first.

This might freak you out, but I disassembled the optics! Its from a slightly broken camera so you can breath a sigh of relief.

This is the focus assembly (No wonder there is no focus motor).  There are two coils attached to the lens that then move inside of a top and bottom magnet.  This is much like a hard rive positioning mechanism.
DVX100 Focus

This is the image stabilization mechanism. Two coils one for X and one for Y move inside of magnets.
DVX100 Stabilization

This is the iris solenoid (A screwdriver is holding it open) with the filters also visible on the right side.
DVX100 Iris

Here is how to connect to the optical assembly.  The zoom motor is a conventional motor, connect power one way to zoom in and reverse it to zoom out.  The Iris solenoid needs just two pins as marked.  The focus coils (just two connections) only need a little power to move.  The other connections next to the focus coils are for the manual zoom/focus ring that is missing on this lens assembly.  Varying the voltage varies the focus lens position. 
There are three optical sensors, one is for the filters.  There is a variable resistor to sense the position of the zoom.  The image stabilizer might be the hardest thing to operate. I can see the image is off center when power is not applied. That lens is what you hear rattling inside the lens assembly. Hopefully I can break it down to two coils that need to be energized.



Tuesday, April 9, 2019

Arduino UNO interfaced to a Sunrise Systems 7x96 LED array

I have interfaced an Arduino UNO to a Sunrise Systems 7x96 LED array.  It only needs a 74138 and 7 driver transistors such as TIP127's.  I am also using a 5 volt 5 amp regulated power supply.



Here is the first video testing the interface:


When I try to make the characters 6 bytes wide instead of 8 bytes the sign will flicker because the math takes too long.  I will have to work on another way to do the math.

This is a picture of the Sunrise Systems controller that was removed.

This is a close up of the logic connection the pins are 5 volts, Latch, Data, Clock, and Ground.

I have a collection of the Sunrise System Signs.  The red one on the right is a newer design that has the controller built into the circuit board.  This makes it much harder to control with an Arduino.

This picture shows what the signs say when they arrived.

This is a close up of the interface circuitry.
These next two pictures show the smaller text.  Instead of 96 LED's, the software sees 16 characters and 6 columns per character. 

Here is a video of the improved text with better software.


If you add a MSGEQ7 you can make a large spectrum analyzer like in this video.


This is the schematic of the 74LS138 interface.  The 74138 outputs are low when selected so it has to be inverted back to high by the PNP driver transistors.

Here is the code to make it work with a 74LS138, seven 1K ohm resistors and seven TIP127's

// 7x96 Uno LED Array driver
// Fast Clock Mod-Direct port writes
// 4/4/2019 by Bob Davis

// #define A   A0  74138 pin1
// #define B   A1  74138 pin2
// #define C   A2  74138 pin3
// #define CLK 8 // Port B assignments 
// #define OE  9 // 74138 pins 4 and 5
// #define LAT 10// Latch

#define PIXEL_PORT PORTD  // Port the pixels are connected to
#define PIXEL_DDR  DDRD   // D2-D7
#define ROW_PORT   PORTC  // Port the rows 74138 are connected to
#define ROW_DDR    DDRC   // A0-A5
#define CLK_PORT   PORTB  // Port the Clock/OE/LE are connected to
#define CLK_DDR    DDRB   // D8-D13

char text1[]="ARDUINO UNO WITH           ";
char text2[]="SUNRISE SYSTEMS        ";

// This font from http://sunge.awardspace.com/glcd-sd/node4.html
byte font[][7] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00, // ascii 32
0x00,0x00,0xfa,0x00,0x00,0x00,0x00, // !
0x00,0xe0,0x00,0xe0,0x00,0x00,0x00, // "
0x28,0xfe,0x28,0xfe,0x28,0x00,0x00, // #
0x00,0x34,0xfe,0x58,0x00,0x00,0x00, // $
0xc4,0xc8,0x10,0x26,0x46,0x00,0x00, // %
0x6c,0x92,0xaa,0x44,0x0a,0x00,0x00, // &
0x00,0xa0,0xc0,0x00,0x00,0x00,0x00, // '
0x00,0x38,0x44,0x82,0x00,0x00,0x00, // (
0x00,0x82,0x44,0x38,0x00,0x00,0x00, // )
0x10,0x54,0x38,0x54,0x10,0x00,0x00, // *
0x10,0x10,0x7c,0x10,0x10,0x00,0x00, // +
0x00,0x0a,0x0c,0x00,0x00,0x00,0x00, // ,
0x10,0x10,0x10,0x10,0x10,0x00,0x00, // -
0x00,0x06,0x06,0x00,0x00,0x00,0x00, // .
0x04,0x08,0x10,0x20,0x40,0x00,0x00, // /
0x7c,0x8a,0x92,0xa2,0x7c,0x00,0x00, // 0
0x00,0x42,0xfe,0x02,0x00,0x00,0x00, // 1
0x42,0x86,0x8a,0x92,0x62,0x00,0x00, // 2
0x84,0x82,0xa2,0xd2,0x8c,0x00,0x00, // 3
0x18,0x28,0x48,0xfe,0x08,0x00,0x00, // 4
0xe4,0xa2,0xa2,0xa2,0x9c,0x00,0x00, // 5
0x3c,0x52,0x92,0x92,0x0c,0x00,0x00, // 6
0x80,0x8e,0x90,0xa0,0xc0,0x00,0x00, // 7
0x6c,0x92,0x92,0x92,0x6c,0x00,0x00, // 8
0x60,0x92,0x92,0x94,0x78,0x00,0x00, // 9
0x00,0x6c,0x6c,0x00,0x00,0x00,0x00, // :
0x00,0x6a,0x6c,0x00,0x00,0x00,0x00, // ;
0x00,0x10,0x28,0x44,0x82,0x00,0x00, // <
0x28,0x28,0x28,0x28,0x28,0x00,0x00, // =
0x82,0x44,0x28,0x10,0x00,0x00,0x00, // >
0x40,0x80,0x8a,0x90,0x60,0x00,0x00, // ?
0x4c,0x92,0x9e,0x82,0x7c,0x00,0x00, // @
0x7e,0x90,0x90,0x90,0x7e,0x00,0x00, // A
0xfe,0x92,0x92,0x92,0x6c,0x00,0x00, // B
0x7c,0x82,0x82,0x82,0x44,0x00,0x00, // C
0xfe,0x82,0x82,0x82,0x7c,0x00,0x00, // D
0xfe,0x92,0x92,0x92,0x82,0x00,0x00, // E
0xfe,0x90,0x90,0x80,0x80,0x00,0x00, // F
0x7c,0x82,0x82,0x8a,0x4c,0x00,0x00, // G
0xfe,0x10,0x10,0x10,0xfe,0x00,0x00, // H
0x00,0x82,0xfe,0x82,0x00,0x00,0x00, // I
0x04,0x02,0x82,0xfc,0x80,0x00,0x00, // J
0xfe,0x10,0x28,0x44,0x82,0x00,0x00, // K
0xfe,0x02,0x02,0x02,0x02,0x00,0x00, // L
0xfe,0x40,0x20,0x40,0xfe,0x00,0x00, // M
0xfe,0x20,0x10,0x08,0xfe,0x00,0x00, // N
0x7c,0x82,0x82,0x82,0x7c,0x00,0x00, // O
0xfe,0x90,0x90,0x90,0x60,0x00,0x00, // P
0x7c,0x82,0x8a,0x84,0x7a,0x00,0x00, // Q
0xfe,0x90,0x98,0x94,0x62,0x00,0x00, // R
0x62,0x92,0x92,0x92,0x8c,0x00,0x00, // S
0x80,0x80,0xfe,0x80,0x80,0x00,0x00, // T
0xfc,0x02,0x02,0x02,0xfc,0x00,0x00, // U
0xf8,0x04,0x02,0x04,0xf8,0x00,0x00, // V
0xfe,0x04,0x18,0x04,0xfe,0x00,0x00, // W
0xc6,0x28,0x10,0x28,0xc6,0x00,0x00, // X
0xc0,0x20,0x1e,0x20,0xc0,0x00,0x00, // Y
0x86,0x8a,0x92,0xa2,0xc2,0x00,0x00,  // Z
};

void setup() {
  PIXEL_DDR = 0xFF;  // Set all pixel pins to output
  ROW_DDR = 0xFF;    // Set all row pins to output
  CLK_DDR = 0xFF;    // Set all CLK/LE/OE pins to output
}
     
void loop() {
  for (int t=0; t<900; t++){
    // Select the Row
    for (int r=0; r<8; r++){
      // select the character
      for (int ch=0; ch<16; ch++){
        // select the column within character
        for (int c=0; c<6; c++){
          PORTD = 0x00;
          if(t < 400){
            if ((font[text1[ch]-32][c] >> r+1) & 0x01==1) PORTD=0xF0;}
          else {
            if ((font[text2[ch]-32][c] >> r+1) & 0x01==1) PORTD=0xF0;}
          PORTB=5; PORTB=4;  // Toggle clock
        }
      }
      // row is done so display it
      PORTC=r;  // Update row
      PORTB=0;
    }
  }
}

Here is a more complete schematic.
This is what the new control board looks like.  It is rather empty, but it uses a 5 volt 3 amp AC adapter.