Tuesday 27 February 2018

how To download Arduino Uno Software under Windows

Installing the Arduino Uno Software under Windows


Steps to install Arduino Software (IDE) on Windows 10.fist Go to https://www.arduino.cc

Step1




Step 2





Step 3





Step 4





Step 5





Step 6



step 7






Step 8





Step 9




Step 10





Step 11





Step 12




Step 13




Monday 26 February 2018

Arduino Uno light dependent resistor ( LDR) Contolled LEDS

ARDUINO - LDR WITH LED





Hardware Required

  1. Arduino Uno
  2. LED
  3. LDR (photoresistor)
  4. 220 and 10k ohm resistors
  5. Wires
  6. Breadboard

The lights are Blink sketch allowed us to create a number of LED animations/transitions. But it is only a matter of time before you opt for something more interactive. In this tutorial, we will make use of a photo resistor or light dependent resistor ( LDR) to create an exciting LED display.





Photo resistors are variable resistors which change resistance depending on the amount of light hitting the sensor. When you move your hand closer to the sensor, you tend to block an increasing amount of light, which increases the resistance of the photo resistor. As you move your hand away, the amount of light hitting the surface of the photo resistor increases, thus decreasing the resistance.

The change in the resistance of the LDR, will affect the voltage being read at one of the Arduino's Analog Input pins (A0). As resistance increases, the voltage drops.

V = IR

V = Voltage, I = Current, R = Resistance
The voltage reading will be used to select which LED to turn on





We now have the power to control which LED we want to light up. This would look very nice with different coloured LEDs, but unfortunately I am stuck with the Yellow and Red ones from the Sparkfun Inventor's Kit.


source code :


//Define the analog pin the photo resistor is connected to (A0)
int photoRPin = 0;   

void setup() {
    //initialise the LED Pins as OUTPUTS
    for (int i=4; i<14; i++){
      pinMode (i, OUTPUT);
    }
}

void loop(){
    //Turn off all the LEDs before continuing
    for (int i=4; i<14; i++){
      digitalWrite(i, LOW);
    }
    
 /* Read the light level:
     Adjust the analog reading values ranging from 120 to 600
     to span a range of 4 to 13. The analog reading of 120
     is when there is maximum resistance, and the value of 600
     is when there is minimum resistance. These analog readings
     may vary from photo resistor to photo resistor, and therefor
     you may need to adjust these values to suit your particular
     LDR. */
    int photoRead = map(analogRead(photoRPin), 120, 600, 4, 13);
    
    /* Make sure the value of photoRead does not go beyond the values
      of 4 and 13 */
    int ledPin = constrain(photoRead, 4, 13);
    
    /* Turn the LED on for a fraction of a second */
    digitalWrite(ledPin, HIGH);
    delay(10);
    digitalWrite(ledPin, LOW);
}
    

Thursday 22 February 2018

Esay To Learn Basic OF MIT App Inventor Arduino

 Creating Andriod apps using MIT app inventor and connected the app with arduino to make things work, I often get email stating something went missing when they follow my tutorial, Here's a step by step tutorial on getting started with creating MIT app inventor and control things with arduino Technolgy




1. App Inventor: How to Make an Android App - The Basics

 In this tutorial, I show you the basic concepts of Google App Inventor. Keep watching this series to learn many advanced features of the software. Remember, the things I go over in this video are essential to learn before building up your knowledge.



2. Getting Started with Arduino and Android 

MIT app inventor and what are the requirements need to get started with this video series, anyone watching this video can make their own app and control a LED connected to arduino without any prior experience




 Blinking an LED is the first thing we do when we getting started with electronics in this tutorial you will TURN ON and TURN OFF the LED, this is the Hello world example in this tutorial, you don't need any prior coding experience to make this application work. To test the app that created during this tutorial, you need an Android mobile or android supported devices to test your app. creating an app with MIT app inventor is very simple

example code to Arduino 

-------------------------------------------------------------------------------------------------------------------------- 
#include <SoftwareSerial.h>
String state;// string to store incoming message from bluetooth
void setup() {
  Serial.begin(9600); // serial communication started
  pinMode(13, OUTPUT); // LED connected to 13th pin


}
//-----------------------------------------------------------------------//  
void loop() {
  while (Serial.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable 
  char c = Serial.read(); //Conduct a serial read
  state += c; //build the string- either "On" or "off"
  }  
  if (state.length() > 0) {
    
  if(state == "on") 
  {
    digitalWrite(13, HIGH);
    
      } 
  
  else if(state == "off") 
  {
    digitalWrite(13, LOW);
     }

state ="";} //Reset the variable
}

--------------------------------------------------------------------------------------------------------------------------


3.Multi Servo Motor Control with Arduino and Android app


Android app using MIT app inventor 2 , I created this app to control 6 servo motor using android and arduino, I have arduino uno, which has only 6 PWM pins that's the reason I created 6 servo control, If you want to control more than 6 you can use arduino Mega to do this


Need for Components
- Arduino Board
- HC-06 / 05 Bluetooth Module
- Servo Motor x4
- Wires and Breadboard
- Battery
- Android Device




You can find the Circuit Diagram for this project above. Connect your servo according to that, If possible power the Servos and arduino separately

Check the video below to know How to make mit app for controlling multiple stepper motor.



- MIT App Inventor site to create an application.
http://appinventor.mit.edu/explore/



4.Buetooth based stepper motor controller by Arduino :

The Stepper motor used here is a rusty old EPOCH (5 wires) stepper motor, which is a unipolar stepper.

'

Requiredments :

- Bluetooth Module ( for example : HC05 or HC06 )- Jumper Cables Checkout the video to know how the app control stepper motor



Source code for controlling stepper motor from android app:

-------------------------------------------------------------------------------------------------------------------------------

#include <AccelStepper.h>

AccelStepper stepper(AccelStepper::FULL2WIRE, 8, 9);

int spd = 1000;    // The current speed in steps/second
int sign = 1;      // Either 1, 0 or -1

void setup()

  Serial.begin(9600);
  stepper.setMaxSpeed(1000);
  stepper.setSpeed(1000);   
}

void loop()

  char c;
  if(Serial.available()) {
    c = Serial.read();
    if (c == 'f') {  // forward
      sign = 1;
    }
    if (c == 'r') {  // reverse
      sign = -1;
    }
    if (c == 's') {  // stop
      sign = 0;
    }
    if (c == '1') {  // super slow
      spd = 10;
    }
    if (c == '2') {  // slow
      spd = 100;
    }
    if (c == '3') {  // medium
      spd = 300;
    }
       if (c == '4') {  // Fast
      spd = 500;
    }
  
       if (c == '5') {  // medium
      spd = 700;
    }
  
       if (c == '6') {  // medium
      spd = 1000;
    }
    stepper.setSpeed(sign * spd);
  }
  stepper.runSpeed();
}

------------------------------------------------------------------------------------------------------------------------------ 



5.Android Arduino Speech Recognition :

Arduino with voice commands using an Android Mobiles Before we make a voice activated home automatic system




More details Watching this vedio :


Thing that you'll need:
- 5 LED Indicators (the color of your choice)
- Arduino UNO (a clone works fine)
- HC-05 Serial Bluetooth Module
- Solderless Breadboard
- Jumper Cables

Bluetooth voice control for arduino source code


//Voice Activated Arduino (Bluetooth + Android)
//Feel free to modify it but remember to give credit

String voice;
int
led1 = 2, //Connect LED 1 To Pin #2
led2 = 3, //Connect LED 2 To Pin #3
led3 = 4, //Connect LED 3 To Pin #4
led4 = 5, //Connect LED 4 To Pin #5
led5 = 6; //Connect LED 5 To Pin #6
//--------------------------Call A Function-------------------------------//
void allon(){
     digitalWrite(led1, HIGH);
     digitalWrite(led2, HIGH);
     digitalWrite(led3, HIGH);
     digitalWrite(led4, HIGH);
     digitalWrite(led5, HIGH);
}
void alloff(){
     digitalWrite(led1, LOW);
     digitalWrite(led2, LOW);
     digitalWrite(led3, LOW);
     digitalWrite(led4, LOW);
     digitalWrite(led5, LOW);
}
//-----------------------------------------------------------------------//
void setup() {
  Serial.begin(9600);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
}
//-----------------------------------------------------------------------//
void loop() {
  while (Serial.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable
  char c = Serial.read(); //Conduct a serial read
  if (c == '#') {break;} //Exit the loop when the # is detected after the word
  voice += c; //Shorthand for voice = voice + c
  }
  if (voice.length() > 0) {
    Serial.println(voice);
//-----------------------------------------------------------------------//
  //----------Control Multiple Pins/ LEDs----------//
       if(voice == "*all on") {allon();}  //Turn Off All Pins (Call Function)
  else if(voice == "*all off"){alloff();} //Turn On  All Pins (Call Function)

  //----------Turn On One-By-One----------//
  else if(voice == "*TV on") {digitalWrite(led1, HIGH);}
  else if(voice == "*fan on") {digitalWrite(led2, HIGH);}
  else if(voice == "*computer on") {digitalWrite(led3, HIGH);}
  else if(voice == "*bedroom lights on") {digitalWrite(led4, HIGH);}
  else if(voice == "*bathroom lights on") {digitalWrite(led5, HIGH);}
  //----------Turn Off One-By-One----------//
  else if(voice == "*TV off") {digitalWrite(led1, LOW);}
  else if(voice == "*fan off") {digitalWrite(led2, LOW);}
  else if(voice == "*computer off") {digitalWrite(led3, LOW);}
  else if(voice == "*bedroom lights off") {digitalWrite(led4, LOW);}
  else if(voice == "*bathroom lights off") {digitalWrite(led5, LOW);}
//-----------------------------------------------------------------------//
voice="";}} //Reset the variable after initiating


6.How to make an Android phone controlled Arduino Robot


How to make an app for controlling an robot by android app, you will be using android phone as remote controller to control the robot. You need 2 gear motor with wheels A motor driver, you can use any of the motor driver you want, I used L293D motor driver for this project. You also need a battery and connecting wires, apart from that as usual a Bluetooth and Arduino board is needed to complete this tutorial




Complete  Saw this Toturial vedio :





Android RC control Robot using Arduino :





Sample Source Code Of Arduino Robot Car :

-------------------------------------------------------------------------------------------------------------------------- 
#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); //TX, RX respetively
String readdata;

void setup() {
 BT.begin(9600);
 Serial.begin(9600);
  pinMode(3, OUTPUT); // connect to input 1 of l293d
  pinMode(4, OUTPUT); // connect to input 4 of l293d
  pinMode(5, OUTPUT); // connect to input 3 of l293d
  pinMode(6, OUTPUT); // connect to input 2 of l293d

}
//-----------------------------------------------------------------------// 
void loop() {
  while (BT.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable
  char c = BT.read(); //Conduct a serial read
  readdata += c; //build the string- "forward", "reverse", "left" and "right"
  } 
  if (readdata.length() > 0) {
    Serial.println(readdata); // print data to serial monitor
// if data received as forward move robot forward
  if(readdata == "forward") 
  {
    digitalWrite(3, HIGH);
    digitalWrite (4, HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    delay(100);
  }
  // if data received as reverse move robot reverse

  else if(readdata == "reverse")
  {
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    digitalWrite(6,HIGH);
    delay(100);
  }
// if data received as right turn robot to right direction.
  else if (readdata == "right")
  {
    digitalWrite (3,HIGH);
    digitalWrite (4,LOW);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
   
  }
// if data received as left turn robot to left direction
 else if ( readdata == "left")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, HIGH);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }
 // if data received as stop, halt the robot

 else if (readdata == "stop")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }

  


readdata="";}} //Reset the variable

--------------------------------------------------------------------------------------------------------------------------