The camera has been going strong for nearly two years now. Although it is listed as a ‘completed project’ here, there was still one missing feature, overdue to be added. Since the beginning, I wanted the camera to somehow store its pictures in digital form. This, however, didn't happen until now because I couldn't make room for another SPI peripheral to drive an SD card, whichever way I tried to shuffle the pins around.
Now, however, I decided to go for bit-banging SPI. Of course, this would be way slower than hardware SPI, but then again, speed doesn't really matter: The camera can just store its photo after it's done printing and shut itself down once it has written everything to disk—how long that takes is not that relevant for user experience.
So, 4 arbitrary microcontroller pins were all I needed hardware-wise. I removed some originally planned features like the paper cutter servo driver, repurposed the status LED output and thus could make that happen just with stuff from my parts bin.
To mount the microSD card slot, I used a blank leshy PCB, on which I just populated the SPI pull-ups and a bypass capacitor next to the microSD connector. With the mounting pads simply soldered to the case's copper plating, the add-on is mechanically more than stable enough and doesn't budge at all when plugging and unplugging the SD card. The SPI lines were then wired up to the blue pill board just like everything else within the messy little box.
Also visible here are the two 18650s and their BMS PCB with which I had replaced the original battery pack a while ago (the old one was already worn out when I had installed it). The dangling extra connector with the black shroud near the centre is for balancing the pack while charging (there is no internal charging circuitry so far).
For the software, I wrote a simple BMP file output procedure. Since the images are fairly low-resolution, two-colour and dithered, the format is not only easy to write, but also actually close to optimal; e.g. a PNG's compression wouldn't save much space. Each picture takes up 2.72 KiB. Not really the stereotypical huge BMP file you might think of at first.
Even though the medium is quite different, I think the pictures retain quite a bit of their original appeal. Since the camera can be used without an SD card as well, just producing ephemeral printouts of all photos it takes, this addition is a strict improvement.
I published the extended source code as version 2.0 in the project's repository. Naturally, my blog post has been updated as well.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.