Skip to main content

Ardiono Projects



follow the links below to get all the arduino projects you need with ready made codes :) :)

cdn.oreillystatic.com/oreilly/booksamplers/9781449360665_sampler.pdf

tutorial.cytron.com.my/wp-content/uploads/2011/08/User-Manual1.pdf

BasicTutorial


1. Pot Controlled LED's

 void setup() {

  Serial.begin(9600);
  pinMode(0,OUTPUT);
  pinMode(1,OUTPUT);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
 
 
}
void loop() {

  int sensorValue = analogRead(A0);

  Serial.println(sensorValue);
  delay(1); 
  if(sensorValue==1023)
  {
    digitalWrite(0,LOW);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
   
  }
  else if( sensorValue == 20)
 
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
    digitalWrite(6,LOW);
    digitalWrite(7,HIGH);
 
  }
  else if( sensorValue == 50)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,HIGH);
  }
 
  else if( sensorValue == 100)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
  }
  else if(sensorValue == 200)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
    digitalWrite(3,HIGH);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    digitalWrite(6,HIGH);
    digitalWrite(7,LOW);
  }
  else if(sensorValue == 300)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,LOW);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if (sensorValue == 500)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,LOW);
  digitalWrite(5,LOW);
  digitalWrite(6,LOW);
  digitalWrite(7,HIGH);
  }
  else if (sensorValue == 700)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if( sensorValue == 900)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,LOW);
  }
  else if ( sensorValue == 990 )
  {
    digitalWrite(0,LOW);
    digitalWrite(1,LOW);
    digitalWrite(2,LOW);
  digitalWrite(3,LOW);
  digitalWrite(4,LOW);
  digitalWrite(5,LOW);
  digitalWrite(6,LOW);
  digitalWrite(7,HIGH);
  }
else
{
  digitalWrite(0,HIGH);
    digitalWrite(1,HIGH);
    digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  digitalWrite(4,HIGH);
  digitalWrite(5,HIGH);
  digitalWrite(6,HIGH);
  digitalWrite(7,LOW);
}
}

2. Dancing Led's

void setup()
{
  pinMode(0,OUTPUT);
  pinMode(1,OUTPUT);
  pinMode(3,INPUT);
  pinMode(5,INPUT);
}

void loop()
{
  int sw= digitalRead(3);
  int sw1= digitalRead(5);
 
  if (sw == LOW)
  {
    digitalWrite(0,HIGH);
    digitalWrite(1,LOW);
  }
  else if (sw1 == LOW)
  {
      digitalWrite(0,LOW);
      digitalWrite(1,HIGH);
  }
  else
  {
    delay(10000);
    digitalWrite(0,HIGH);
    delay(10000);
    digitalWrite(0,LOW);
    delay(10000);
    digitalWrite(1,HIGH);
    delay(10000);
    digitalWrite(1,LOW);
  }
}


3. Digital Voltmeter Arduino way

int sensorValue = 0;


void setup()
{
   pinMode( 0 ,HIGH );
   pinMode( 1 ,HIGH );
   pinMode( 2 ,HIGH );
   pinMode( 3 ,HIGH );
   pinMode( 4 ,HIGH );
   pinMode( 5 ,HIGH );
   pinMode( 6 ,HIGH );
   pinMode( 7 ,HIGH );
   pinMode( 8,LOW );
}

void loop()

   
  int sensorValue=analogRead(A0);
  Serial.println(sensorValue);
 
  if (sensorValue==20)
  {
      delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
  else if (sensorValue==50)
  { delay(1000);
      PORTD=0b11000000;
  }
}
   
 
4. Arduino Based Shadow Alarm

// SHADOW ALARM USING ARDUINO //


int rlyPin = 12; // Relay Output Pin
int sensPin = 2; // Sensor Input Pin
int ledPin = 8; // Reminder LED Output Pin
int pzSpeaker = 10; //Piezo-speaker Output Pin
int val = 0; // variable for reading the Input Pin status

void setup() {
  pinMode(rlyPin, OUTPUT); // Set Relay as output
  pinMode(sensPin, INPUT); // Set Shadow Sensor as input
  pinMode(ledPin, OUTPUT); // Set LED as output
  pinMode(pzSpeaker, OUTPUT); // Set Piezo-Speaker as output

}

void loop(){
  val = digitalRead(sensPin); // read input value
  if (val == HIGH) { // check if the input is HIGH
    digitalWrite(rlyPin, HIGH); // turn Relay ON

    digitalWrite(ledPin,HIGH); // turn LED ON

    playTone(500, 600);
    delay(100);
    playTone(500, 800);
    delay(100);

  }
  else {
    digitalWrite(rlyPin, LOW); // turn Relay OFF
    playTone(0, 0);
    delay(300);

  }
}
// duration in mSecs, frequency in hertz
void playTone(long duration, int freq) {
  duration *= 1000;
  int period = (1.0 / freq) * 1000000;
  long elapsed_time = 0;
  while (elapsed_time < duration) {
    digitalWrite(pzSpeaker,HIGH);
    delayMicroseconds(period / 2);
    digitalWrite(pzSpeaker, LOW);
    delayMicroseconds(period / 2);
    elapsed_time += (period);
  }
}



5. Pulse Counter using Arduino


void setup()
{
  pinMode(0,HIGH);
  pinMode(1,HIGH);
  pinMode(2,HIGH);
  pinMode(3,HIGH);
  pinMode(4,HIGH);
  pinMode(5,HIGH);
  pinMode(6,HIGH);
  pinMode(7,HIGH);
  pinMode(8,LOW);
}
void loop()
{
  delay(1000);
  PORTD=0b11000000;
  delay(1000);
  PORTD=0b11111001;
  delay(1000);
  PORTD=0b10100100;
  delay(1000);
  PORTD=0b10110000;
  delay(1000);
  PORTD=0b10011001;
  delay(1000);
  PORTD=0b10010010;
  delay(1000);
  PORTD=0b10000010;
  delay(1000);
  PORTD=0b11111000;
  delay(1000);
  PORTD=0b10000000;
  delay(1000);
  PORTD=0b10011000;
}
 




Comments

Popular posts from this blog

VLSI viva compilation

All the below stuff is a compiled post from google of all the viva questions asked on vlsi and avlsi , do take a look  I've actually made this for me :P ( Last minute Reading Stuff :) ;) ) 1. Why does the present VLSI circuits use MOSFETs instead of BJTs? Compared to BJTs, MOSFETs can be made very small as they occupy very small silicon area on IC chip and are relatively simple in terms of manufacturing. Moreover digital and memory ICs can be implemented with circuits that use only MOSFETs i.e. no resistors, diodes, etc. 2. What are the various regions of operation of MOSFET? How are those regions used? MOSFET has three regions of operation: the cut-off region, the triode region, and the saturation region. The cut-off region and the triode region are used to operate as switch. The saturation region is used to operate as amplifier. 3. What is threshold voltage? The value of voltage between Gate and Source i.e. V GS at which a sufficient number of mobile e...

Pylove

For the PyLovers , here we bring more coding examples. Written and tested by us, today we have 5 of the codes from basic to moderate that would help you get more attract towards #Python. Here are some codes that we have been practicing. Hope you try them too!!! Don't just copy+paste, edit too and see what changes can be done :) 1. Stringers: In this code, we have created a function that will take any string as a input and perform various string operations using the inbuilt string function as follows: 1. length of string using len 2. First occurrence of a char in string using  .index 3. Counting the number of times the char as appeared using .count 4. Convert string to upper and lower case using .upper and .lower respectively 5. Checking if the string starts and ends with a particular letter using .startswith and .endswith  6. Splitting the string using .split and storing it in a list. THE CODE: def stringers():     s=input('Enter ...

Microsoft BizTalk Server | Interview Questions | Set 1

Hi Folks, Below is list of Some important questions that you may want to go through for a Biztalk developer role opening. Sharing the set 1 now just with questions. Will be sharing more soon. What is BizTalk Server? List down components of Biztalk server Biztalk architecture how is it? Types of schemas Document schema vs Envelope schema How to create envelope schema and its properties What is Property schema , how to create and its basic properties Purpose of using Flat file schema How to create a Flat file schema What do you mean by Canonical Schema What's is a message type Can a schema be without namespace What is min max and group min max property in a schema Explain Block default property Property promotion and types Distinguished field vs Promoted field Is it possible to promote XML record of complex content What is <Any> element in a schema Max length Promoted field and distinguished field What's Auto mapping and Default mapping  Can w...