Link Ads

More search type here...

April 22, 2014

PARKING ALARM CAR


/* THIS IS PARKING ALARM SYSTEM MODIFICATION FROM PING SENSOR from ARDUINO.CC    THIS PROGRAM USING PING SENSOR+LCD+TONE
   MODIFICATION BY: ARDUINOEASYPROJECT.BLOGSPOT.COM
    
   The circuit PING SENSOR:
    * +V connection of the PING attached to +5V
    * GND connection of the PING attached to ground
    * SIG connection of the PING attached to digital pin 7

   The circuit Piezo:
    * attached to pin 9
    * attached to ground
 */


const int pingPin = 7;
float sinVal;
int toneVal;
int PiezoPin = 9;  //Output to piezo pin 9

void setup()
{
  Serial.begin(9600);
  pinMode(PiezoPin, OUTPUT);  
}

void loop()
{
  long duration, inches, cm;
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);
 
  Serial.print(inches);                  // THIS SERIAL JUST FOR DEVELOPER TO TEST
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
 
  if (cm <= 25)   // YOU CAN CHANGE THE DISTANCE WARNING AT THIS
    {
    for (int x=0; x<270; x=x+10)
      {
      sinVal = (sin(x*(3.1412/180)));
      toneVal = 2000+(int(sinVal*1000));
      Serial.println(sinVal);
      tone(PiezoPin, toneVal);
      delay(5);
      }
    }
  else
  { noTone(PiezoPin); }
  delay(100);
}

long microsecondsToInches(long microseconds)
{
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
   return microseconds / 29 / 2;
}



This arduino parking alarm system will generate alarm sound when the car move to close the object around 25 cm. It is easy to change save distance, just set the cm variable in the program that you want. 

April 18, 2012

How to find hex file at Arduino IDE

Rapid product for microcontrolller project is using arduino, you just write with processing C,  then burning hex file it in new project for your custom schematic. But did you find where is hex file? in arduino IDE.
The answer is you got it at temp folder for your user. This example at winxp.

1. Open project, example this






















2. Then compile, and goto my document and setting\"your user"\local setting\temp\"find file at new day you compile"