Giter Site home page Giter Site logo

starryalley / bikefanspeed Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 826 KB

Android app that monitors ANT+ bike speed sensor and controls a RC servo powered fan automatically

License: MIT License

Java 100.00%
android-app ant-plus raspberry-pi servo-control bike indoor-trainer

bikefanspeed's Introduction

Bike Fan Speed Control

This is an Android app which reads ANT+ bike speed sensor in the background, and sets fan speed automatically based on current wheel speed.

I use this when riding indoor on a bike trainer with my ANT+ enabled Samsung phone.

Setup

I used a RPi4 connecting to a RC servo, which then controls the rotary knob on a cheap fan in front of my bike. This Android app then reads current wheel speed through ANT+ from the sensor on my bike, and sets desired servo position to turn off, turn to low, and turn to high fan speed.

I wish I had a programmable fan which can better simulates the headwind when cycling indoor.

my setup

In addition to this app, I also run Zwift Android app on the same phone, reading the same bike speed sensor from my bike.

zwifting

Android app

I have to create a Foreground Service because Zwift app (not the Companion) obviously puts a lot of stress on my 3-year-old S8 and the runtime keeps on killing my Service.

screenshot 1 screenshot 2

RC Servo

I use an analog RC servo retired from my 1/8 electric buggy, so it is quite strong without taking too much current from the 5v pins on my RPi4.

I should've found a better way to turn the knob with the servo arm but this is what I've got so far over the weekend.

servo and the knob

See my go-servotester project for more detail about RC servo control.

Bike trainer and speed sensor

I have a 13+ years old Cycleops Fluid2 so I have to attach a speed sensor on it for Zwift. Sadly I don't have power meter either. The ANT+ speed sensor is an old Garmin one. Without a USB ANT+ stick, this leaves me with the only choice to use my ANT+ enabled Samasung phone to control the fan.

Raspberry Pi

For ease of use (and personal use only) I created a HTTP server so I can simply send a HTTP GET to the endpoint, specifying the correct pin (I use pin 11) to control the RC servo.

Example control command:

Set servo position to 85% (endpoint 1.0ms to 2.0ms PWM, the usual range of a RC servo) curl http://192.168.1.111:8080/servo?pin=11&pos=85

bikefanspeed's People

Contributors

starryalley avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lockevod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.