Viewing 20 posts - 1 through 20 (of 20 total)
  • Arduino as a data logger for a turbo trainer?
  • tomhughes46
    Full Member

    Just bought myself a turbo, and thought it might be fun to try to use the Arduino that has been languishing on a shelf for most of the year to build a simple data logger – something to record speed, distance, cadence and display this on a laptop. I’ll use the magnet off an old computer, and should have all the bits.

    There are a few examples on the web where people have built bike computers, but was wondering if anyone of this parish had tried this, specifically with the outputting to a PC for a turbo setup?

    Cheers

    Tom

    RaveyDavey
    Free Member

    I’ve been thinking along these lines myself using a Pi but decided it’s a bit beyond my capabilities. I’d love to know if anyone has managed to get a set-up working though.

    andytherocketeer
    Full Member

    i guess a couple of magnets and couple of reed switches will do it. fun bit will be the code.

    there was certainly one where some kid made a complete bike computer in lunchbox with LCD screen and some buttons, all zip tied the handlebars.

    there’s the “Processing” coding tool thingy too (arduino “IDE” is based on it) for the PC end of the link to take all the incoming data and do something with it.

    jfletch
    Free Member

    Cadaence is the only slighlty meaningful measure out of what is possible with just a magnet. Speed and distance is just a measure of which gear and which resistance setting you pick so therefore isn’t realted to how much effort you put in.

    What you need is power. This needs a stain gauge somewhere.

    Although it may be possible to derive it from the bike’s current gear ratio and the resistance setting on the turbo combined with the wheel speed. To do this you would need to calibrate the system with a power meter in the first place but them it may work.

    jam-bo
    Full Member

    some manufacturers give a speed/power curve for their trainers. Kurt do.

    RaveyDavey
    Free Member

    Speed and distance is just a measure of which gear and which resistance setting you pick so therefore isn’t realted to how much effort you put in.

    Surely the OP just wants to log what he’s done through his session. Not many base line turbo trainers have a power output setting and I would imagine that the ones that do would have a data logger or direct output to a pc.

    jfletch
    Free Member

    Surely the OP just wants to log what he’s done through his session.

    But unless you know the power then the number of times you rotated the wheels doesn’t tell you anything about what you have done. (30,000 revs in 53/11 resiatnce 1 will be easier than 3,000 revs of 53/11 in resistance 10). It would be like telling people you rode 10 miles in 15 mins but neglegting to tell them it was all downhill.

    But if you could record wheel revolutions, resistance setting and gear inches then you could find out where you are on the power curve and calculate power. Then you would know how many watts you were putting out, how much energy you had used etc.

    Candence is kind of useful as you can get used to pedalling at an efficent rate.

    Heart rate is also useful as you can understand how hard you are training.

    RaveyDavey
    Free Member

    But unless you know the power then the number of times you rotated the wheels doesn’t tell you anything about what you have done. (30,000 revs in 53/11 resiatnce 1 will be easier than 3,000 revs of 53/11 in resistance 10). It would be like telling people you rode 10 miles in 15 mins but neglegting to tell them it was all downhill.

    Same for most turbo sessions, that’s all I’m saying. I totally agree with your logic but the OP wouldn’t get that info anyway.

    mrblobby
    Free Member

    Interesting project. Little stepper motor to control trainer resistance too maybe?

    tomhughes46
    Full Member

    Yeah – as above it’s not going to be used as a serious training tool, but I think linking cadence and speed should be able to give some comparative data haven’t really thought this through but it seemed like it might be interesting, if not useful.

    Will see how it goes!

    maxtorque
    Full Member

    Dead easy little project:

    Magnetic read switch, pulled up with say a 10K resistor to 5v, read switch pulls line down to ground. Connect to Input Capture pin on micro, set up a suitable TimerCounter (trade off between resolution and min Time interval (speed) you can sense ). Couple of lines of code to turn that time interval into a rpm value and /or a road speed. Every so often, integrate the speed to get distance. Spit that out over the USART, via a USART/USB convertor to a virtual serial port on your pc. Write a simple little VB program (or similar) to grab those data packets and collate/graph/file them etc

    tomhughes46
    Full Member

    That’s basically where I have got to, however I’m using Python for the last bit and have got bored of trying to work out why it’s not working!

    Maybe tomorrow evening…

    Olly
    Free Member

    I would use ir reflectance sensors myself. Then its just a case of outputting a whole range of data to the serial port, and running the output through excel to work out whatever parameters you want. Record a data point every few seconds. Off the top of my head I would go with:

    Wheel rpm
    Crank rpm
    Resistance setting (bodge a potentiometer onto the setting adjuster)

    Then you can calculate everything else from that.

    You could add a servo to the resistance setting knob, and have it recreate real rides from strava or endomondo data!

    jfletch
    Free Member

    Yeah – as above it’s not going to be used as a serious training tool, but I think linking cadence and speed should be able to give some comparative data haven’t really thought this through but it seemed like it might be interesting, if not useful.

    Yep – As an interesting challenge to see if you can build a bike computer then it’s worth doing.

    But if your goal was to actually build something useful to monitor your training then you would be better off selling the Arduino, using the money to buy a bluetooth HRM and cadence sensor that link to an app on your phone and spend the time saved actually training.

    andytherocketeer
    Full Member

    haha @ selling the ‘duino. they cost so little.
    better still, buy a Chinese nano, and they cost like about the same price as the USB lead that comes with it 🙂 err… including shipping from HK too.
    Making the Arduino do something will be much more interesting than the time spent on a turbo. But if you must sit on a turbo, then doing so to test something you’ve made will make it more interesting.

    mrjmt
    Free Member

    Sounds like the kind of thing I attempt, spend loads of money then realise its not as good as the proper thing (Trainerroad) and end up shelling out for the proper thing while the DIY jobby sits in a drawer waiting for the next doomed project.
    Keeps you busy though!

    Doh1Nut
    Full Member

    On a related topic 🙂

    If you had a Pi and an ANT+ Dongle and sensors…

    What output would you get from the dongle? how much smarts is inside the dongle or is it just an aerial and all the conversion happens in the drivers, or do you get a meaningful stream of power=x heart = y data.

    (and yes I know the sensible answer is pay for trainerRoad)

    mrjmt
    Free Member

    Something in here probably but I really dont know much about it.

    Edit: or here

    farm-boy
    Full Member

    On a barely related subject, I am trying to build a bike counter for trail advocacy use from an arduino and a magnetometer. I keep getting distracted by life but I nearly have a prototype that will finally prove if the very cheap magnetometers are sensitive enough.

    maxtorque
    Full Member

    tomhughes46 – Member
    That’s basically where I have got to, however I’m using Python for the last bit and have got bored of trying to work out why it’s not working!

    I know that using Python et-al is the modern way, but if you just need a read a few bytes from a serial port, then VB is so easy and quick i still use it!

Viewing 20 posts - 1 through 20 (of 20 total)

The topic ‘Arduino as a data logger for a turbo trainer?’ is closed to new replies.