I am looking to upgrade a project I built last year. The project involved modifying an elliptical cross trainer to control the playback speed of an MP3 being played on a Raspberry Pi.
It was done with some custom python code and a hall effect sensor.
I am now looking to do the same thing with a real bike. But the use of a ‘normal’ bike means that I am looking to use the standard spoke-mounted magnet from a bike computer kit. The one I have needs to be within a few millimetres of the sensor.
Thank for the reply. I’ve been a bit distracted since my initial post.
I stopped past and had a look at the bike (before Melbourne went into lockdown) and this seems like the simplest approach. We tried another magnet that was lying around the workshop and it increased the range to a couple of centimetres.
A single magnet worked fine last time. In fact, the biggest problem was that it worked too well. Whenever we were testing it, we were just going at a ‘normal’ speed. Once we loaded the real music, and started hitting higher speeds, we found that the speed suddenly halved. It took me an embarrassingly long time to realise that I had left in a debounce value on the code that monitored the GPIO. Once I removed that, it worked perfectly.
The elliptical cross trainer caused an irregular rhythm, which won’t be an issue with the circular wheel on the bike.
This is the cross trainer in action:
I am actually thinking about using the Pi to control an RGB LED strip, linking the colour of the LEDs to the speed of the wheel. Any advice on which components would be needed to control 2-3M of 5050 RGB LEDs from the Pi? It is my understanding that a MOSFET transistor for each of the colours is what I need. But the making sense of the specs/maths to work out which part(s) will be able to handle it is I bit beyond me.
I picked up some 5050 RGB LEDs last week. Just waiting on the MOSFETs (I think the IRLZ44N is capable of doing what I need) to arrive.
I have a few Wemos D1 Mini boards floating around. I will probably test it out with a some of the single colour stips I have lying around. Since I’m using a Pi, I will tend to stick with PWM for that side of things. Most of my Wemos projects have been based around OpenMQTTGateway. But I am not sure if it will support PWM. If it doesn, it will be easy to extend my existing Google AIY functionality.
I’ve got a never-ending supply of 12V and 5V supplies, so that side of things will be easily covered. I may look at running a buck converter to make it possible to stick with a single power source.
It is also likely the light rope from last year with be used again, meaning there is nothing I need to do from my end.
The rejigged bike setup is now up and running. Only a few software variables to nail down. We needed 3 magnets to improve the detection of a sudden stop in pedalling.
I am currently using the sensor that Jaycar sell as part of their “PCduino” range. It is a clone of the Arduino module. It is currently using a 2m cable run. I was hoping to run a 10m cable between the Pi and the sensor. Since it operates at 4.5V-24V, will voltage drop be an issue for either the module or GPIO side of things?
Would switching the sensor out for one of these overcome any such issue?
That’ll be majorly dependant on the gauge and resistance from the material of the wire being used. Your best bet in this case would be to experiment with it and see what your materials will let you get away with. If there’s anything else that we can do for you please let us know!
Unfortunately the cable was bought back when Masters was shutting down and only has “4 CORE SECURITY CABLE” printed on the sheath.
As best I can tell, it is basically this. Unless the colours have changed and what I bought as Red/White/Black/Green is now sold as Red/White/Black/Blue.
That is basically what I ended up doing. I have about 12-13m of it left. I pulled out the dupont crimper and put connecters on each end. The 5v module appears to be working fine over that length.
I’ll try build a mock-up of the setup and get a video. Much like the previous build, the new incarnation is not really something that look at all Pi-like in the flesh. You would have to tear it down to ever see the Pi.
For those following along at home, the first recording session was last Wednesday and everything went off without a hitch. To extend the sensor cable, the guys in tech services cut the cable and attached a couple of XLR connectors. This allowed for the use of an XLR-connected extension lead to give the additional length.
The extra length meant that the Pi was located in the off-stage area, where I operated it from. This saved running power / USB / HDMI / audio cables out onto the set.
I don’t have any details on transmission dates. I think there is still one more of the last round of episodes to go to air (the 2010s special). I didn’t even hang around long enough to find out who won the episode I was there for
It was easier to just pack up and leave as soon as my segment was finished. It is simpler to just head to my car at 8pm and avoid having to explain to any police what I was doing out of my house.
And you can get our latest projects and tips straight away by following us on: