Creating a “death clock” with a Raspberry Pi and an OLED display is definitely a feasible project. Here’s an outline of how you could make it real, including the hardware and software components you’ll need, as well as some steps to get started:
Hardware Components:
- Raspberry Pi: A Raspberry Pi 3 or 4 would work well for this project, but even a Raspberry Pi Zero could suffice.
- OLED Display: A small OLED display, such as a 0.96-inch or 1.3-inch, connected via I2C or SPI. You can find these readily available online.
- RTC (Real-Time Clock) Module: To keep track of time accurately, even when the Raspberry Pi is powered off.
- Speakers or a Buzzer: For sound notifications, such as when it asks “Are you beating the reaper?”
- Buttons or Sensors: Optional, but you could add buttons or proximity sensors for interaction (e.g., to respond to the “Are you beating the reaper?” prompt).
- Power Supply: A reliable power supply for your Raspberry Pi.
Software Components:
- Raspberry Pi OS: Install Raspberry Pi OS (formerly Raspbian) on your Raspberry Pi.
- Python Programming Language: You’ll primarily use Python to write the code to control the OLED display, manage time, and handle other logic.
- OLED Display Library: Libraries like
Adafruit_Python_SSD1306
orluma.oled
will help you interface with the OLED display. - Time Management: You can use Python’s
time
anddatetime
libraries for time tracking and calculations. - Sound Library: Use a library like
pygame
oromxplayer
to play sounds or use a simple buzzer controlled by GPIO.
Basic Steps to Build:
1. Set Up the Raspberry Pi:
- Install Raspberry Pi OS on a microSD card and set up your Raspberry Pi.
- Enable I2C/SPI and set up SSH for remote access (optional but helpful).
2. Connect the OLED Display:
- Connect the OLED display to your Raspberry Pi using the appropriate pins (I2C/SPI).
- Install necessary libraries and run test scripts to ensure the display is working.
3. Display Time and Countdown:
- Write a Python script to display the current time and calculate the estimated days remaining based on your birth date and an assumed lifespan (e.g., 80 years).
- Use the
datetime
module to calculate the time remaining and update the display periodically.
4. Add the “Beating the Reaper” Prompt:
- Set a specific time each day when the OLED displays the message “Are you beating the reaper?“.
- Optionally, add logic for user interaction using buttons or sensors.
5. Implement Sound:
- Connect speakers or a buzzer to the Raspberry Pi.
- Use a sound library to play a sound when the “Are you beating the reaper?” message is displayed.
6. Design the Enclosure:
- You can design an enclosure to house the components, matching the aesthetic you prefer (e.g., Raypunk with Steampunk elements).
- If you have access to 3D printing, you could print a custom case. Otherwise, you could use wood, acrylic, or other materials.
Example Code Snippet:
Here’s a basic example of Python code to display the current time and days remaining:
import time
from datetime import datetime, timedelta
from luma.core.interface.serial import i2c, spi
from luma.oled.device import ssd1306
from luma.core.render import canvas
from PIL import ImageFont
# Initialize OLED display
serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)
# Set your birthdate and lifespan in years
birthdate = datetime(1990, 1, 1)
lifespan = 80
def calculate_days_remaining():
death_date = birthdate + timedelta(days=lifespan * 365)
days_remaining = (death_date - datetime.now()).days
return days_remaining
while True:
with canvas(device) as draw:
# Display current time
now = datetime.now().strftime('%H:%M:%S')
draw.text((0, 0), f"Time: {now}", fill="white")
# Display days remaining
days_left = calculate_days_remaining()
draw.text((0, 20), f"Days Left: {days_left}", fill="white")
# Optional: add logic for the "Are you beating the reaper?" prompt
time.sleep(1) # Update every second
Additional Tips:
- Custom Fonts and Graphics: You can load custom fonts or small images to the OLED for a more personalized display.
- Encouraging Reflection: Beyond just displaying time, you could integrate additional reflective prompts or even allow for user inputs via buttons to track daily goals or mood.
Resources:
- Adafruit’s Learning System: Offers great tutorials for setting up OLED displays with Raspberry Pi.
- Raspberry Pi Forums: A great place to seek help if you encounter issues.
With some creativity and tinkering, you can create a functional and artistic “death clock” that serves both as a memento mori and a functional desk clock.
Prototyping Example:
Certainly! Let’s walk through a hypothetical workflow for designing and prototyping your “Death Clock,” a memento mori that combines raypunk and steampunk elements. This workflow will integrate the tools and strategies we’ve discussed, tailored for someone with novice skills across the board.
Step 1: Conceptualization and Ideation
- Brainstorm and Research:
- Objective: Define what the “Death Clock” means to you. What emotions or thoughts should it evoke? What specific elements of raypunk and steampunk do you want to incorporate?
- Action:
- Research: Gather references from raypunk and steampunk aesthetics. Look at existing clocks, props, and devices from both genres. Focus on key visual elements like gears, tubes, glowing dials, rusted metals, and retro-futuristic details.
- Mind Mapping: Use a tool like Milanote or Lucidchart to map out the visual and functional aspects of your design. List the features you want (e.g., a glowing tube with countdown numbers, exposed gears, brass accents).
- Sketching: Spend 30 minutes each evening sketching different ideas. Focus on overall shapes, proportions, and the arrangement of key elements like dials, gears, and tubes.
Step 2: Initial Sketches and Refinement
- Create Detailed Sketches:
- Objective: Refine your sketches to get a clearer idea of how the “Death Clock” will look and function.
- Action:
- Sketch Multiple Views: Draw the clock from different angles (front, side, top). Focus on perspective and form. Include rough dimensions to guide your next steps.
- Detail Key Components: Sketch close-ups of important features, like the raypunk-style glowing tubes, the steampunk gears, or the clock’s main face. This will help you when you move on to 3D modeling or physical prototyping.
- Annotate Your Sketches: Note materials (e.g., brass, glass, wood), functionality (how gears move, how the clock counts down), and any electronic components you plan to integrate (e.g., LED lights, digital display).
Step 3: Cardboard Prototyping
- Build a Cardboard Mockup:
- Objective: Create a low-cost, physical prototype to explore shapes, profiles, and spatial relationships.
- Action:
- Cut and Assemble: Based on your sketches, cut out the basic shapes of the clock’s body, gears, and other components from cardboard. Focus on the overall form and how different parts fit together.
- Iterate Quickly: Use tape or glue to assemble the pieces. Don’t worry about precision—this is about getting a feel for the size, shape, and ergonomics of your design.
- Test Interactivity: If your design includes moving parts (e.g., rotating gears), try to replicate these with simple mechanisms. This will help you understand any potential mechanical issues before moving to digital modeling.
Step 4: Digital Modeling with Blender and FreeCAD
- Model in Blender and FreeCAD:
- Objective: Translate your refined sketches and cardboard prototype into a digital 3D model that can be used for detailed design and 3D printing.
- Action:
- Start Simple in Blender: Model the basic shape of your “Death Clock” in Blender. Focus on getting the proportions right based on your sketches and cardboard prototype. Use Blender’s modifiers (e.g., Mirror, Array) to help with symmetry and repetition (e.g., gears).
- Detail with FreeCAD: For any mechanical components (like the gears or moving parts), switch to FreeCAD to create precise, parametric models. Export these components and integrate them back into your Blender scene.
- Texture and Render: Apply materials and textures to your model in Blender. Use brass, wood, and glass textures to give it that steampunk feel, and add glowing elements for the raypunk touch. Render a few images to evaluate the aesthetics.
Step 5: Electronics Planning and Integration
- Plan the Electronics:
- Objective: Integrate the electronic components needed for the “Death Clock,” such as LED lights, a digital countdown display, or motorized gears.
- Action:
- Circuit Sketching: Use a tool like Fritzing to sketch out the electronics schematic. Plan where the components will fit in your design, how they’ll be powered, and how they’ll interact (e.g., how the countdown display integrates with the rest of the clock).
- Test Components: Before finalizing the 3D model, test your electronic components separately to ensure they work as expected. This might include programming a simple microcontroller (like an Arduino) to control the countdown timer and LED lights.
- Integrate with 3D Model: Ensure your 3D model has space for the electronics. Adjust the design as needed to accommodate wiring, batteries, and other components.
Step 6: 3D Printing and Assembly
- Print and Assemble the Clock:
- Objective: Create the physical version of your “Death Clock” by 3D printing the parts and assembling them with the electronics.
- Action:
- 3D Print Components: Export your Blender and FreeCAD models for 3D printing. Start with small test prints to ensure that everything fits together as expected. Then, print the final parts.
- Finish the Prints: Depending on your materials, you may need to sand, paint, or otherwise finish the 3D prints to achieve the desired steampunk/raypunk look.
- Assemble the Clock: Put together the 3D printed components, install the electronics, and do any final adjustments. Test the clock to ensure it works correctly and looks as you envisioned.
Step 7: Final Refinement and Iteration
- Evaluate and Iterate:
- Objective: Refine your “Death Clock” based on the assembled prototype. Make any necessary adjustments to improve functionality or aesthetics.
- Action:
- Test the Clock: Use it as intended—see how it looks and feels, and make note of any issues. This might include mechanical adjustments, electronic tweaks, or aesthetic refinements.
- Go Back to Sketching if Needed: If you discover significant issues, return to your sketches to brainstorm solutions before implementing them in the next prototype.
- Document the Process: Take notes on what worked, what didn’t, and what you learned. This documentation will be invaluable for future projects.
Summary of the Workflow:
- Conceptualization and Ideation: Research, sketch, and brainstorm your “Death Clock” design.
- Sketching and Refinement: Create detailed sketches to define form, function, and aesthetics.
- Cardboard Prototyping: Build a physical mockup to explore shapes and spatial relationships.
- Digital Modeling: Use Blender and FreeCAD to create a detailed 3D model.
- Electronics Planning: Design and test the electronic components that will bring your clock to life.
- 3D Printing and Assembly: Print the parts, finish them, and assemble the final clock.
- Final Refinement: Test, refine, and document the completed project.
By following this workflow, you’ll be able to bring your “Death Clock” idea to life systematically, even as a novice. Each step builds on the previous one, allowing you to develop your skills while progressing towards a tangible, finished product.