Wednesday, December 4, 2013

Remove infrared filter from D-Link DCS-930L

The DCS-930L is a cheap wireless camera that lacks infrared LED:s and has a infrared filter in place to block all infrared light. I googled around and found Microfrost blog (http://www.microfrost.com/2011/06/21/d-link-dcs-930l-infrared-capabilities/) and thought I'd removing the infrared filter from the new composite lens assembly that my camera has. It turns out it's not that hard, see the process in images below.

The camera case pops open quite easily and the camera board is loose inside (no screws)

First I tried unscrewing the lens but it was glued to the lens holder so I just ended up destroying the plastic.

When removing the cover, take care not to break the little snaplocks like I did..

Instead of trying to remove the lens I just removed the whole assemly. It's mounted using some sort of silicone so I just pulled it off with a pair of pliers. The infrared filter is now clearly visible in red.

I removed the filter by pressing a tiny screwdriver along the edges of the filter, shattering it and removing the pieces/dust. (removed pieces of the filter is visible in the picture)

To the right you can se the silicone still left on the PCB where the lens assembly was mounted. After removing the infrared filter I put the lens assembly back in the silicone "holder" on the PCB.

And fastened it with some hot glue.


Unfortunately I ended up with this image. Lots of stains/spots and a very short focus distance. So I removed the lens assembly again and saw that there was alot of tiny dust particles on the image sensor. These could easily be removed. To fix the focus I had to move the lens closer to the image sensor. This meant that I had to carve away some plastic at the bottom of the lens assembly (the part that touches the PCB) with a small knife.

I put the lens back and the focus distance was better and the spots gone. There is a slight blurring in the right hand side of the image due to a small scratch I happend to make in the lens when removing the IR-filter.
That's it, now the camera can see infrared light. You can also add an external infrared illumination source if you want even better visibility. Check Microfrosts post about this: http://www.microfrost.com/2011/06/21/infrared-led-assemblies/

Monday, August 5, 2013

Volvo 945 lambda sensor diagnostic (Arduino ADC data logger / oscilloscope)

If you came here just for the arduino datalogger/oscilloscope you can skip the next section of text.

My Volvo 945 failed the yearly inspection with the comment "engine disturbance, unable to measure exhaust enviromental values". After a tip from a car mechanic and some googling I settled on that the problem must have something to do with the lambda sensor and is probably due to a crack in the exhaust pipe right before the catalytic converter. I have tried to patch it once but it is exposed to intense vibrations from the engine so the patch now has a crack in it. Air gets sucked in to the crack and enters the catalytic converter where the lambda sensor is located, leading it to detect exhaust rich in air and thus falsely making the Engine Control Unit (ECU) think that the engine is running lean and in need of more fuel rich mixture. This makes the engine run rich with sluggish, uneven performance and increased fuel consumption as a result. To make sure that the crack is really the culprit and that the lambda sensor is working OK I decided to record the output of the lambda sensor with an oscilloscope, as suggested on lambda powers site, before and after fixing the crack a second time.

To be able to sample the lambda sensor I searched around for a arduino oscilloscope but found no really good software. The one that came closest was xoscillo but I couldn't make it record long periods (several minutes) of samples and display as a graph. So I decided to put in a couple of hours to code my own "oscilloscope" which is more of a data logger with a graph view. The PC application was done in C# in Visual Studio 2012 and the arduino code was done in the arduino environment. The application features saving and loading of data logs (for later inspection and analysis), a zoomable, scubbable real time graph and exporting of the graph as PNG/JPG/GIF/BMP.

Screenshot of the application.

Since I didn't find any good apps out there to do this I put the code (click here to go directly to instructions on how to download/check out the code) on google code for others to use as a quick starting point to get up and running with data logging from an arduino.

I get around 500 samples per second (sps) at 10 bits per sample and 9600 baud. So the sample rate could probably be increased by several orders of magnitude by increasing baud rate and switching to 8 bit samples but 500 sps was plenty for my purposes.

Hopefully this is useful to someone, enjoy :)

Update: The car successfully passed inspection yesterday! The test-run after patching the exhaust pipe showed beautiful lambda curves so I had high hopes it would indeed pass :)

Thursday, August 2, 2012

Voosoo V7S teardown

I bought a Voosoo V7S tablet from AliExpress: http://www.aliexpress.com/snapshot/109826868.html
(7" Voosoo V7S IPS Capacitive Android 4.0 Tablet pc 1.5GHz Dual cameras 1G/ 8G HDD)
If the link is down, here are some quick specs:
  • Item Type: Tablet PC
  • Tablet Data Capacity: 8GB
  • Screen Size: 7"
  • Battery Life: 4-5 hours
  •  Processor Manufacture: AllWinner
  •  Touch Screen Type: Capacitive Screen
  •  Processor Main Frequency: 1.5ghz
  • Memory Capacity: 1GB
  • Feature: Wifi,Webcams,Multi Touch,HDMI,G Sensor,Camera
  • Operating System: Android 4.0
  • Display resolution: 1024x600
  • Weight: 389 g
  • Processor Model: A10
  • The tablet worked just fine and was definitely worth $86.
    After playing with it for a couple of hours I dropped it on a wooden floor from about 1m and the capacative multitouch glass overlay cracked (thus disabling touch input) and the usb-port connector broke off from the circuit board inside the tablet :P
    So I decided to take it apart and see if I could atleast reconnect the usb port so I could use is as a passive screen showing some app or photos or whatever.

     You can see the cracks in the screen above.


    Just pry the back of the tablet off with a small screwdriver.

     Disconnect the cameras and other cables from the circuit board.



    After some work with the soldering iron I got the usb connector back in place! One copper lead had came of the circuit board so I had to trace it visually and then connect a cable from the usb connector pin directly to the component it lead to, hence the taped up copper wire above.

     Everything back in place.

     The capacative touch glass was glued to the cover plastic of the tablet so I had to loose it.

    This is my new tablet, sans front cover, being controlled with a usb mouse and keyboard (gotta love the usb host function!)

    I have not been able to root the device yet.

    All images are available in full resolution in this album: https://plus.google.com/photos/114075742007925500416/albums/5772034414519027793?authkey=CIWb79jVsI72BQ

    Saturday, April 14, 2007

    Simple USB LCD

    In this post I will describe a simple way to add a LCD (HD44780 based) to a computer via USB. Besides a LCD the only component needed is a FTDI FT245-chip (or any other FTDI-chip that supports asynchronous bit bang mode). These can either be bought unsoldered for $4 if you have the means to manually solder it (empty breakout board is $3), or they can be bought presoldered on a breakout board with USB connector for $15. You'll also need a USB cable for about $2. All prices are from Spark Fun Electronics. If you live in Europe (I'm from Sweden) you can get FTDI-chips from Lawicel or Farnell, they both have low shipping costs. If you have access to etching equipment you can easily make the breakout board yourself and save some money. Here´s an 600dpi etch mask for a SSOP-28 breakout board (it can be made smaller, this was just a quick auto routing in Eagle):

    Once you have your FTDI-chip mounted on the breakout board, connect the FDTI-chip to the USB-cable in the simple bus-powered configuration (see FT245 datasheet) and connect the LCD to the FTDI-chip as follows (NC= not connected):

    FTDI: D7 D6 D5 D4 D3 D2 D1 D0
    LCD: NC E RS RW D7 D6 D5 D4

    Here are some photos of my test setup:


    Install the D2XX drivers from FTDI and you´re good to go! I've made a sample application that prints text to the LCD using the D2XX drivers, you can get it from Google code:

    http://code.google.com/p/ftdiusblcd

    D7 (and optionally D4) can be used for general purpose I/O (buttons or whatever). There are FTDI drivers for Linux, Windows and Mac OS and bindings for C/C++, C#, Java, etc, so it should be easy to make it work cross platform. It would be nice if someone wrote the code needed to make it work in common LCD programs like LCDproc, LCD4Linux, etc. Please let me know in that case :)

    Some LCD links:
    Nice LCD FAQ , User defined graphics , HD44780 code from LCDproc

    Automatic Go game record - Saikifu

    I started playing Go with my friend Björn about a year ago after watching Hikaru no Go. It's good fun :) While playing we found ourselves sometimes taking a picture of the board to be able to test variations of our moves later on. We also found ourselves not motivated enough to actually look at the photo afterwards and place it on a board :P That's when the idea to have a computer watch the game and log it automatically came about.
    I wrote a small program that looks at a game of Go through a camera and logs it to a SGF file. The main GUI looks like this:

    It also acts as an automatic game clock: when black places a stone blacks timer stops and whites timer starts to tick and the other way around. If there is any interest i could add different byoyomi time control methods to enable the program to act as a full-fledged Go game clock.
    The program is written in java to be portable, using Java Media Framework API (JMF) 2.1.1e, J2SE 5.0 Update 6 and NetBeans IDE 5.0. It should work with most web cameras.
    The code is available at Google code:
    http://code.google.com/p/saikifu

    Just let me know if you want me to add some features :)

    Enjoy!

    Friday, April 13, 2007

    Simple AVR wireless communication using Cypress Wireless USB modules

    A simple way of adding wireless communication to your electronics projects is by using wireless USB modules by Cypress. These 2.4 GHz tranceiver (both TX&RX on each module) modules have very low power consumption, over 50m range (over 200m with non-PCB antenna) and cost $10 in quantities of 1 (one). Cypress also offer samples of all their wireless products so you can test them out before you buy. I will show how to interface the CYWM6934 and CYWM6935 modules (they are pin compatible and interchangeable, just different range) (it should work with the CYWM6935PAEC aswell since it's just a CYWM6935 with a power amplifier) with a Atmel AVR mega8 microcontroller.
    The modules consists of a wireless transceiver (CYWUSB6934 or CYWUSB6935), a PCB antenna, some passive components, a crystal and a pin header for connecting to the module. Communication between the transceiver and the AVR is done via SPI, which the AVR has hardware support for. The only components needed besides the AVR and the module is +5V and +3.3V power supplies. I used L7805CV for +5V and LM317T for +3.3V (better to use a dedicated 3.3V regulator, but couldn't find one on short notice).
    To have something fun to send over the wireless link I connected a Dallas DS1820 temperature sensor (also available as samples) to the transmitting side (any DS18X20 sensor works, DS1820, DS18S20 and DS18B20). To read the temperature sensor I used a collection of code from Martin Thomas. I also used some USART code from Jaakko Ala-Paavola. The following photo shows the first test setup with two CYWM6934 connected to one AVR mega8 each.


    After initial testing I moved the module with the temperature sensor to a separate board for range testing. Pinouts for the modules can be found in their datasheets and pin connections to the AVR can be found in the source code (wireless_tx.c and wireless_rx.c).
    My code for interacting with the wireless module is available on Google code:
    http://code.google.com/p/cywusb

    Have fun!

    Altec Lansing ACS295 Subwoofer hack

    This page will show how to use the subwoofer from the Altec Lansing ACS295 2.1 speaker kit as a stand alone active subwoofer without using the satellite speakers. The speakers are controlled from one of the satellites (as seen in the picture below, the controls are on the left satellite speaker) so if the satellites are lost the subwoofer is dead in the water..

    We (me and Fredrik) found two of these subwoofers at a second hand hifi shop and wanted a active subwoofer for a home cinema. There where no sattelites and searching the web we only found other people wanting to know how to use the subwoofer stand alone and that Altec Lansing isn't exactly handing out datasheets :P Thus, we took the subwoofer apart and analyzed/traced the circuit board. Here are some high resolution photos of the board:



    The speakers are controlled by a TDA7433 audio processor that speaks I2C with the controls on the satellite. This is a pinout of the connection to the satellite (red connector in the picture above from Dells support page):


    After studying the datasheet for TDA7433 and this page about I2C I wrote a controller program for a Atmel Mega8 using avr-libc and connected it to SDA and SCL together with 4.7kOhm pull-ups (there are no pull-ups on the circuit board inside the ACS295). Power the amplifier on by connecting the power pin to ground as shown in the pinout above, send the right parameters via I2c and eureka, we have a working subwoofer! :D Unfortunately Altec chose a cheap plastic to cover the back of the subwoofer and this plastic vibrates and makes a noise when the base is pumping :( Let me know if you find a solution to this (we are thinking of replacing it with wood).
    I've made the source code for the AVR I2C controller available at google code:
    http://code.google.com/p/acs295 (google is closing down code so the source has moved to github: https://github.com/larsenglund/acs295)
    I´d be happy of you post a comment if any of this is useful to you, happy hacking!