engineericly
Published

I made a Gravity Battery

Cheap Battery for your Solar Pnle Power Storage. It uses mechanical potential energy to generate eletricity

IntermediateFull instructions provided1,016
I made a Gravity Battery

Things used in this project

Hardware components

DC motor (generic)
×1
ender 5 s1
affiliate link, US store: Coupon Code:12ES5 $120 off - only $479 CA store: Coupon Code:15SE5 AU store: Coupon Code:AUS150
×1
8mm steel shaft
×1
heavy stones
×1
rope
×1
wood
×1
3d printing filament
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Code

Arduino code for IR sensor

C/C++
this is arduino code to detect if the rope is going to end or not
int motorPin = 9;
int IRPin = 10;
unsigned int detect_cycles = 0;
int cycle_limit = 512;
void setup() {
  pinMode(IRPin,INPUT);
  pinMode(motorPin,OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // Serial.println(digitalRead(IRPin));
if(digitalRead(IRPin)==0)
{
  if (detect_cycles < cycle_limit){
  detect_cycles = detect_cycles + 1;
  }
}
 else{
      detect_cycles = 0;
}
Serial.println(detect_cycles);
if (detect_cycles >= cycle_limit){
    digitalWrite(motorPin, HIGH);
}else{
  digitalWrite(motorPin, LOW);
}

}

Credits

engineericly

engineericly

1 project • 0 followers
Making videos engineericly....

Comments