What It Does
Into the solidity of stone, a solidity yet capable of suffused light, the fantasies of bodily vigor, of energy in every form, can be projected, set out and made permanent.
—Adrian Stokes, Stones of Rimini
The stone symbolizes physicality, concretization, manifestation, and sometimes completion or perfection: “virtus eius integra est si versa fuerit in terram.” The living stone is a perfect example of animism; not merely juxtaposing inert matter with vibrant and intelligent activity, but transcending their contrast. The golem is dead matter brought to life by breath and word—like the electricity and code that animates robots. The Philosopher’s Stone is the perfection of the alchemical Magnum Opus, being the utmost condensation of the supreme agent of transmutation (viz., AZOTH). &c.
GlowStone is a special kind of lamp that anchors a technomancer’s power and helps her to recall it whenever needed. It involves a selenite crystal tower illumed by an RGB LED controlled by Arduino, and audio instructions that lead the technomancer through a Meta-Magick exercise coordinated with the stone’s illumination.1
How It Works
GlowStone was written for the s2aio extension that adds blocks for interacting with Arduino. The extension should work on Windows, Mac, and Linux including Raspberry Pi’s Raspbian. If you download and open the GlowStone project file in the editor without s2aio running on your computer, the project will not run correctly.
A Little LED Theory
The most basic law of electronics, Ohm’s law, mathematically expresses the relationships between electric current, voltage, and resistance. Imagine that electricity moving through a circuit is like water flowing through a pipe. Current (I) is the flow of electricity through the circuit; it can be a little (trickle) or a lot (gush), and it can go slowly or rapidly. Voltage (V) is the force pushing the current along. Resistance (R) is anything that resists the flow, including the “pipe” (circuit wire) itself. Ohms’s law says that current equals voltage divided by resistance (I = V / R); voltage equals current times resistance (V = IR); and resistance equals voltage divided by current (R = V / I). In other words, current is proportional to voltage and inversely proportional to resistance. You can increase current by increasing voltage or decreasing resistance, and you can decrease current by decreasing voltage or increasing resistance. Sorted? Good! If not, fret not, for SparkFun has a proper tutorial on this subject.
A diode is an electronic component that passes current in only direction. A light-emitting diode (LED) generates light in response to the current it passes. Regular LEDs have two leads (the wires protruding from the housing): an anode that connects to a positive voltage source and moves electricity into the LED, and a cathode that connects to ground and moves electricity out of the LED. The housing typically has a flat edge on the cathode side, and the anode lead is typically longer or bent, to help you identify which side is which.
A resistor (so called because it resists the current flow) is usually needed in serial with the LED to limit the amount of current the LED passes. Unlike LEDs which are polarized and need to be oriented a certain way within a circuit, resistors work the same whichever direction they are connected in.
Now, can mix red, green, and blue light to produce a large range of visible colors. An RGB LED is a red, a blue, and a green LED in a single housing with four leads: one for each color and a common cathode or common anode (the longest lead identifies which is common).
GlowStone uses a common cathode LED that is connected to a ground header on the Arduino board while the red, green, and blue leads are connected to PWM headers via resistors.
Pulse width modulation allows us to vary the amount of voltage supplied to each of the three colored LEDs, letting us control the brightness of each color. The range of 0 to 5 volts supplied to each colored LED is represented by a PWM range of 0 to 255, so we can use the well-known web color space to find and specify which color we want the LED to glow. E.g, the RGB decimal triplet for the color deep pink is (255, 20, 147), so by setting the Arduino pins for the red, green, and blue LEDs to to values 255, 20, and 147, respectively, the LED will glow a deep pink color (more or less; variations in LED brightness and resistor values can cause an LED connected to Arduino to glow not quite the same color you see on your computer screen).
Dais Construction & Wiring
I made a small dais to conceal the Arduino and LED beneath the crystal tower, prepared much like the accumulator I made for SIBOR. Here is a parts list:
- Arduino Uno R3 w/ USB cable
- 5mm diffused common cathode RGB LED
- three 270Ω resistors (band colors: red, violet, brown; higher values may be used but will dim the light)2
- one 4″ × 4″ × 1-1/2″ wood panel
- four decorative feet w/ screws
I cut some cardboard strips and hot-glued them together to make a shim, and hot-glued the Arduino to that (I like hot glue for this kind of thing because it easy to remove with some rubbing alcohol or solvent such as Bestine).
A glob of hot glue secures the LED inside the 5mm hole drilled into the panel’s center.
Using round-nose pliers I made small loops in one end of each resistor, to place around the LED’s leads. I did the same with a bit of 22-gauge wire for the cathode-to-ground connection. A dab of Bare conductive paint on each connection secures the wires and helps make an electrical contact (typically I would use solder for this).
After you have followed the instructions on the s2aio website to install and configure the extension and your Arduino, and made something to hold the electronics beneath your crystal tower, connect Arduino to a USB port on your computer and then run s2aio in no-client mode (which prevents s2aio from opening a new instance of the Scratch editor) by inputting
s2aio -c no-client at a command prompt.
With s2aio running, open the GlowStone.sb2 file in the Scratch offline editor, and start the project by clicking the green flag. A voice will talk you through the exercise, which includes a test to verify the RGB LED is connected and working correctly.
You can specify your own color of magic (or whichever color you associate with technomancy in particular) for the stone to glow during the exercise. The variables
magicBlue record the decimal triplet for your desired color. E.g., if your color of magic is cyan, which has an RGB triplet of (0, 255, 255), you would set
magicRed = 0,
magicGreen = 255, and
magicBlue = 255, before running the project.
bluePin identify which Arduino pins are connected to the red, green, and blue leads of the RGB LED. If you need to change a pin, e.g., swap pin 6 for 9 to use are you blue pin, you can just set
bluePin to 6 at the beginning of the initial script, instead of having to change it everywhere that pin is written to throughout the project.
To fade the LED color in and out requires successively increasing or decreasing the PWM values written to the R, G, and B pins. Recall the PWM value has a range of 0 to 255, with 0 being the dimmest (essentially off), and 255 being the brightest. The only color that has all three pins set to 255 is white; all other colors require one or more of the LEDs to be dimmer than 255. For the color deep pink, which has an RGB triplet of (255, 20, 147), the range for the red pin to fade in is 0 to 255, but the range for the green pin is only 0 to 20, and for the blue pin it is 0 to 147. To proportionately adjust all three pins at the same time, we can map all of them to the maximum possible range, 0 to 255, so that it takes the same length of time for the red pin to go from 0 to 255 as it does for the green pin to go from 0 to 20, and the blue pin from 0 to 147.
To do the same thing for a common anode LED:
Make It Better
- Paint arcane glyphs onto the dais.
- Add a switch to turn the lamp on and off.
- Reprogram GlowStone to automatically turn on or change colors at particular times as reminders of tasks you need to perform.
- Reprogram GlowStone for divination by assigning meanings to colors or blinks. You could add multiple LEDs and stones to the project and make them glow different colors or in different patterns.
- Replace the spoken exercise with one of your own recording. If you have a microphone embedded in or attached to your computer, you can record your voice right in Scratch.
- Experiment with different interactions. E.g., project your anger into the stone as the color red, have the stone morph to a cool blue, and then absorb that blue color into your body—how does that make you feel?
- Replace the Arduino Uno with an Arduino Pro Mini, Arduino Nano, or other compatible board to decrease the hardware footprint.
- Go bigger! Replace the single RGB LED with three LEDs (one red, one green, and one blue) to illume a larger stone, or try this project with a light bulb or string of lamps using an Arduino-controlled dimmer made with a ZeroCross Tail.
- The GlowStone Meta-Magick exercise combines parts of “Exercise 2.3 Energy Flow Modeling” and “Exercise 3.1 Simple Evocations” from Philip H. Farber, Brain Magick: Exercises in Meta-Magick and Invocation (Llewellyn, 2011).
- A little more LED theory follows. The precise value of a resistor needed in series with an LED depends on the circuit’s current (measured in amperes), the voltage (in volts) supplied to the LED, and the LED’s “forward voltage” or “voltage drop,” which is usually specified by the LED’s manufacturer. The individual red, green, and blue LEDs within a single RGB LED may have different forward voltages and so optimally require different resistor values. However, using an approximate value is usually alright, at least in the short term. If you want to know more, SparkFun also has an LED tutorial.