Thursday, May 19, 2016

usb power meter hack

I wanted to use one of the cheap USB power meters as a general DC voltmeter and ammeter.

The label on the module gives a range of 3.5 to 7 V and 0 to 3 A. Inside is a Holtek HT46R064B 8 bit microcontroller with an analog to digital converter.

The modification is very simple. Cut a USB extension cable in half and use the power wires as the input and output connections. In a normal USB cable, red is positive, black is ground, and green and white are the data wires.

I tested it with a single cell LiPo battery and it worked.

HT46R064B datasheet:

http://pdf1.alldatasheet.com/datasheet-pdf/view/439737/HOLTEK/HT46R064B.html

Photos below.

Photos and videos

usb power meter as a general dc meter, photograph 1
usb power meter as a general dc meter, photograph 2
usb power meter as a general dc meter, photograph 3

Friday, May 13, 2016

debayering raspberry pi camera (monochrome mod)

A monochrome camera can have better sensitivity and useful spatial resolution because every pixel responds to the available light instead of being divided into red, green and blue pixels by a Bayer color filter.

For example, a typical Bayer pattern has approximately 25 percent red pixels, 25 percent blue pixels and 50 percent green pixels. When photographing something that is mainly green, most of the useful signal comes from only half of the sensor pixels.

I wanted to try removing the Bayer filter because Raspberry Pi did not offer a monochrome camera module at the time. I had upgraded my cameras to the newer version, so I used the old modules for the experiment.

The Pi NoIR camera is not monochrome. It only lacks the infrared blocking filter. It still has the Bayer color filter on the sensor.

Removing the filter was neither quick nor easy. The lens holder is attached with a thin layer of epoxy. The safest method I found was to release one corner carefully and use that opening to separate the board from the holder.

Four cameras died during the first attempts. Two were damaged while opening the lens holder and two during the actual filter removal.

There are extremely fine bond wires around the edge of the sensor. Touching or shorting them will kill the camera. I did the early attempts without a microscope because I was too lazy to drive to TAMI. The later close up photos were taken through a Mantis microscope that I bought afterward.

The fifth camera was scraped while it was operating so I could see exactly when something went wrong, and that attempt worked. Very little pressure is needed. Too much force can move the sensor die and tear the bond wires.

There also appeared to be another coating below the Bayer layer, possibly an antireflection coating, although I was not certain.

I later killed that camera while adjusting the focus. The hot glue holding the lens socket came loose, moved the sensor and tore more bond wires, bringing the casualty count to five.

I tried several solvents in an ultrasonic cleaner without success. Later, photoresist remover followed by cleaning solvent removed the filter without damaging the sensor, which was a much better method than scraping it with a knife.

The first finished image had the focus slightly off, but the monochrome conversion worked.

TAMI:

http://telavivmakers.org/

Videos:

https://www.youtube.com/watch?v=KisS9qxq3-4

https://www.youtube.com/watch?v=k3NDk3Tzz4M

Process and result photos below.

Photos and videos

raspberry pi camera monochrome conversion, photograph 1
raspberry pi camera monochrome conversion, photograph 2
raspberry pi camera monochrome conversion, photograph 3
raspberry pi camera monochrome conversion, photograph 4
raspberry pi camera monochrome conversion, photograph 5
raspberry pi camera monochrome conversion, photograph 6
raspberry pi camera monochrome conversion, photograph 7
raspberry pi camera monochrome conversion, photograph 8
raspberry pi camera monochrome conversion, photograph 9
raspberry pi camera monochrome conversion, photograph 10