Raphael-Boichot / Mitsubishi-M64282FP-dashcam

A 8-bit digital camera made with the Mitsubishi M64282FP sensor of the Game Boy Camera and a Raspberry Pi Pico. Also supports the rare M64283FP sensor. Made for fans by a fan.
GNU General Public License v3.0
48 stars 1 forks source link

The DASHBOY CAMERA

A 8-bit digital camera made from the Mitsubishi M64282FP artificial retina and a Raspberry Pi Pico.

Media coverage:

The project fully emulates the sensor management strategy of the Game Boy Camera while completely bypassing the MAC-GBD mapper, which means you can record pixel perfect images without the limitation of storage space or the need for a Game Boy Printer emulator. The device can output dithered 2 bits per pixel images (like the Game Boy Camera) as well as smooth 8 bits per pixel images that take advantage of the full sensor bit-depth. It features time lapse recording, live recording, motion detection, High Dynamic Range, multi-exposure, night mode, Peak Focusing, Slit-scan photography, fancy borders and even more.

The code was developped for the Raspberry Pi Pico and the Arduino IDE, using the Earle F. Philhower RP2040 core. TFT display is driven with the Bodmer TFT_eSPI library. The code originates from an Arduino version that requires a PC. This project was preceded by a regrettable attempt to do the same with an ESP32 (good luck porting back the code to it with the same functions now).

If you manage to touch the unobtainium M64283FP sensor, which is probably a parent version of the M64282FP, it is fully compatible with the present device (but more or less with the Game Boy Camera, see the full story). I was lucky enough to get some and study how to make them work smoothly.

You're of course free to modify this project as you wish, all sources are available here (all files for PCBs, all source codes, all documentation used). The project was designed to be clean, cheap and easy to make (requiring only cheap and very common parts, very basic soldering skills, no 3D printed parts, simple Arduino IDE environment and some hot glue). Fork it and play with it !

Picture of the device (example of PCB V1.0)

Dashboy Camera V1.0

Multi-systems installation guide

Or if you can sustain moderate pain:

Then:

Casual user manual (requirement: just pushing buttons)

The Dashboy Camera uses a configuration file that must be placed at the root of SD card which has priority on the internal default parameters. The device cannot boot without a working sensor and a working SD card. Status of sensor, SD card and configuration file are indicated on the splashscreen.

To activate HDR mode or Dithering mode, simply push the corresponding pushbuttons.

HDR mode (High Dynamical Range) take several images from -1EV to +1EV and make an average of them before recording. This increases the dynamic of the sensor. The list of exposures can be modified in the config.json. Keep the total length of the table at 8 entries !

Dithering mode mimicks the dithering process of a Game Boy Camera with 4x4 derived Bayer matrices. Dithering matrices generated online can be copied in the config.json file.

Finally, you can lock exposure time from the current best one in any mode by pressing the LOCK_EX push button. It displays a green screen border when it is on.

It is mandatory to format the SD card in FAT32 and it is better to use the maximum sector size possible to speed up writing and avoid stalling. The data transfer rate to the SD card is indeed the bottleneck of the device.

The device outputs 1x BMP images natively but the projects comes with a bunch of tools to convert and upscale them and make videos from image series.

Using the DashBoy Camera "in a nutshell"

DashBoy Camera in a nutshell

Advanced user manual (requirement: playing with json file)

Additionally, you can address other cool features by entering them in the config.json:

Nerd user manual (requirement: recompiling the code)

You can also directly play with the #define options in config.h and recompile the code to:

Some pictures made with the M64282FP sensor (old border)

Dashboy Camera pictures

More pictures made with the M64282FP sensor (actual border)

Dashboy Camera pictures

Pictures were taken with the original plastic lens, CCTV lenses, CCTV fisheye with M12/CS adapters, and a Tair-3s 300mm f/4.5 soviet telelens with a M42 lens mount or sensor glued into a Zenit 12XP hand made shell adapter.

Examples of slit-scan pictures and modes

The slit-scan mode infinite makes streaks whatever the scene. It gives interesting effects with long moving objects (trains) or natural scenes in the wind. It completely obliterates the background and only moving objects can be seen. It acts exactly as a photo-finish, in slower however due to sensor limitations. The slit-scan mode x128 scans the whole scene line by line, the immobile backgroung is conserved. Only the moving objects of the scene will be deformed in a grotestque fashion. Using this mode with a Game Boy Camera sensor is an idea of Andreas Hahn. Both mode loop infinitely as long as PUSH is not pressed.

Some timelapses made with the M64282FP sensor

Dashboy Camera pictures

Dashboy Camera pictures

Dashboy Camera pictures

Example of dithered/non dithered image, M64282FP sensor

Dashboy Camera pictures

Examples of artifacts intrinsic to the M64282FP sensor

Dashboy Camera pictures

Examples of image/timelapse taken with a M64283FP sensor

Dashboy Camera pictures

Dashboy Camera pictures

Examples of artifacts intrinsic to the M64283FP sensor

Dashboy Camera pictures

Because it had to be done !

These animations were done by simply stacking images taken 3 by 3 with RGB filters (auto-exposure activated). Lens is equipped with an IR filter too. Without IR filter, images in outdoor conditions have serious color issues (they always appear pinkish, I mean even more than these examples, without any way to correct the hue distorsion). Images were stacked with a dedicated Matlab code but I guess that any image software could do the trick.

Building the device !

Required parts

The total cost (Game Boy Camera not included), considering that you start from scratch, is about 35€ (PCB included). It has been designed to use ultra-cheap and ultra-common parts only. Most of parts can be recycled from used electronics or Arduino related projects. If you're a bit into electronics, you probably yet have most of the parts somewhere on shelves. It is fully through-hole on purpose so it necessitates nothing but very basic skills in soldering.

So you will need:

The device is meant to be used with AA NiMH batteries. Lithium batteries are evil because they are unstable (I'm definitely dubious about long term storage of what will eventually end as spicy pillows and fire hazard), not recycled (less than 1% in the best IEA scenario) and non generic at all in terms of size in case of reuse. The device does not allow to recharge these batteries as NiMH requires very specific charging strategy. It can run with alkaline batteries too (even pretty discharged). You can of course alter the design to use it with Lithium batteries and embedded charger, it works perfectly too (my first design used a DD05CVSA charge discharge circuit). You can consult here the sketch of the initial prototype to adapt a lithium battery charger. Beware, this early prototype has pinout that differs significantly from the current one.

PCB and connection with the sensor

PCB are available in the PCB folder of the project. To connect the sensor to the board, use a female JST connector with bended pins in order to inverse the gender of the JST cable, or simply order the breakout PCB. Be carefull with the polarity: both faces of the cables must be the same (camera sensor cable side and extension cable side, see following images). This situation corresponds also to the INPUT<->NORMAL OUT of the breakout board if you order the extension cables given in Required parts section.

Dashboy Camera connections

PCBs can be ordered at JLCPCB by simply uploading the gerber zip container to their site. JLCPCB has the advantage to be cheap and clean with the VAT for EU customers. Order HASL finish with 1.6 mm thickness for the two boards (default option). PCB designs and schematics can be edited with EasyEDA Standard Edition.

Building instructions

Image of the populated PCB as you will get it (PCB version 2.0, the current one)

Dashboy populated PCB

The GPIO22 pin, only digital pin left free on the Pi Pico, is exposed as well as a GND and 3.3V pins if you want to use them for other purpose like triggering something in/out of the device. It will of course require modifying and compiling the code.

Some random informations for you Game Boy Camera nerd !

Real dimensions of both the M64282FP and M64283FP from 83FP Japanese datasheet

Mask marking on the surface of the M64282FP sensor

Mask marking on the surface of the M64283FP sensor

The M64283FP and M64282FP sensors are pinout compatible

M64283FP sensor directly drop on a PCB sensor board (and happy to take image like that)

The register E used by the Game Boy Camera by default disables the edge enhancement of the M64283FP sensor

Kentaro Nishimura aka "the dancing man" of Game Boy Camera Game Boy Camera dancing man

The unknown face hidden in the Debagame Tester: Second Impact, probably Kentaro Nishimura too

My feedback about some Game Boy Camera lens modes I've tried with the GameBoy/Dashboy Camera

Things that were dismissed during dev because any project must be finished one day.

Some dev notes

Troubleshooting

Kind warning

The code and current design come as it. If you're not happy with the current hardware, the PCB EasyEDA design or the Arduino IDE, create your own, the licence allows it ! Push request with tested and working improvements are of course still welcomed.

Acknowledgments

Developpement steps

Dashboy Camera prototype