ProjectNo. 05 of 06Mechatronics / optical art
The Light Sculpture
Printed atD.P.E.A.Santa Barbara, Calif.
Vol. 5The engineering portfolio of Adam Gelman
Programmable optical sculpture integrating spatial design, CAD, machining, embedded electronics, and applied optics
- Type
- Mechatronics / optical art
- Core tools
- SolidWorks, mill, lathe, Arduino
- Systems
- Mechanical + electrical + software + optics
From the build32 photographs + drawings · choose one to enlarge
The codeFour light shows and a night light, chosen by one knob and run by software PWM on 14 LEDs.
- Board
- Arduino Uno with the DPEA LED shield
- LEDs
- 14 on pins 2–13, A0 (14) and A1 (15); 7 blue, 7 green
- Brightness
- Software PWM: 10 ms period, duty = brightness³
- Knob
- Potentiometer wiper on A5 (0–1023)
- On / off
- The knob's built-in switch on A4, INPUT_PULLUP
- Random seed
- randomSeed(analogRead(A5)): the knob position seeds the party show
| Select | Mode | What the code does | Run |
|---|---|---|---|
| Click off | OffturnOffAll() | The knob's switch is open: every LED off. | |
| Knob band 1 | Calm showrunCalmShow() | The lower four rods breathe in and out over 2 s each way, then the upper four. Then pairs sweep up and down the full order, groups fade in turn, and every rod cross-fades to its mirror. | |
| Knob band 2 | Party showrunPartyShow() | Everything fades up and strobes four times, twenty random rods flicker out one by one, then random flickers over a full field of light and a fast chase from pin 2 to pin 15. | |
| Knob band 3 | Final showrunFinalShow() | Three lit rods chase around the ring of eight, stepping faster from 600 ms to 25 ms. Then the two corner arcs sweep together, each round shorter than the last. | |
| Between bands | Dead bandrunDeadBand() | A gap between shows: all LEDs off, and any running show returns at its next check. | |
| Knob band 4 | Night lightrunNightLight() | All 14 rods glow steadily. Turning the knob further clockwise dims them, along a gamma-3 curve. |
/* Light Sculpture Template - Written by DPEA Staff and __________ <--(add your name) - Updated 4.1.24*/
#include "LightSculpture.h"
// Add your Global Variables and Arrays here:
const byte lower[4] = {9, 10, 2, 3}; const byte upper[4] = {14, 15, 7, 8};
const byte Order1[14] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
const byte Order2[14] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
// Main Functions (setup & loop) - DO NOT EDIT THESE!
void setup() {
setupLightSculpture();
}
void loop() {
updateMode();
if (mode == offMode) turnOffAll();
else if (mode == nightLightMode) runNightLight();
else if (mode == calmMode) runCalmShow();
else if (mode == partyMode) runPartyShow();
else if (mode == finalMode) runFinalShow();
else if (mode == deadBandMode) runDeadBand();
}
/* ---------------------------------- Show Functions ----------------------------------*/
void runCalmShow() {
fadeLowerAndUpper(2000);
upDown(200);
}