Jump to main content

Design Your Own Smart LED Lighting System

1
2
3
4
5
33 reviews

Abstract

Have you ever had lights turn on automatically when you walked into a room? Have you turned on a light with your voice instead of a switch? Maybe you have even seen lights that change color depending on temperature, ambient sounds, or how close you are to something. In this project you will design and build your own smart LED lighting system that can change colors and react to various things in the room. The possibilities are endless! Check out this page for more LED science projects.

Summary

Areas of Science
Difficulty
Method
Time Required
Short (2-5 days)
Prerequisites

Previous experience with Arduino is recommended before you start this project. See our How to Use an Arduino page to learn more.

Material Availability

Arduino and circuit parts required. A starter kit is available from our partner Home Science Tools® but additional parts must be purchased separately. See materials list for details.

Cost
Average ($50 - $100)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Design your own smart LED lighting system that changes colors in response to one or more sensors.

Introduction

Traditional lights are controlled by an on/off switch—boring! "Smart" lights, along with other smart home devices, can be controlled by an app on your phone or even by your voice. Some lights can automatically turn on when someone enters a room and automatically turn off when the room is empty to help save power. Some lights, like the LED (light-emitting diode) light strip in Figure 1, can even change color!

An RGB LED strip that can light up in different colors, shown here in cyan and magenta.  Image Credit: Ben Finio, Science Buddies / Science Buddies
Figure 1. A color-changing LED light strip.

The light strip in Figure 1 can change color using additive color mixing. Each light on the strip is actually made up of three individual LEDs—one red (R), one green (G), and one blue (B)—so it is commonly called an RGB LED strip. By individually controlling the brightness of the red, green, and blue LEDs, you can mix and match them to create millions of different colors.

Additive color mixing with light is different from subtractive color mixing with pigment (paint). You have probably noticed that if you mix all your paint colors together, you get dark brown and eventually black. If you mix all the colors of light together, however, you get white!

Figure 2 shows how additive color mixing works:

How do these smart lights know when to turn on, turn off, or change colors without using a switch? They are reacting to information from one or more sensors. Sensors are electronic devices that gather information or take measurements of some physical quantity in the environment surrounding them. There are many different types of electronic sensors that can measure many different things. Figure 3 shows just a few examples.

From left to right:

Five different electronic sensors.  Image Credit: Ben Finio, Science Buddies / Science Buddies
Figure 3. A variety of electronic sensors: a passive infrared (PIR) sensor, an ultrasonic sensor, a potentiometer, a microphone, and a photoresistor.

In this project, you will choose one or more electronic sensors and program an RGB LED strip to react to them using an Arduino®. This is an engineering design project, so there is no single "right" way to do this—the design is up to you!

Note: Analog vs. Digital LED Strips

The circuit and example code in this project are for analog LED strips. You cannot control the LEDs on an analog strip individually—the entire strip will always appear the same color. If you want to control the LEDs individually (for example, to make an animated "chase" pattern where it looks like the lights are moving), you will need to purchase a digital LED strip. You can still apply the concepts here when making the digital LED strip react to sensors, but you will need to write your own code for the project.

Terms and Concepts

Questions

Bibliography

Materials and Equipment Buy Kit

Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

View Kit

This is an engineering design project, so the exact parts you need to buy for your project may vary. The following list will help get you started.

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools®, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at [email protected].

Experimental Procedure

This project follows the Engineering Design Process. Confirm with your teacher if this is acceptable for your project, and review the steps before you begin.
Before you begin: Review How to Use an Arduino Tutorials 1-3.

Designing Your Smart LED System

It might be tempting to dive right in and start building something, but part of the engineering design process is coming up with a design before you start building.

In this case, you need to figure out what the objective of your smart LED lighting system is. Do you want to build motion-activated lights that turn on automatically when someone enters a room? Do you want to make an auto-dimming "sunset" night light that gradually changes color and dims when it is time for bed? A warning light that changes from green to red when people get too close to your room? A dance party light system that reacts to music? There are endless possibilities, and it is up to you what you build.

For all of these cases, you need to think about what sensor(s) you need, where you will physically mount the LED strips, and how the LED strips will react to the sensors. Follow our guide for the engineering design process and move to the next section when you are ready for the prototyping step.

Using Your LED Strip

When building a complex system, it is often easier to build and test it one part at a time instead of building it all at once. That way you can make sure that the individual parts of your system are working before you test the whole thing. This approach also makes it easier to isolate and troubleshoot issues when something does not work. For this project, that means connecting and testing your LED strip before you connect any sensors.

  1. If needed, cut your LED strip to the length you want. Many LED strips have lines to help you cut them to length, usually spaced after every three LEDs. Make sure you read the instructions for your LED strip before cutting it.
  2. If needed, solder wires to the tabs on your LED strip, then wrap them in heat shrink tubing (Figure 4). Make sure you color-code the wires so you know which one is which. If your LED strip came with wires attached, you can skip this step.
    Figure 4. Wires soldered to an LED strip.
  3. Orient your Arduino and breadboard so they match the orientation in Figure 5.
  4. Place the three MOSFETs in the breadboard with the writing on the black side facing to your right and the large metal tabs facing to your left. Each MOSFET has three pins, and each pin should go in its own row.
  5. You will connect the three MOSFETs such that each one controls one color (red, green, or blue) on your strip. Decide which MOSFET will control which color. For each MOSFET:
    1. Connect the pin closest to the top of the breadboard (the MOSFET's "source") to the ground bus.
    2. Connect the pin closest to the bottom of the breadboard (the MOSFET's "gate") to an Arduino PWM pin (a pin with a "~" next to it). Our example code uses pins 3, 5, and 6 for red, green, and blue respectively.
    3. Connect the center pin (the MOSFET's "drain") to the corresponding wire from the LED strip.
  6. Put the switch in the breadboard so that each of the three pins is in its own row.
    1. Connect the center pin to the power bus on the right side of the breadboard.
    2. Connect the top pin to the positive wire from your 12 V power supply. (Use an adapter if needed, but do not plug your power supply into the wall yet.)
  7. Connect power to your circuit.
    1. Make sure the entire circuit has a common ground. The Arduino's GND pin, the negative wire from your 12 V power supply, and both breadboard ground buses should all be connected.
    2. Connect the 5 V pin from your Arduino to one of the breadboard's power buses (in Figure 5, this is the bus on the left). Make sure you do not connect the breadboard's two power buses to each other. This will short-circuit 12 V to 5 V and could damage your circuit.
    3. Connect the +12 V wire from your LED strip to the 12 V power bus on your breadboard (the right side in Figure 5).
    4. Plug your power supply into the wall but keep the power switch in the "off" (down) position for now.
    5. Plug your Arduino into your computer with a USB cable.
    6. If you see or smell smoke or if anything feels hot, immediately unplug both your power supply and the USB cable. You have a short circuit somewhere. Double check your entire circuit, paying particular attention to whether you have accidentally shorted 12 V to 5 V.
    A diagram represents the connections among the Arduino, the breadboard, a 12 Volt power source, and an LED strip. Revisit steps 4-7 if needed for instructions on setting up the connections. Image Credit: Ben Finio, Science Buddies / Science Buddies
    Figure 5. A breadboard diagram for connecting an analog RGB LED strip to an Arduino.
  8. Download the led_strip_fade.ino example code and upload it to your Arduino. This code uses the Arduino's analogWrite command to set the brightness of each LED color between a value of 0 (off) and 255 (maximum brightness).
  9. Turn the power switch on the breadboard to the "on" (up) position. You should see your LED strip automatically fade through different colors! If your strip does not power on at all or does not change colors, double check all the connections on your breadboard, especially to the MOSFETs.
  10. Open the serial monitor in the Arduino IDE (Tools → Serial monitor) and watch the red, green, and blue values as they change. How do they correspond to the color of the LED strip?
  11. Try changing the fadeDelay variable in the code and see what happens.
  12. At least one of the color values (red, green, or blue) is always zero in this example code. What happens if you activate all three colors at once?
  13. Optional: How does the brightness of the LEDs correspond to the analogWrite value? If you set the brightness of a single color to 128 and leave it constant, does it appear half as bright as when it is set to 255?

Using a Sensor

After your LED strip is working, you should test your sensor separately. Remember that this makes it easier to find and identify any problems in your circuit.

  1. Save your LED code and open a new file.
  2. If you followed our circuit diagram in Figure 5, you should have plenty of space on the left side of your breadboard to connect one or more sensors. Connect your sensor to the Arduino and write a simple program to test its output—by controlling a single regular LED, for example, or by printing the sensor value to the serial monitor.
  3. Follow along with the appropriate tutorial(s) to test your sensors. Tutorial videos for the five sensors shown in Figure 2 (PIR, ultrasonic, potentiometer, microphone, and photoresistor) are listed below. If you purchased a sensor that is not listed here, you can check our How to Use an Arduino page to see if your sensor is listed, or you can look up another tutorial online.
  1. Think about how you will use your sensor in your project and where it needs to be positioned. For example, you might start testing an ultrasonic sensor just by waving your hand in front of it while it is sitting on a table. But if you want it to detect a person walking toward a room, it may need to be mounted on a wall. Depending on where you put your Arduino, you might need longer wires to connect the sensor to your breadboard. Make sure you test your sensor under these real-world conditions.

Making Your LED Strip React to a Sensor

So far you have one program that controls your LEDs and one program that takes a reading from your sensor. Now you need to combine them and make your LEDs react to your sensor. If you need help getting started, refer to these example programs for the five sensors we have discussed:

Note that the Arduino map function is very useful in some of these programs to convert the sensor's output from its original range (which can vary) to the range needed to control LED brightness (0 to 255).

You can change these programs as much as you want. If you are using multiple sensors, you may want to combine their programs. And if you are using a completely different sensor, you can write your own program! Remember that there is no right or wrong way to do this project—it all depends on the criteria you set for your design in the engineering design process.

After writing your program, make sure you test it. You may need to make changes to your code. For example, you might have to change a sensor threshold value or adjust the R, G, and B values to get the exact color(s) you want.

Once your design is finalized, you can impress your friends and family with your own smart RGB LED lighting system!

icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • Try this project with an individually addressable (digital) LED strip instead of an analog strip.
  • The microphone example code in this project is just responding to loud sounds (like claps) and not to voice commands. Can you add a voice control module to your project and use command words to control the LEDs instead? Check out our Arduino Voice-Controlled Lamp project to learn more.

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Career Profile
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Home Science Tools®

Contact Us

Our kits are developed in partnership with Home Science Tools®. If you have purchased a kit for this project, Home Science Tools® is pleased to answer any questions.

In your email, please follow these instructions:
  1. Include your Home Science Tools® order number.
  2. Please describe how you need help as thoroughly as possible:

    Examples

    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Support

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Design Your Own Smart LED Lighting System." Science Buddies, 5 Nov. 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/Elec_p102/electricity-electronics/smart-LED-lighting?from=Blog. Accessed 13 June 2026.

APA Style

Finio, B. (2025, November 5). Design Your Own Smart LED Lighting System. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/Elec_p102/electricity-electronics/smart-LED-lighting?from=Blog


Last edit date: 2025-11-05
Top
Free science fair projects.