You are on page 1of 3

INSTALLING NECESSARY DRIVERS AND APPLICATION:

- Download Arduino 1.8.10


- Download CH340 driver
- Download Fritzing 0.8.7b (https://www.electroschematics.com/fritzing-software-download/)

TESTING ARDUINO

- Open Arduino 1.8.10


- Plugin via USB the Arduino Board
- Go to File > Examples > Basic > Blink (A new window will appear)
- In the New Window, press the Upload button (Forward Icon) to compile the code
- "void setup" runs the program once whereas "void loop" runs the program infinitely times
- "pinMode" calls the pin that will be programmed. LED_BUILTIN is the led light denoted by L in the
arduino board.
- "digitalWrite" assign values to some output in digital format (either 0 or 1) whereas "analogWrite"
assign values to some output in analog format (from 0 to 255)

LIGHTING A LED BULB

- Materials Needed: LED Bulb, resistor (220 ohm), arduino board, breadboard, jumper wires (2x)

- LED Bulb = lighting (can receive 1.5V of current on average) [each color has different voltage]
{Red-Green-Blue [ascending] needed voltage}

= Pins vary in length. Long is positive whereas Short is negative.

- Resistor = constrict current flow (for better control)

= since the bulb can receive 1.5V and arduino gives 5V, resistor is needed so that the
bulb will not be busteda

= no polarity ergo no positive nor negative

Steps:

1. Attach Bulb in the breadboard, long pin should be attached in the positive whereas the short pin
should be attached on any column letter on the breadboard

2. Attach one end of the resistor on any points vertical to the negative pin of the bulb and the other end
should be attached on a new column letter

3. Attach a wire on the 5V pin on arduino board. This will be the positive charge. The other end should
be attached on the same row where the positive pin of the bulb is attached.

4. Attach a wire on the GND pin on arduino board. This will be the negative charge. The other end
should be attached on the same column where the other end of the resistor is attached.
LIGHTING AN RGB BULB

- Materials Needed: 1 Red bulb, 1 Green bulb, 1 blue bulb, {1 common cathode (-) RGB Bulb} Resistor
(x3), Wires (x9), arduino board, breadboard

Steps:

1. Attach a wire from arduino (5V) to breadboard (+)


2. Attach bulb in breadboard. Take note of the pins (See image above)
3. Attach resistors to breadboard that connects 1 column letter where RGB is attached to the other
column letter
4. Attach a wire from arduino (5) to breadboard (column aligned to the resistor that connects red)
5. Attach a wire from arduino (6) to breadboard (column aligned to the resistor that connects blue)
6. Attach a wire from arduino (7) to breadboard (column aligned to the resistor that connects
green)
7. Attach a wire from arduino (GND) to breadboard (column aligned to -)
8. Write code and upload

int red=5;
int blue=6;
int green=7;

void setup() {
// put your setup code here, to run once:
pinMode(red,OUTPUT);
pinMode(blue,OUTPUT);
pinMode(green,OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(red, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(red, LOW); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(blue, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(blue, LOW); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(green, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(green, LOW); // turn the LED on (HIGH is the voltage level)
}

DETECTING DISTANCE USING ULTRASONIC SENSOR

Materials: 1 hc-sr04 ultrasonic sensor,

You might also like