Crash Sensor Car


1,132

10

1

1. Connect cable of analog A0 with photosensor and resistency in one row.

2. Connect cable of v5 to the other leg of photosensor.

3. Connect the other leg of resistency to GND next to V5

4. Connect LED to 13 digital and other to GND

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Connections

Step 2: Arduino Code

//PHOTORESISTOR ARDUINO

//ANALOG PIN int _analogPin = 0; //LED PIN int _pinLED = 13; void setup() { //SERIAL PORT FOR DEBUGING Serial.begin(9600); //CONFIGURING OUTPUT OF PIN LED pinMode(_pinLED, OUTPUT); } void loop() { //READING ANALOG VALUE OF PIN int value = analogRead(_analogPin); //TURN OFF LED PING digitalWrite(_pinLED, LOW); //DEBUGING VALUE IN ARDUINO MONITOR SERIAL Serial.println(value); if(value <= 720) { digitalWrite(_pinLED,HIGH); delay(1000); } //TURNING ON if(value < 780 && value > 720) { digitalWrite(_pinLED,HIGH); delay(100); digitalWrite(_pinLED,LOW); delay(100); } //WAITING 10 MILISECONDS delay(10); }

Step 3: Video

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    Discussions

    Cool project. Just quick tip. You can use the "Embed Video" tool to embed videos from sites like YouTube. That way people can view the video on the page without having to download it.