Magic Lamp © Apache-2.0

Lamp controlled by magic hands.

  • 3,555 views
  • 3 comments
  • 34 respects

Components and supplies

Apps and online services

About this project

It is a type of lamp which consist of magnetic reed switch, integrated with relay and Arduino board.

This small magnet which is hidden under my hand which will activate the relay and the lamp. This is the secret behind the lamp.

Unboxing the Magic Lamp

The circuit is shown below:

When the magnet is placed on the magnetic reed switch the relay will be activated and the lamp will be glowing (shown below):

(HIGH VOLTAGE :HANDLE WITH CARE)

Code

magic lampArduino
code
    

int sensorPin = A0; // select the input pin for the sensor 

int sensorValue = 0; // variable to store the value coming from the sensor

int relay = 8; // Output pin for relay


void setup() 
{
pinMode(relay, OUTPUT);
Serial.begin(9600);
}
 
void loop()

{

sensorValue = analogRead(sensorPin);

Serial.println(sensorValue);

if (sensorValue <100)//adjust the sensorvalue according to the serial monitor

{ 
digitalWrite(relay,HIGH);//relay on
delay(100);
}
else
{
  digitalWrite(relay,LOW);//relay off
  delay(sensorValue);
}
}

Schematics

circuit diagram
describing connection
Untitled 1 u1ne7cursh

Comments

Similar projects you might like

Magic Cauldron

Project showcase by Ian McKay

  • 5,801 views
  • 3 comments
  • 21 respects

Multi-Source Controlled USB Lamp

Project tutorial by Amal Mathew

  • 3,918 views
  • 2 comments
  • 20 respects

Arduino Smart Lamp

Project tutorial by Arduino “having11” Guy

  • 5,457 views
  • 0 comments
  • 11 respects

Motion Detection Lamp

Project tutorial by Izzati Azryna

  • 3,059 views
  • 0 comments
  • 8 respects
Add projectSign up / Login