Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Wednesday, June 04, 2025

my crystal neopixel lamp

The Concept:

This started from the idea of making a lamp with flashing, coloured LEDs inside. The inspiration here was seeing such a lamp made by Robin at Hackerspace for his grand-daughter. I learnt then about the ESP32 board which enables control of the flashing LEDs, aka Neopixels, from your phone.

Previously, I had made a Sierpinkski sieve a Sierpinski pyramid lamp with transparent PLA filament and lit it up with a couple of Circuit Playgrounds in the base. Up until then that was my favourite make! This background partially determined my direction for this project.

So, I found a crystal lamp on printables, here, which had been partially hollowed out and printed it with transparent filament.

This pic is from Printables: I plan to improve it with changing coloured neopixels that go to the top of the central pillar (see video near the bottom of this article)

Then began a complex process of research and buying of materials. I had to determine what to buy and the voltage and current requirements. Adafruit has a comprehensive uberguide about NeoPixels. Some helpful pointers from the adafruit uberguide were:

  • NeoPixels are usually described as “5 Volt devices” ... (but) ...Lower voltages are always acceptable, with the caveat that the LEDs may be slightly dimmer. There’s a limit below which the LED will fail to light, or will start to show the wrong color.
  • NeoPixels don’t care what end they receive power from. Though data moves in only one direction, electricity can go either way. You can connect power at the head, the tail, in the middle, or ideally distribute it to several points.

I also consulted with Robin at Hackerspace about which strips and ESP32 to purchase.

My plan became something like this:
  • purchase a cuttable RGB+IC 144LEDs/m WS2812B LED Strip. I then cut 3 strips, cutting at the copper dots, each 14 LEDs long and arranged them around a triangular prism so there will be lots of flashing lights from all directions.
  • design and 3D print a hollow triangular prism support for the LED strips after they had been cut
  • design and print a base with a cavity to hold the batteries and the ESP32 board
  • purchase a SuperMini ESP32-S3, 23mmx18mm, keeping it small so as to keep the cavity small
  • power the whole thing with 3xAAA batteries in a cylindrical holder (55mm long x 22mm diameter), amounting to 4.5 volts

In retrospect, this is or was a reasonable plan. Of course there are alternatives, eg. rather than the bulky battery holder run a cable to a 5v power supply. I was muddling through. Doing things for the first time is always hard.

Understanding the circuit and how the LED strip works

Initially I didn’t understand how the Neopixel strips (WS2812) worked. I hadn't grasped the significance of the comment in the adafruit uberguide, that "NeoPixels don’t care what end they receive power from." As it turns out each LED has its own processor. One side is positive, the other side negative and the data flows in one direction marked by an arrow on the strip. My understanding now is that the circuit(s) are made up on the fly as the current flows across through each LED.

Triangular prism designed with SCAD

I wanted to upgrade my 3D design skills so this time I opted to learn SCAD, which has a mathematical approach to design. I found it to be fairly intuitive after looking at a couple of beginner’s tutorials.

SCAD design of triangular prism onto which the LED strips are mounted (I printed this with transparent PLA filament too

Fastening the LED strips, wiring up, soldering and testing

I wanted a transparent hollow triangular prism to fasten the LED strips onto, with small holes at the top and bottom to run wires through to the inside. I designed this with SCAD. It was surprisingly easy and elegant!

I cut three strips, cutting at the copper dots 14 LEDs / strip. I wired up the positives at one one end and the GND and data the other end. The idea here was to avoid clutter at one end.

It took me a while and help from Robin to understand the circuit and data flow

  • the circuit goes through each LED (where is this explained?)
  • the arrows on the strip show the data direction

For stripping the wires I needed the right tool, although the experts can do it by feel. Before soldering I removed one LED from each strip with a heat gun. I did this because the copper dots when cut in half were very small.

I tested the strip using my Sunfounder kit and it was successful!

Design and redesigns of base with SCAD

I had to do a few redesigns along the way after I decided to insert a relatively bulky cylindrical battery holder (55mm long x 22mm diameter) into the base.

SuperMini ESP32-S3

I found helpful information about the SuperMini ESP32-S3 Development Board here.

  • some simple tests to check if the board was working
  • pin layour and which pins were safe to send data through

Then I had to figure out how to flash micropython onto the board. Once again help was there online: Instructions

Coding in micropython

I opted for coding in micropython which I find easier to understand than arduino C++. I bought a Sunfounder ESP32 starters kit, installed Thonny IDE and started working through their online micropython tutorials. They did have a micropython WS2812 tutorial for an 8 LED strip, which gave me a good start for the code.

I thought an effect where the colour grows stronger then fade and then changes to another colour would look good. It took me a while to figure out how to modify the code so it was both elegant and did what I wanted. This involved writing efficient functions and looking up the RGB values for different colours.

The Thonny code tested alright on the LED strips but then I had to figure out how to run it from the ESP32 board. With a Save As... I could download it to the board and then found an article which explained that it had to renamed main.py and then it would run.

There is also the WLED option which provides tremendous variety but you miss out on the joy of coding ;-)

Not the final version, but it does show the neopixels burning brightly!

Trouble shooting / Problem solving: Suitable wire thickness.

You need the right materials. The experts can wing it but mere mortals like me need the right materials.

"For the lack of a nail a kingdom was lost" - Shakespeare
For the lack of 26 AGW wire a crystal neopixel lamp was compromised - Kerr

During my near the end soldering session I suddenly discovered that two out of three LED strips no longer lit up. The problem was that I had used very thin wires and with a little twisting some of them broke. So, I went back to replacing the broken wires with thicker ones (22 AGW) and resoldering. But my problems persisted because now the wires were too thick and it is hard to twist three thick wires on the one side and solder them successfully to one thick wired on the other side. So, what I have planned here is to get some 26 AGW (in between thickness) wires and do the whole thing again!

Also my design lacked an important component given that I'm powering off three AAA batteries. A switch! This will be part of my new model

This experience has taught me to improve my soldering skills (use the third hand, flux and the solder sucker when required) and design skills (the wiring was far from elegant). Such is life. I've learnt a lot.

SUMMING UP: WHAT HAVE I LEARNT
  • Thonny python IDE upgrade and use
  • micropython for loops and functions
  • WS2812 Neopixel strip function (power, data), cutting procedure
  • Supermini ESP32 function and testing
  • OpenSCAD skills (designed and made tri prism and base)
  • Circuit or wiring design
  • Soldering skills (wire to wire, stripping, tinning, third hand, solder sucker, heat shrink)
  • Heat gun, to remove one of the LEDs from each strip
  • Problem solving and receiving help
  • Checking parts carefully before buying (eg. bought momentary switches)
REFERENCE

Wednesday, November 15, 2006

new game design tool


Fascinating blog by Ian Bogost about a new game design tool being developed by Eric Zimmerman, James Gee and Katie Salen.

I chatted to Tony about this who was disappointed that they weren't using existing tools such as Game Maker for their research.

The way I see it is that game design and programming are different sorts of things and that student game development is more stuck at the design phase, where students usually just try to build a clone or slight variation of an existing game. Students don't usually do original game design work.

My current thoughts are:
  • by taking the work out of learning programming and visual representation they hope to focus more on the design aspects of developing a game, which they see as the rules of the system - the demands of learning to program can be a drag / brake on design elements, particular for students who find programming difficult
  • I think it would be a huge step forward if we had better tools to teach and communicate about design - the bit they say about rules being central is impt I think, I've been fumbling around looking at UML (visual rep) and design patterns (which might be a bit like rules)
  • some people use UML diagrams as a programming blueprint although Martin Fowler, the author of UML Distilled (my review) doesn't like this approach, it is still an approach, ie. diagram input --> code output - they might have something similar in mind, but using rules not a visual
  • in industry the designer (the ideas) are more important than the programmer and there is a division of labour in the production process
  • it seems to be a new sort of approach, different from the 3 Ecks:
    1. have students build games from scratch;
    2. have educators and/or developers build educational games from scratch to teach students;
    3. integrate commercial off-the-shelf (COTS) games into the classroom

what lies beyond gun, car and run in games?

Game design is a field about which I have a lot to learn. But I do get the impression from some experts (Zimmerman, Koster) that currently there is a market driven commercial log-jam from which something more creative and interesting than gun, car and run will emerge. We don't know what.

Eric Zimmerman, interviewed by Gamasutra:
Gamasutra: Any gaming trends that are exciting or bothersome?

Zimmerman:
Well, I could talk about the increasing homogenization of the field of commercial games. That's sort of an old song, but I still think it's true. If you go to E3 where Sony and Nintendo have their booths and stand everywhere, you can see hundreds of screens at once, and they almost all look exactly the same in the sense that they're all 3D spaces with a horizontal plane in the middle and an object in the lower center of the screen. It might be the barrel of a gun, a vehicle, a person running. And it's amazing, considering how with today's technology we can really put almost anything on-screen, that there's such a structural homogeneity, both terms on aesthetics and in terms of content, but especially in the structure of the gameplay... it's shocking. But it's also hard to innovate. And as I said, that's both a business dilemma and a creative or design dilemma....

... there are great huge, unsolved problems in games. In other words, the subject matter that we see depicted in games is relatively narrow. Scott McCloud talks about what he thinks about what comics could depict or could do as a medium and what they have done, and he sees it like we've seen a little narrow slice and there's this whole huge world, and I think it's even more true about games.
Eric Zimmerman and Katie Salen are co-authors of Rules of Play. I haven't read this but I liked this review by K. Sampanthar "kes_sampanthar" at amazon, which outlines the following interesting parts of the book:
- Reiner Knizia - writing about how he designed the Lord of the Rings Board game
- Richard Garfield (Sibling Rivalry), Frank Lantz (Iron Clad), Kira Snyder (Sneak) and James Ernest (Caribbean Star) - design board games for the book and each of them describe how they went about designing. (Note: James Ernest's game Caribbean Star is available as part of a game collection he released from his company Cheapass games - check out "Chief Herman's Next Big Thing" )
- There are game design exercises that students or teachers can use to learn more about each of the concepts. These exercises are split into 3 categories: game creation, game modification and game analysis.
- Complexity, Emergence, self organization as they refer to games
- Probability and Randomness (luck) in games
- Information Theory - uncertainty, noise and redundancy
- Systems of Information - public and private information
- Cybernetics - Feedback loops and game balancing
- Game Theory - Cake division and the prisoner's dilemma
- Conflict and Cooperation
- Interactivity
- Flow - Entrainment, reward schedules, behavior theory and addiction
- Edward De Bono's L Game
- Narrative play - story arcs etc..
- Simulations - games as simulations
- Metagames - the larger social context of games
- Open Source Games - like Icehouse
- Game modifications - Alterations, Juxtapositions, Reinventions
- Blurring the boundary between "real" and "play"