Ingo Lohs
Published © LGPL

Homemade Tilt-Sensor with Electric Paint

How to make your own tilt-sensor? Here an example with Electric Paint.

BeginnerProtip30 minutes637
Homemade Tilt-Sensor with Electric Paint

Things used in this project

Hardware components

Electric Paint 10ml
Bare Conductive Electric Paint 10ml
×1
(transparent) Oil
×1
small plastic vial with capped closure
×1
thin stainless steel rods
(this could also be a simpler wire)
×1
ELEGOO UNO R3 Board ATmega328P ATMEGA16U2 with USB Cable
ELEGOO UNO R3 Board ATmega328P ATMEGA16U2 with USB Cable
×1
heat shrink tube
optional
×1
Jumper wires (generic)
Jumper wires (generic)
optional
×1
Breadboard (generic)
Breadboard (generic)
optional
×1
terminal strip
optional
×1
small syringe
optional
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Tilt-Sensor

C/C++
// Tilt Sensor an Pin 12
const int tiltPin = 12;
// LED an Pin 13
const int ledPin = 13;
 
void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(tiltPin, INPUT);
}
 
void loop() {
  // Wenn Pin 12 HIGH, dann wurde
  // der Kontakt am Sensor getrennt

  if (digitalRead(tiltPin) == HIGH) {
    // Blinksequenz
    for (int i=0; i<5; i++) { 
      digitalWrite(ledPin, HIGH);
      delay(60);
      digitalWrite(ledPin, LOW);
      delay(60);
    }
  }
}

Credits

Ingo Lohs

Ingo Lohs

182 projects • 194 followers
I am well over 50 years and come from the middle of Germany.

Comments