Why Using Resistors is Essential for Sensors and LED’s

Why Using Resistors is Essential for Sensors and LED's

This project tells about how to use a Tilt sensor to glow a LED this is very
useful to detect whether the sensor is tilted or not.
In this project Tilt sensor is used to detect whether the sensor is tilted or
not if the sensor is tilted the LED will glow.

Hardware required

  1. Arduino Uno R3
  2. LED
  3. Resistor
  4. Jumper Wires
  5. Tilt Sensor

    Schematic Diagram

Fig 1. Circuit Diagram

Arduino Code :

int tilt = 2; // the number of the input pin
int led = 13; // the number of the output pin

void setup()
pinMode(tilt, INPUT);
pinMode(led, OUTPUT);

void loop()
int reading;
reading = digitalRead(tilt);

digitalWrite(led, LOW);
digitalWrite(led, HIGH);


  1. Connections should be done properly.
  2. Arduino is case Sensitive so code accordingly.
  3. Give different and appropriate colors to the wires.
  4. Use resistors for sensors and LED’s.

Do you have questions regarding our STEM program?

Contact us anytime.

Take your first step into the magical world of coding for kids


More Posts

Send Us A Message

Coding For kids

Coding Courses for Kids Online

Our courses which are tailored for grades 1 to 12, and our hands-on curriculum seamlessly integrates, preparing students for challenges and inspiring the next generation.


STEM LAB for Schools

If you are a school searching for a cutting-edge makerspace solution that goes beyond conventional education, look no further. Partner with Makers’ Muse to unlock a world of innovation and transformative learning experiences for your students. 

Coding Toys

STEM LAB for Schools

Discover a revolutionary coding journey for students with our cutting-edge educational toys. Partner with us to unlock innovative learning experiences that transcend traditional education.

Leave a Reply