Njegomir Skola
Published © GPL3+

RGB LED Lamp

Interactive RGB lamp. Made with pupils. We use syringes to change color.

IntermediateShowcase (no instructions)5 hours3,113
RGB LED Lamp

Things used in this project

Hardware components

Arduino Mini 05
Arduino Mini 05
You can use any arduino
×1
RobotGeek Slider
RobotGeek Slider
Any slide potentiometer of 10k.
×3
Transistor BD139
or similar NPN transistor
×3
LilyPad Rainbow LED (strip of 7 colors)
SparkFun LilyPad Rainbow LED (strip of 7 colors)
LED strip RGB
×1
SparkFun Snappable Protoboard
SparkFun Snappable Protoboard
It's better if you use a printed board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

The syringe lamp.ino

Arduino
int led1 = 9;
int led2 =10;
int led3 =11;

int osvetljaj1 = 0;
int osvetljaj2 = 0;
int osvetljaj3 = 0;

void setup() 
    {
    Serial.begin(9600);
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    pinMode(led3, OUTPUT);
    }   
   

void loop() 
    {
    int senzorNivo1 = analogRead(A0);
    int senzorNivo2 = analogRead(A1);
    int senzorNivo3 = analogRead(A2);

    osvetljaj1 =  (senzorNivo1 + 100) /4;  //Zavisi od duzine sprica i duzine potenciometra
    osvetljaj2 =  (senzorNivo2 + 100) /4;
    osvetljaj3 =  (senzorNivo3 + 100) /4;
 
    analogWrite(led1, 255 - osvetljaj1);
    analogWrite(led2, 255 - osvetljaj2);
    analogWrite(led3, 255 - osvetljaj3);
 
    Serial.print(senzorNivo1);
    Serial.print("    ");
    Serial.print(senzorNivo2);
    Serial.print("     ");
    Serial.println(senzorNivo3);
    delay(100);
    }

Credits

Njegomir Skola

Njegomir Skola

1 project • 2 followers
Teacher in secondary school.

Comments