Final / Lighthouse Design

Rui Wang
Rui Wang
Published in
7 min readMar 14, 2019

By: Mark Grover

I think at heart
I am a lighthouse keeper
I love the sea
or rather seeing the sea
But for me
I like to be
in the lighthouse keep

Face to the sea and light at my back
My shadow is thrown large over the open water
On the line between Gaia and Poseidon
The dance between earth and sea
It is where I belong
Where I feel at peace

Woodturning is fun, so I decide to stick on the wood lathe to make something interesting this time. I don’t want just to make a single fabrication piece, I want to add some tech element since I am in ITP instead of a pure art major, so the first thing comes into my mind is still make a light.

I start to think about different kind of lights which are a little be creative. One day I was watching a pirate movie, and I sew a lighthouse in the scene, it fitted my mind that I am going to make a wooden lighthouse, which could be both be lighted up and also interact with the user.

The first thing I need to do is to find the right material, I want to get one nice piece from the woodcraft, but I gave up because that single piece would cost me 40, that means a lot for me. So I piece up one piece of wood in the shop without a label and start my work.

I first do the rough turn to the log until I could get around a cylinder. Then I use the pencil to make the mark up to control the racial. I didn’t draw the sketch, the shape is just stored in my head, and I am pretty confident with it.

So I follow my heat and turn the shape that I want, I don’t want it to be too tall. Instead, the shorter guy looks cuter. Then I use two types of sandpapers to sand its surface until it becomes smooth. In terms of the circuit inside the lighthouse’s body, I need to make some room for the led on the top, and a bunch of wire goes through its body, so I turned a small ditch on the head which is for the light and a more substantial ditch on the bottom which is the place for Arduino. And there is a brunch of wire goes through the light’s body, so I mounted the drill bite on the other side of the lathe, and drill through the frame.

Next, I find a smaller piece of wood to make the head using the same tech, I also switch to the small chisel, but they did not work out fine. I turn it carefully and get the shape.

Then I painted these two part with the wood finished oil, it’s a great way to make the wood show its texture and turn the color a little bit darker.

After a night, the oil seems to dry up, and it looks good. I then bring them back to lathe to wax them, after 20 mins work, the pieces are looking shiny and clean.

However, the head part is damaged a little bit because I use the chuck to hold it on the lathe, I will not do this next time. Therefore, I use white paint to paint the ruined part. Next step, I need to make the window for the lighthouse, I bought a frosty allylic tube from canal plastic, cut a small piece and mount it on the top using hot glue. Then I put a NeoPixel ring inside it, the wire goes through the body, finally settled on the head of the lighthouse.

The final step is coding. I want to use the gesture to control the light when you shake the lighthouse, the color will be changed, when you flip the lighthouse from the head to foot, the mode will change.

See the code here:

#include <ColorConverter.h>
#include <Adafruit_Circuit_Playground.h>
#include <Interval.h>
#include <Adafruit_NeoPixel.h>
ColorConverter converter;//slide switch
bool slideSwitch;
//neo setting
const int neoPixelPin = 10;
const int pixelCount = 7;
int intensity = 50;
int change = 1;
int pixelIndex = 0;
int modeCount = 0;
int mode = 0;
int lightHue = 270;
//debounce button
bool leftButtonPressed;
long button_debounceTime = 1000; //millisecond
long button_lastDebounceTime = 0;
int buttonState = 0;
int lastButtonState = 0;
//debounce for color
long color_debounceTime = 1000;
long color_lastDebounceTime = 0;
int color_mode_count = 0;
int color_mode = 0;
//light mode change
bool light_modeChange = false;
long light_mode_debounceTime = 2000;
long light_mode_lastDebounceTime = 0;
int light__mode_change_count = 0;
int light_mode = 0;
//millis for mode change
long lastModeOneMillis = 0;
long lastModeZeroMillis = 0;
long lastModeFadeMillis = 0;
//accel
float prevX, prevY, prevZ;
// set up the neoPixel
Adafruit_CPlay_NeoPixel strip2 = Adafruit_CPlay_NeoPixel(pixelCount, neoPixelPin, NEO_GRBW + NEO_KHZ800);
void setup() {
CircuitPlayground.begin();
strip2.begin(); // initialize pixel strip
strip2.clear(); // turn all LEDs off
Serial.begin(9600);
}
void loop() {
slideSwitch = CircuitPlayground.slideSwitch();
if (slideSwitch) {
start();
} else {
for (int pixel = 0; pixel < pixelCount; pixel++) {
strip2.setPixelColor(pixel, 0, 0, 0); // set the color for this pixel
}
strip2.show();
}
}
void start() {
float x = CircuitPlayground.motionX();
float y = CircuitPlayground.motionY();
float z = CircuitPlayground.motionZ();
float accel_z = abs(z - prevZ) * 100;
float accel_x = abs(x - prevX) * 100;
float accel_y = abs(y - prevY) * 100;
prevX = x;
prevY = y;
prevZ = z;
// Serial.println(z);// set the color mode
if (accel_y > 250 || accel_x > 250) {
if (z < -9 && accel_z < 10) {
if (millis() - color_debounceTime > color_lastDebounceTime) {
color_mode_count++;
color_mode = color_mode_count % 5;
color_lastDebounceTime = millis();
}
}
}
switch (color_mode) {
case 0:
lightHue = 280; //purple
break;
case 1:
lightHue = 75; //green
break;
case 2:
lightHue = 30; //yellow
break;
case 3 :
lightHue = 175; // blue
break;
case 4 :
lightHue = 0; //red
break;
}
//setting the light mode
if (z > 9 && accel_z < 10) {
if (millis() - light_mode_lastDebounceTime > light_mode_debounceTime) {
light_modeChange = true;
light__mode_change_count++;
light_mode = light__mode_change_count % 2;
light_mode_lastDebounceTime = millis();
}
}
RGBColor color = converter.HSItoRGB(lightHue, 100, intensity);//color change based on color_mode
if (light_mode == 0) {
if (millis() > lastModeZeroMillis + 1000) {
intensity = 80;
for (int pixel = 0; pixel < pixelCount; pixel++) {
strip2.setPixelColor(pixel, 0, 0, 0);
}
strip2.setPixelColor(pixelIndex, color.red, color.green, color.blue); // set the color for this pixel
pixelIndex++;
if (pixelIndex > pixelCount - 1) {
pixelIndex = 1;
}
lastModeZeroMillis = millis();
}
} else {
if (millis() - 20 > lastModeFadeMillis) {
for (int pixel = 0; pixel < pixelCount; pixel++) {
strip2.setPixelColor(pixel, color.red, color.green, color.blue); // set the color for this pixel
}
if (intensity < 0 || intensity > 100) {
change = -change;
}
intensity += change;
lastModeFadeMillis = millis();
}
}
strip2.show(); // refresh the strip
}
void button() {
//button
leftButtonPressed = CircuitPlayground.leftButton();
if (leftButtonPressed != lastButtonState) {
button_lastDebounceTime = millis();
}
if (millis() - button_lastDebounceTime > button_debounceTime) {
if (leftButtonPressed != buttonState) {
buttonState = leftButtonPressed;
if (buttonState == HIGH) {
modeCount++;
}
}
}
lastButtonState = leftButtonPressed;
mode = modeCount % 2;
Serial.print("mode");
Serial.println(mode);
}

--

--