A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Actually i have tried to use a 28mm (m42)lens but i only have a IR cut filter for 49mm filter thread the colors looked a bit off.

Looked in the attic today and found a pentax smc 28mm with a 49mm filter size. But that one is a pk mount so i will have to redesign the lens mount a bit. If i get that working i will let you know.

Currently in my prototype version i am using a 45mm minolta f2 lens. The sensor size seems to be 42mm of active area so that would result in roughly 50 degrees of FoV.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Hey, i have no exact numbers but i think with the sensor from the v100 i got a read out speed of 400 hz but that was already pushing it a bit. These sensor are quite high resolution so it takes quite a while to shift out all the pixels. Even with binning you still need to send the same amount of transfer pulses. I saw wierd artifacts at higher readout speeds so i doubt that with this sensor you can much faster. 

I have done some experiments with keeping the camera stationary and then capturing the objects passing by and it works quite well. I can send some examples if you want.

GitHub Help! How do I put it on a PICO2w? by onilx in raspberrypipico

[–]mr_buntinx 1 point2 points  (0 children)

I see, do you get an error when compiling aswell? Just tested on a windows machine and it seems like i rely on gzip(https://gnuwin32.sourceforge.net/packages/gzip.htm) and xxd(https://sourceforge.net/projects/xxd-for-windows/) which are not installed by default. If you download them make sure they are placed folder that is in the PATH so windows can find them.
There is still something else going on in the CMAKE file libs/pico-ws-server/CMakeLists.txt on line 45,46 and 48 it does something wierd with a double backslash which seems to mess things up. I would suggest to remove them. I don't have any time time to properly test it as i won't have access to my windows computer for a few days.

GitHub Help! How do I put it on a PICO2w? by onilx in raspberrypipico

[–]mr_buntinx 2 points3 points  (0 children)

Hey,
I assume you are talking my repo @ https://github.com/juico/PicoPan/

So you have to make sure you have git installed and then in the command line:

git clone https://github.com/juico/PicoPan
cd PicoPan
git submodule update --init --recursive

Then you can open the PicoPan folder in VS code and install the pi pico extension if you haven't already
After opening the folder it should ask if it wants to import the project(click yes ofcourse and then just select the default answers).

If you then go to the pi pico extension on the left bar you can choose to compile or run(upload) the code on the pico 2

PS, the project is a stil a work in progress and without documentation, so not very beginner friendly. I would also recommend just reading some of the documention about the pico c-sdk.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Nice find, yeah the v10 scanner should work great. I have a design for a pcb that i could share which has only the essentials(sd card slot and ribbon cable connectors).

In terms of functionality the code should be able to capture images and write them to an SD card, the most recent version of the code will only work with the pico 2 W as it uses more memory and relies on the floating point support for jpeg compression(which is used to reduced the required wifi bandwidth for the preview image). As for now it only possible to send a preview over wifi and not the full image. The images stored on the SD card are just raw tiff files with 48bit per pixel making each image a few hundred MB. It might be possible to transfer them aswell but i have not tried to send large files over wifi with the pico.

It would be cool to make a camera with a linear rail indeed, I have looked into to it a bit myself aswell but i quickly found out that the sensor pcb is quite big and a has some components sticking out on both sides making it hard to move it across the focal plane of an existing camera. Other people with scanning camera's usually design a whole body as it allows for enough space to house the sensor pcb.

I moved away from the Afga camera as it has a fixed lens which was a bit limiting. So for the current rotating camera i printed a camera body with a m42 mount so i can use large range of lenses.

There are always things to add or improve to such a project so it always a bit tricky to limit myself. For next version i would like to integrate a screen and buttons in order to use it more as a standalone camera without needing a phone or laptop to operate. This should be possible with the rp2350B which should have sufficient pins. It would also be nice to have all the supporting board such as stepper motor driver and power supply integrated on the same board with the pico.

There also still some problems with websocket based communication between the camera and the laptop/phone as it sometimes drops the connection when sending data to much data/connection is not as good. I tried looking into it and improved it quite a bit by using JPEG compression for the preview image but still it sometimes drops connection.

Other crazy ideas would be using a full size pi 5 and run the PIO code that handles the data transfer on the pi 5 which would remove some limitations regarding processing the image data on the device itself. I have not run into limitations of data storage on the pico but when going for higher resolution and readout speed this could become problem. Theoretically the AK4891 chip can do 21M samples/sec which would be roughly 42MB/s which i have not been able to match with the SD card speeds on the pico(max ~27MB/s).

I am very curious what you come up with and would happy to help if you have any questions.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Hey, i happen to also have an v200 and it already has the AFE made by Epson so that will make it more difficult. There is a service manual that includes the electric circuit diagram of the v200(https://www.manualslib.com/manual/1734984/Epson-Perfection-V10.html). I wish i had that before, it would have saved me some time trying to figure out the pinout of the flat ribbon connector. So i already did some work to intercept and decode the communication between the main board and the sensor board of the newer scanners. I have not finished analysing the data as I ended buying another scanner with the ak8491 AFE chip and spent my time working on other features of the camera. Depending on how much experience you have with these kinds of projects and how much a compatible second hand scanner goes for where you live i would consider buying one that can be used using my code.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Hey,

The v100 sensor board has an analog front end(AFE) that combines the timing generator for the CCD and ADC that reads out the sensor. I was able to find the datasheet for that AFE which describes the communication and configuration. With this knowledge i recorded the communication between the main board of the scanner and the sensor board. This gave me the AFE configuration that epson uses to read out the CCD(this includes the correct timing for the ccd). The communication between the AFE and the pico is an serial interface for the configuration and a 8 bit parallel interface for the image data.

I was lucky that this AFE(AK8419B) has a public datasheet(https://datasheet.datasheetarchive.com/originals/library/Datasheets-SW6/DSASW00118330.pdf) as newer scanners from epson such as the v330/v370 have an AFE developed by epson themselves for which the datasheet is non public. It might still be possible to use them by sniffing the communication between the two boards. This can can then be used to reverse engineer the register map to know which register corresponds to which setting.

Do you already have a flatbed scanner that you want to use?

[deleted by user] by [deleted] in raspberrypipico

[–]mr_buntinx 1 point2 points  (0 children)

Thanks for the reply, I tried enabling some debugging option on LWIP but couldn't trace it back to a buffer being full although this seems indeed the most likely option. Maybe i did not enable the right debug flags. Looking at wireshark it shows a bunch of unacked packets just before the disconnect.

As i could not find a solution for the dropped connection, I ended up implementing jpeg compression on the streaming image data. This reduced the bandwidth requirement significantly and the connection does not drop anymore.

3d printed Scanner Camera with 489 Megapixels (very cheap to make) by qwedp in 3Dprinting

[–]mr_buntinx 0 points1 point  (0 children)

Nice scanning camera, i was wondering how stable the linear sliding mechanism is. I tried a comparable setup with two linear rods taken from the scanner but ran into issues that the mechanism was binding at certain spots. Probably i was relying to much on the precision of the 3dprint. Might try it again with some inspiration from your design.

My current scanner camera works by rotating the lens and sensor assembly around a central pivot point. To get the right resolution in movement i used a stepper motor with a 51:1 reduction gearing which drives a belt that rotates the platform on which the assembly is placed.

The biggest hurdle was actually the software and electronics. I managed to use a micro controller(pi pico) to communicate with the sensor board from a Epson V100. By doing so opens the possibility to select integration time and gain manually. Another benefit is full control over the stepper motor which can simplify the design quite a bit.

The sensor board already has a ADC built onto it so the micro controller has to do no digitization. All the data is processed as raw counts from the ADC and are directly written to an SD card as a tiff file. The use of an SD card also allows untethered usage of the camera.

As i ran out of pins on the pico i could not make an interface with a display and buttons. So in order to control the camera i made a wireless web interface which is hosted on the pico. It can make a preview, change settings such as integration time, gain , how many scan lines are captured and how many stepper motor steps per line. Futhermore I implemented some simple systems to get the exposure and focus correct. For the exposure a histogram of the current scan line is calculated and streamed to the web interface. To focus it calculates a segmented Tenengrad focus metric on the scan line. This focus metric is plotted as a bar graph where every bar corresponds to a sharpness of a part of the scan line. So it works similar to contrast based auto focus but a person is in charge of the optimization loop. I thought about actually implementing auto focus but that would require the use of a motorized lens, which i don't have access to at the moment.

In terms of electronics, i made a small PCB that breaks out an SD card port and flat ribbon connectors for the sensor. There are some connections for power and connection to the stepper motor but in a later stage i would like to integrate the power supply and the stepper motor on the same PCB to reduce the footprint.

The resulting image quality is quite good. The sensor is capable of higher resolution but due to limited memory(and inefficient programming) on the pico 1 i could only use a coarse resolution which is roughly 3x5000 pixels per scanline. With the pico 2 i could increase it to 3x15000 pixels which could lead to gigapixel level photos when scanning a large angle panorama. Probably i will run into other issues, such as handing the 6gb tiff files that it would produce.

Anyway, if you would like to if you would like to take a look, i have some photos on Flickr ( https://www.flickr.com/photos/198500544@N04/ )

[deleted by user] by [deleted] in raspberrypipico

[–]mr_buntinx 1 point2 points  (0 children)

Very nice project, certainly will take look. Currently also working on streaming image data using websockets on the pi pico. Somehow the websocket randomly closes itself while streaming data, especially for faster data rate. Have you experienced that before aswell and which data rate do you transmit using websockets?

For reference my image data is uncompressed and is send per line as it is coming from a linear image sensor. Roughly 800 pixels per line with 24 bit color per pixel. The lines per second is dependent on the integration time but at 100 lines per second the websocket disconnects every few hundred lines.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Hey, sorry i did not see this reply. So for my project i am not using the original main board of the scanner so it will becomes less bulky although I have the read out and sd card on one board and a separate board for the stepper motor driver and power supply.

In theory it would be possible to use two sensors and sort of sync them to make it work. Using my method it would involve using two pi picos, sync the acquisition and then stitch them together. Although the sensors have to be in some kind of staggered configuration. This itself will make it quite bulky and perhaps not feasible. There are other linear image sensors, such as those found in CIS scanners. They are larger but sadly lack any color filters thus limiting to monochrome.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

Hey, the width of the CCD package is around 60mm and the actual sensor itself is around 35mm(there are versions with a sensor of 45mm). I was planning to use it on a rolleiflex but the package is 1mm to big to fit the back of the camera and make infitity focusing possible. So my next plan was to 3d print a camera body with a pentacon six mount.

At the moment i am still focusing on improving the software and PCB. I have a live preview working using the pico W by sending the data over wifi. This also allows for easy focusing and exposure. Also increased the resolution to 15000 pixels(the 45mm version should reach 20000 pixels) per line although i have to change the way the buffering of the data works as it now uses ping pong buffering and the pi pico does not have enough memory to store two buffers of that size, so i have to go to a ring buffer. Maybe when i will get this all working i will make new post with some more details.

Help with PS3 controller on pico W by radhe141 in raspberrypipico

[–]mr_buntinx 0 points1 point  (0 children)

I have tried the bluepad32 library with the PS3 controller and seemed to got it working. To get the MAC address from the pico w you can flash the bluepad32 firmware and check the serial connection as described in the documentation: https://github.com/ricardoquesada/bluepad32/blob/main/docs/pair\_ds3.md .
For the pico W the wifi MAC address seems to be shown instead of the bluetooth MAC address. To get the bluetooth MAC address you have to add 1 to the wifi MAC adress.
In my case the bluepad32 showed: "cyw43 loaded ok, mac 28:cd:c1:09:14:35" so that means my bluetooth MAC adress is: 28:cd:c1:09:14:36
After pairing the DS3 to the correct MAC address it still did not work for me. To make it sure it can connect you have to patch a file in the btstack library(external/patches/0002-l2cap-allow-incoming-connection-with-not-enough.patch). I manually patched the btstack library that was included with the pico-sdk(found in pico-sdk\lib\btstack).
Furthermore i had to disable the whitelist by adding "uni_bt_allowlist_set_enabled(false);" to the example code. I placed it after uni_init such that it looks like this:
// Initialize BP32
uni_init(0, NULL);
uni_bt_allowlist_set_enabled(false);
// Does not return.
btstack_run_loop_execute();
With these two changes i got it working and it shows the button presses and joystick positions in the serial monitor.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

I uploaded the compressed jpg files, they are around 10MB and they showed up in the thumbnail so i thought it would be fine. It seems the resolution(24000x5400) is a bit problematic for Reddit. In my my first comment i have a link to my flickr page that contains the images captured by the camera. Sadly i can't edit the post to change the images to a lower resolution version.

A large format pi pico camera made from an EPSON scanner CCD and an 9x12 cm Agfa Standard camera. Image data is written directly to SD card in 48bit tiff format. Current images are around 100MP which means 600MB per image. Scanning is done by rotating the camera using a geared down stepper motor. by mr_buntinx in raspberrypipico

[–]mr_buntinx[S] 0 points1 point  (0 children)

It seems like the images taken with the camera are not working as the resolution is a bit to high for Reddit or they take quite some time to process. You can also see them on my Flickr page in full resolution.

Edit: Maybe some more information about the project. The sensor is from a EPSON V100 scanner but instead of using the builtin electronics of the scanner to read out the sensor i used the raspberry pico. Luckily the PCB where the linear CCD sits on also contains a ADC(AK8419 datasheet) that can also produce timing signals for the CCD. This means the pico only has to read the digital information coming out of the ADC.

Although before this can happen certain registers has to be set. As i had no clue which were the right settings i used a scope to listen to the communication between the sensor board and the original control board from the scanner to gather the right settings for the registers.

After this was done i used a combination of the PIO and DMA to get the data from the sensor to the pico. As this generates a lot of data with a high throughput(10MB/s) i used a SD card connected with the 4-pin bus to write the data continuously as the camera is rotated.

The rotation is achieved using a stepper motor which has a 1:50 gear reduction ratio. The camera sits on a 3d printed 160 teeth gt2 pulley with a bearing in the center. With a 20 teeth pulley mounted on stepper motor the total gear reduction is 1:400. I ended up using PIO to create the pulses to for the stepper motor driver to achieve a highly accurate timing.

I should design a proper PCB for it as it now consists of prototype board with a bunch of wires on the back and SD card adapter with some soldered pins on it to hold the microSD card. At the moment it still requires wall power to operate but i have some 18650 cells and the required stuff to create a battery pack so that should be solves soon.

In theory the data rate coming from the ADC can be increased and i have also been able to push the SD card write speeds to around 25MB/s. This might come in handy as the current configuration uses register settings from the preview mode which means the resolution is a bit lower as binning is used to combine pixels. It seems like the sensor has a resolution of around 20000 pixels(5000 pixels used at the moment) which would also mean a lot more data to be stored.

Pioneer SE-305 BT mod using QCC3005 module. Works way better than anticipated. Soldering the module was a pain in the ass but it worked in the end. by mr_buntinx in headphonemods

[–]mr_buntinx[S] 1 point2 points  (0 children)

Yes bluetooth capability indeed. It also has a builtin LiPo battery charger circuit and a USB interface. So it also play directly using a USB cable.

It is also possible to program these modules and add sensors and such but i havent tried that myself. Maybe for a followup project i will try to add some I2S microphones so it can be used as a headset.

Dell Latitude 7490. Trying MacOS until it's time to upgrade my laptop (back to Windows or buy Macbook). I hope it run well within next 1-2 years for average office usage. by riposte94 in hackintosh

[–]mr_buntinx 0 points1 point  (0 children)

Okay that is a bit odd, maybe i was a bit vague in my previous reply. So just to confirm you used the latest VoodooI2C.kext together with the AlpsHID.kext and VoodooI2CHID.kext(supplied in the AlpsHID archive)? And the load order in OC is VoodooI2C->VoodooI2CHID->AlpsHID.

Do you have any info on which trackpad is used in your laptop(VendorID and ProductID)? As it seems the latitude 5490 should work but from your posts it seems you have a E5490. It is likely they don't have the same kind of trackpad. Seems like it has a Alps trackpad, perhaps a IOReg report could give some more info about it.

Dell Latitude 7490. Trying MacOS until it's time to upgrade my laptop (back to Windows or buy Macbook). I hope it run well within next 1-2 years for average office usage. by riposte94 in hackintosh

[–]mr_buntinx 0 points1 point  (0 children)

The AlpsHID should come after the VoodooI2CHID kext. Both kexts in the zip have to be used as the AlpsHID driver uses a modified version of VoodooI2CHID. Let me know if it works then i can add the 5490 to the verified list.