Skip to main content

Arduino Music Stand

To put in practice what I've learned from the Arduino course with Zahraa Khalil from LinkedIn
Learning Arudino: Foundations
: Interfacing with Analog Devices
: Interfacing with hardware 

h Hardware

I decided to create a music stand that would open and close automatically holding my sheet of music. 

the whole concept is very simple:

a light sensor detects when the light is blocked while I pass my hands over the sensor, Arduino sends a command to a servo motor attached to a board which hods or release the paper.

VIDEO: 





the LEDs work as a 4 second countdown until the door closes and holds the paper 



Code:

#include <Servo.h>
Servo alavanca;
int LED1=9;
int LED2=8;
int LED3=7;
int LED4=6;
int LED0=5;
int servoPin=10;

void setup() {
   // put your setup code here, to run once:
Serial.begin(9600);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);

alavanca.attach(servoPin);
}
void loop() {
   // put your main code here, to run repeatedly:
int lightSensor = analogRead(A0);
Serial.println(lightSensor);
  if (lightSensor <= 180) {
    digitalWrite(LED0, HIGH);
    delay(500);
    alavanca.write(80);
    delay(100);
    digitalWrite(LED0, LOW);
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, HIGH);
    delay(1000);

    digitalWrite(LED0, LOW);
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, HIGH);
    delay(1000);

    digitalWrite(LED0, LOW);
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, LOW);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, HIGH);
    delay(1000);

    digitalWrite(LED0, LOW);
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, LOW);
    digitalWrite(LED3, LOW);
    digitalWrite(LED4, HIGH);
    delay(1000);

    digitalWrite(LED0, LOW);
    digitalWrite(LED1, LOW);
    digitalWrite(LED2, LOW);
    digitalWrite(LED3, LOW);
    digitalWrite(LED4, LOW);
    delay(30);
  }
else {
  
  delay(150);
  alavanca.write(0);
  digitalWrite(LED0, HIGH);
}
}


hardware used:
Arduino UNO board
Servo Motor
LED
jumping wires 

Comments

Popular posts from this blog

Photography : Experimenting with Light and Dark

The idea is to create different poses with only one exposure.  SONY SLT-A57 f/20 27 sec. ISO-400

Photography: Experiments with Street Lights

Experimenting with street lights, motion and log exposures to create a sense that lights are dancing and taking form... SONY SLT-A57 | f/22 | 6 sec. |   ISO-100  |  SONY SLT-A57 | f/25 | 1/25 sec. |   ISO-100  |  SONY SLT-A57 | f/25 | 3 sec. |   ISO-100  |  SONY SLT-A57 | f/22 | 4 sec. |   ISO-100  |  SONY SLT-A57 | f/22 | 8 sec. |   ISO-100  |  SONY SLT-A57 |  f/25 |  3 sec. |   ISO-100  |

“Blessed Be the Fruit”

" Blessed Be the Fruit "    Series: Flowers  SONY SLT-A57 |  f/2.8 |  1/200 sec. |  ISO-400 |     To me, these flowers look like the girls in The Handmaid's Tale walking one behind the other.