Lego Minfig Portrait Studio

by dohelpinspire in Circuits > Raspberry Pi

862 Views, 3 Favorites, 0 Comments

Lego Minfig Portrait Studio

20200907_125817.jpg
20200830_130637.jpg
DIY LEGO Minifig Portrait Studio (raspberry pi project)

I’ve played with Legos all my life, which means I’ve made, AND taken a part, a lot of minfigs. Wouldn’t it be awesome to capture those creations… With a Lego camera… With a flash… and a button… that uploads pictures to my cloud storage! Yep I really made one and I’ll show you how to make one too.

Supplies

I get a commission on purchases made through some of these links:

https://amzn.to/2YM5Udu Raspberry Pi Zero W

https://amzn.to/3jsNCpl Micro SD Card

https://amzn.to/2QKtPoV Arducam Lens Board for Raspberry Pi Camera

https://amzn.to/2YO3WJg Pi camera ribbon cable, full size down to Pi zero connector

https://amzn.to/34Nnd1z 10cm cable pack

https://www.adafruit.com/product/1578 500mAh Lithium Ion battery

https://www.adafruit.com/product/3196 Pimoroni LiPo SHIM

https://www.adafruit.com/product/1009 Colorful Round Tactile Button Switch Assortment - 15 pack

If you have never worked with a Raspberry Pi Zero before, you will want to pick up these items as well to help interface with it for initial setup and debugging:

https://amzn.to/3gDeG3q MicroUSB to USB 4 Port Black OTG Hub for Raspberry Pi Zero

https://amzn.to/3jLuMdf Mini HDMI to HDMI Adapter Cable

https://amzn.to/2DiS8Yg 4K High-Speed HDMI Cable

https://amzn.to/2QB7FWg CanaKit 5V 2.5A Raspberry Pi Power Supply

The Electronics

schematic 1.png
wired up.jpg

The button – We will need a sacrificial 2x2 stud lego that we will glue the button to. Make sure that you have selected 2 normally open pins on the button housing and solder wires with female connectors to it. Then I used 2 part epoxy to secure the button to the lego. Connect those wires to Pi Zero GPIO pins 34 and 36.

­­LiPo Shim – Slide the shim PCB over pins 1 through 12 and solder each lead with the Pi Zero.

The LED – Solder the resistor in line with either of the LED leads. Connect the (+) plus lead side to Pi Zero pin 4 (+5v) and (-) negative lead to pin 6 (ground).

The Software

20200903_211808.jpg
camera_code.png
  • Install the standard Raspberry Pi OS image on the Pi,
  • Connect a monitor, mouse, keyboard, the Pi camera, and power it up.
  • After the initial login and reboot continue on.
  • Test that your camera module / ribbon cable is connected and working. Raspberry Pi OS includes a helpful tool to take a picture:
    raspistill -t 1 -o 1.jpg
  • Join your wifi network
  • Clone the code I wrote from https://github.com/vincestechshop/lego-minfig-por... to /home/pi/lego-minfig-portrait-studio/
    Add:
    python3 /home/pi/lego-minfig-portrait-studio/camera.py
    to your /etc/rc.local file above the exit 0 line.
  • Install and configure rclone https://github.com/rclone/rclone
  • Connect the button and LED
  • Test that everything is working
    Run: python3 /home/pi/lego-minfig-portrait-studio/camera.py
    Press the button
    Expect to see an initial flash and then a flash when it finishes uploading the picture to the cloud.

For a bit more detail please see the full length video

The Lego Housing

camera parts.jpg

The fun part! You can see the parts I used for my build and you can watch how I assemble it all in the full length video. I'd love to see what you come up with!

If you like this project, be sure to subscribe to my channel:

https://www.youtube.com/channel/UCn3_Jog93YIoXLlKA...

Have Fun!

storm trooper 1.jpg
minfig - green guy.jpg
minfig - sniper 1.jpg
minfig - zombie 1.jpg
pink cyber guy 1.jpg
pink ninja 1 plain.jpg

Get some great shots of your masterpieces