Assignment 13 Interfacing a LDR with an RGB LED
In this assignment, you will attempt to interface an input analog device to your Arduino and produce equivalent output on a RGB LED.
I have provided approximate timings for you so that you do NOT spend all your time (doing something you like and neglecting other modules!)
Time |
Task |
15 min |
Understand and examine the LDR/RGB circuit on TinkerCAD |
30 min |
Wire up the LDR and RGB LED on a breadboard with an Uno board, verify the program |
60 min |
Convert the output using PWM to produce a more effective mood lamp |
You will be asked to examine a similar circuit on TinkerCAD using an LDR and RGB LED. You will then
wire up of the circuitry using the Arduino Uno board and breadboard with other components and verify the program. You may need to consult your lecturer during the breakout sessions regarding troubleshooting of the circuitry.
Finally, you will be asked to convert the output to PWM to produce a more effective mood lamp.
Complete the following:
- Using TinkerCAD:
- Examine the circuit below, which is in TinkerCAD. The URL for the circuit is http://bit.ly/3iyn5aO.
- Run the simulation and observe what happens when you click on the LDR to change the readings.
- The Serial monitor has been enabled for this circuit, observe the outputs obtained.
- Practical work with the Uno and breadboard:
- Wire up a similar circuit using a breadboard, Uno, LDR and RGB LED.
- Write the code to use the RGB LED using digital outputs.
- Verify that you can change the color of the LED using the LDR
- Modifications to make it a nice Mood lamp
- In the previous experiment, you can only get 8 colors by lighting up the LED using digital outputs from the UNO.
- Note that the RGB is driven by Pins 3, 5 and 6. These pins are capable of producing PWM outputs. Using this feature, modify your code to generate a more effective “mood” lamp that can produce a multitude of colors!
Interfacing assignments
- Wire up and interface the
- Ultrasonic sensor
- DHT-11 temperature and humidity sensor
- Draw the circuit diagram (you can use the on line app Circuit Diagram) to document your work.
- Write the program(s) to make the devices work.
- indicate whether you need to use libraries
- show your results using the Serial Monitor and/or Serial Plotter
- Take a hero shot (photo or video) of your interfacing achievements
- Write up your website page.
Useful sites for Arduino Interfacing
Here are some of the more “reputable/trust-worthy” sites for Arduino modules
Updated January 2021