I'm finally heading to the conclusion of this project which I have enjoyed beginning-to-end. Essentially this project will use a Raspberry Pi 3B+ and a Raspberry Pi Touch Display to work, but I've added as a bonus a few custom made PCBs and will add a Camera Module V2 to try making it more interesting.
The custom made PCBs have arrived which means is time to gather all the components needed and to start assembling the electronics!.
Electronics
BOM
- 1 x Raspberry Pi 3B+
- 1 x Raspberry Pi Touch Display
- 1 x Camera Module V2
- 4 x M3-0.50 x 4mm Socket Head Cap Screws (to secure the Touchscreen to 3D printed frame)
- 4 x #2 x 1/4" Slotted Round Head Screws (to secure the Camera to the 3D printed frame)
- 5 x WS2812B Addressable RGB LED
- 5 x 0.1µF, 6.3V Ceramic Capacitor, 0603[1608]
- 1 x 0.1" pitch (2.54 mm) Female Header: 1x4-Pin, Straight
- 1 x 0.1" pitch (2.54 mm) Male Header: 1x4-Pin, Straight
- Stranded Wire: Various colors, 26/28 AWG
- Heat-shrink tube
Custom made electronics prep work
{gallery:width=960,height=768,autoplay=false} Custom made electronics |
---|
Hologram Pi-ramid: Custom made PCBs |
Hologram Pi-ramid: Custom made PCB |
Hologram Pi-ramid: Preparing PCBs |
Hologram Pi-ramid: Applying solder paste |
Hologram Pi-ramid: Manually placing SMD |
Hologram Pi-ramid: Wire stripping |
Hologram Pi-ramid: PCBs ready to install |
Testing the WS2812B with Python
To make sure the WS2812B Addressable RGB LEDs work correctly (all of them) I wrote a simple Python sketch, that lights every LED with different colors for a fraction of a second, the LEDs should be connected as below picture which is how they will assembled into the project as well.
NeoPixel Library for Python
There are several libraries out there for controlling WS2812B LEDs with Python and a Raspberry Pi, perhaps the Neopixel is the easiest and the most popular library out there.
To install the Neopixel library I ran the following command:
sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
Python RGB test code
When I was reviewing the :GAME ZIP 64 for the BBC micro:bit I remember I had this strange issue where a single RGB LED won't light blue -scenario which I accounted for; the script will turn on each RGB channel independently, then it will turn on the RGB channels in pairs and finally will do few random combinations (all RGB channels combined).
#!/usr/bin/env python3 # # -*- coding: utf-8 -*- # Tests WS2812B Addressable LED with basic color pattern and some random RGB # # Luis Ortiz - luislab.com # May 19, 2019 import board import neopixel import random from time import sleep import subprocess numLEDs = 5 ledStrip = neopixel.NeoPixel(board.D18, numLEDs, brightness=0.01, auto_write=True) ledPos = 0 seqNumber = 1 seqArray = [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 0], [1, 1, 1]] R = G = B = 0 try: while True: if (seqNumber < 8): R = seqArray[seqNumber][0]*255 G = seqArray[seqNumber][1]*255 B = seqArray[seqNumber][2]*255 elif (seqNumber <= 13 and ledPos == 0): R = random.randint(0, 255) G = random.randint(0, 255) B = random.randint(0, 255) ledStrip[ledPos] = (R, G, B) ledPos = (ledPos + 1) % numLEDs if (ledPos == 0): seqNumber = (seqNumber + 1) % 14 sleep(0.20) except KeyboardInterrupt: ledStrip.fill((0, 0, 0)) print("\nTest complete!")
After the testing is complete I continued with the assembly
{gallery:width=960,height=768,autoplay=false} Hologram Pi-ramid final assembly |
---|
Hologram Pi-ramid assembly: Top and Front ambient RGB lightning |
Hologram Pi-ramid assembly: Top ambient RGB lightning |
Hologram Pi-ramid assembly: Wires routing |
Hologram Pi-ramid assembly: Touch display assembly |
Hologram Pi-ramid assembly: Raspberry Pi assembly |
Hologram Pi-ramid assembly: Camera Module V2 assembly |
Hologram Pi-ramid assembly: Camera Module V2 mounted |
Hologram Pi-ramid assembly: Header |
Hologram Pi-ramid: DIY splice connectors |
Hologram Pi-ramid: Final assembly (back) |
Hologram Pi-ramid: Final assembly (side) |
Hologram Pi-ramid: Finally assembled! |
Blogs in this series
- Hologram Pi-ramid - Intro and initial design
- Hologram Pi-ramid - 3D CAD/CAM design
- Hologram Pi-ramid - 3D printed parts and initial assembly
- Hologram Pi-ramid - Plexiglass Pyramid
- Hologram Pi-ramid - My name is Automan
- Hologram Pi-ramid - PCB Design
- Hologram Pi-ramid - Painting the 3D printed parts
- Hologram Pi-ramid - Electronic Parts
- Hologram Pi-ramid - Displaying Holograms
- Hologram Pi-ramid - Project complete!
Top Comments