Ticker

6/recent/ticker-posts

Arduino Basic Project 2

Arduino Basic Project 2

Welcome to the Technical Praveen, In this article, we will figure out how to make a few nuts and bolts venture with arduino at home. on the off chance that you wanna figure out how to make it painstakingly read the full article. this is the most fascinating and famous undertaking these days in hardware and designing, a large number of the understudies from school a lot making this wonderful task. step by step instructions to make circuit outline and how to compose the code. 


Beginning :


Before you can begin working with Arduino, you need to ensure you have the IDE programming introduced on your PC. This program permits you to compose, see and transfer the code to your Arduino Uno board. You can download the IDE for nothing through my site. 


When the IDE is introduced, you should associate your Arduino to your PC. To do this, plug one finish of the USB link to the Arduino Uno and afterward the opposite finish of the USB to your PC's USB port.

Select The Board

When the board is connected, you should open the IDE and snap on Tools > Board > Arduino Uno to choose the board.


Select Serial Port



NOW THE FOURTH PROJECT BEGINS

4) Potentiometer

Utilizing a potentiometer, you will have the option to control the resistance of an LED. Turning the knob will increment and decline the recurrence(frequency) the LED blinks.

Parts Needed

  • (1) Arduino Uno
  • (1) USB A-to-B Cable
  • (1) Breadboard – Half Size
  • (1) LED 5mm
  • (1) 220 Ω Resistor
  • (1) Potentiometer (10k Trimpot)
  • (6) Jumper Wires

Project Diagram



Project Code

int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  // turn the ledPin on
  digitalWrite(ledPin, HIGH);
  // stop the program for <sensorValue> milliseconds:
  delay(sensorValue);
  // turn the ledPin off:
  digitalWrite(ledPin, LOW);
  // stop the program for for <sensorValue> milliseconds:
  delay(sensorValue);
}


NOW THE FIFTH PROJECT BEGINS


5) Fade an LED

By utilizing a PWM pin to the Arduino, you will have the option to increment and lessening the power of brightness of a LED.

Parts Needed

  • (1) Arduino Uno
  • (1) USB A-to-B Cable
  • (1) Breadboard – Half Size
  • (1) LED 5mm
  • (1) 220 Ω Resistor
  • (2) Jumper Wires

Project Diagram


Project Code :


int led = 9;           // the PWM pin the LED is attached to

int brightness = 0;    // how bright the LED is

int fadeAmount = 5;    // how many points to fade the LED by


// the setup routine runs once when you press reset:

void setup() {

  // declare pin 9 to be an output:

  pinMode(led, OUTPUT);

}


// the loop routine runs over and over again forever:

void loop() {

  // set the brightness of pin 9:

  analogWrite(led, brightness);


  // change the brightness for next time through the loop:

  brightness = brightness + fadeAmount;


  // reverse the direction of the fading at the ends of the fade:

  if (brightness <= 0 || brightness >= 255) {

    fadeAmount = -fadeAmount;

  }

  // wait for 30 milliseconds to see the dimming effect

  delay(30);

}

NOW THE SIXTH PROJECT BEGINS

6) Scrolling LED

This venture will flicker 6 LEDs, each in turn, in a to and fro development. This kind of circuit was made popular by the show Knight Rider which included a vehicle with circling LEDs.

Parts Needed

  • (1) Arduino Uno
  • (1) USB A-to-B Cable
  • (1) Breadboard – Half Size
  • (6) LED 5mm
  • (6) 220 Ω Resistor
  • (7) Jumper Wires

Project Diagram


Project Code :


int timer = 100;           // The higher the number, the slower the timing.


void setup() {

  // use a for loop to initialize each pin as an output:

  for (int thisPin = 2; thisPin < 8; thisPin++) {

    pinMode(thisPin, OUTPUT);

  }

}


void loop() {

  // loop from the lowest pin to the highest:

  for (int thisPin = 2; thisPin < 8; thisPin++) {

    // turn the pin on:

    digitalWrite(thisPin, HIGH);

    delay(timer);

    // turn the pin off:

    digitalWrite(thisPin, LOW);

  }


  // loop from the highest pin to the lowest:

  for (int thisPin = 7; thisPin >= 2; thisPin--) {

    // turn the pin on:

    digitalWrite(thisPin, HIGH);

    delay(timer);

    // turn the pin off:

    digitalWrite(thisPin, LOW);

  }

}

Post a Comment

0 Comments