MichDragstar
Published © GPL3+

ATtiny85 + Volt Regulator 7805 + Vibration Sensor with Relay

In this project we replace the Arduino UNO with the ATtiny85..

BeginnerFull instructions provided1 hour999
ATtiny85 + Volt Regulator 7805 + Vibration Sensor with Relay

Things used in this project

Hardware components

ATtiny85
Microchip ATtiny85
×1
Linear Regulator (7805)
Linear Regulator (7805)
For other items, see previous project please. You can find the link in "Story"
×1

Story

Read more

Schematics

//Vibration Sensor Module, Arduino code, ATTiny85 with relay and external 5V power source.

Code

Vibration Sensor Module, Arduino code, ATTiny85 with relay and external 5V power source.

C/C++
How it works, what it should do, please see previous project. You can find the link in "Story" In this project I show only how you can replace the Arduino by the ATTtiny85.
 //Vibration Sensor Module, Arduino code, ATTiny85 with relay and external 5V power source.
  
int vib_pin=2;
int led_pin=4;


// put your setup code here, to run once:
void setup() { 
  
  pinMode(led_pin,OUTPUT);
}


  // put your main code here, to run repeatedly:
void loop() {
  int val;
  val=digitalRead(vib_pin);
  if(val==1)
  {
    digitalWrite(led_pin,LOW);
    delay(2000);
    digitalWrite(led_pin,HIGH);
    delay(1000);
    digitalWrite(led_pin,LOW);
    delay(2000);
    digitalWrite(led_pin,HIGH);
    delay(1000);
    digitalWrite(led_pin,LOW);
    delay(2000);
    digitalWrite(led_pin,HIGH);
    delay(1000);
    
   }
   else
   digitalWrite(led_pin,HIGH);
}

Credits

MichDragstar
7 projects • 17 followers
Contact
Thanks to Arjun Ganesan.

Comments

Please log in or sign up to comment.