DIY Electric Road Bike Gear Shifter

When riding a road bike, it is especially important to minimize changes in the required effort and pedaling speed, for this, depending on the terrain, it is necessary to frequently switch the bike speeds. On budget road bikes, of course, there is a budget shifting system, with it you will once again think about changing the speed or not. Under the cut is how I fixed it.

Servo and device body.
Servo and device body.

Background

. , . 3 350 02.08.2020 .

. , , 2021 , . , .

, , . , , .

.

, . (22) , ds3115mg.

: +Arduino nano+ +.

5V .

Arduino

#include <Servo.h>
Servo myservo;
int speedg = 1;
int up = 1;
int p = 0;

void setup() {
  myservo.attach(9);
  pinMode(8, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
}

void loop() {

  if (digitalRead(7) == 0) {
    if (speedg > 1) {
      speedg--;
      up = 0;
    }
    p = 1;
  }

  if (digitalRead(8) == 0) {
    if (speedg < 7) {
      speedg++;
      up = 1;
    }
    p = 1;
  }

  if (speedg == 1) {
    myservo.write(0);
  }

  if (speedg == 2) {
    if (up == 1) {
      myservo.write(75);
    } else {
      myservo.write(60);
    }
  }

  if (speedg == 3) {
    if (up == 1) {
      myservo.write(85);
    } else {
      myservo.write(80);
    }
  }

  if (speedg == 4) {
    if (up == 1) {
      myservo.write(97);
    } else {
      myservo.write(90);
    }
  }

  if (speedg == 5) {
    if (up == 1) {
      myservo.write(110);
    } else {
      myservo.write(103);
    }
  }

  if (speedg == 6) {
    myservo.write(120);
  }

  if (speedg == 7) {
    myservo.write(140);
  }
  if ( p == 1) {
    delay(300);
    p = 0;
  }
}

. .

3D- Arduino, . , ( , ).

, .

, , .

3- MPU6050, . , .

, , .

  • .

  • .

  • BTLE STRAVA.

  • - .

  • .

,

?

Strava-connected bike computer + electronic gear shifting and everything in a flashlight housing with flashlight function + automatic switching from cadence or slope. And all this for less than $ 100




All Articles