Arduino and Input/Output





Toggle Push Button Input

For this part, we were tasked to create a circuit which allows control for 2 LEDs using a push button. There were a series of sub-tasks to accomplish mainly:

Simple LED control

  1. initially, LEDs are all in the OFF state.
  2. pressing the switch, turns on only the RED LED.
  3. pressing the switch again, turns on only the GREEN LED
  4. pressing the switch again, turns on only the WHITE LED
  5. pressing the switch again, turns on all LEDs
  6. pressing the switch again, turns off all LEDs returning to the first state.

I created a circuit using Arduino first before implementing it into my physical circuit. I also generated a code that will aid in the different steps of pressing the push button. The parts needed were:

  1. Arduino
  2. Breadboard
  3. Wires
  4. LED x3 (Red, Green, White)
  5. 220 ohm resistor x3
  6. 10k resistor x1


I then proceed to create the physical circuit following the one i created in TinkerCAD. Here i made some minor changes to the layout, but not obstructing its main purpose. You may change around the circuit as you please, though be careful when you are unsure as it could short circuit.




Potentiometer Input

Next up is the circuit using a potentiometer to control the intensity of the light. I similarly did the circuit on TinkerCAD first and did the circuit physically on my breadboard.


Output (LDR)

An example of an output circuit is an LDR circuit. An LDR circuit depends on the light exposed to the Photo Resistor. The Photo Resistor would sense the availability of light exposed to it and if there is no light, the LED in the circuit would light up. When there is light, the LED in the circuit would not light up