Power supply

First up, would just like to say thanks to Ray from www.dcrainmaker.com for the mention in his recent post. Certainly helps keep the motivation up to know people are keeping half an eye on the build.

As I touched on last week, I think the time has come to start progressing the hardware design – away from the current mess of wires on my desk towards something a bit more practical.

So, is probably a good moment to recap on what I’m thinking it will look like. I’m envisaging replacing the handlebar resistance lever with a smallish box (a bit bigger than a guitar effects pedal) that can sit on the floor. This will have the resistance cable coming in through a barrel adjuster, a USB port for PC connection, and a power input jack for a mains adapter. There will also be a handlebar mounted controller with a few buttons for resistance control, lap marking, etc.

Power Supply

For the initial versions of the prototype, I’ve been powering the servo motor directly from an adjustable bench power supply, and the microcontroller through whatever development board I’ve been using. Moving forwards, everything will be powered from a dedicated supply.

Assuming that I keep running the servo at 6V and the micro at 5V, this means two separate voltage rails. The current draw for the micro is inconsequential in this context, and can be easily achieved with a low dropout linear regulator on the 6V supply. However the servo can draw a reasonable amount of current, which requires some more careful thought around the design.

Possibly the easiest (and most short sighted) option would be to require a regulated 6V DC supply, and use this for the motor directly. However, imagining for a moment that someone other than myself is going to build one of these some day, it doesn’t make much sense to shave maybe £3 off the bill of materials by skimping here – only to require a fairly uncommon power supply which is likely to cost five times that.

So, I think it’s probably a good design goal to be as inclusive as possible on the power supply, in the hope that there will be something already lying around that fits the bill (am sure I’m not the only person with a collection of random old power bricks).

The next simplest option would be a linear regulator, typically requiring just the regulator itself, a couple of filter capacitors, and a couple of resistors to set the output voltage (if adjustable).


But the downside to linear regulators is heat dissipation, as the voltage dropped across the regulator just ends up as waste heat. I know from monitoring the current draw on my existing servo setup, that it ranges from a few 10’s of milliamps at minimum load, up to around 700mA at maximum trainer resistance. From a regulated 12V supply, I’d need to drop 6V across the regulator, which at 700mA current, means just over 4 watts of waste heat.

A TO-220 package with no heatsink will have an approximate junction to ambient thermal resistance of around 60 degrees C / watt. Attempting to dissipate the full 4W would theoretically increase the temperature of the regulator by 240 degrees, except of course it would overheat and shut down long before this point. I could just add a suitable heatsink (this particular one should keep things under 15 deg C/W). But, even then, once everything is inside an enclosure ventilation and airflow would become an issue.

Once again, I think this option is just too restrictive on the power supply choice. A 9V adapter would be ideal, 12V may just about be manageable, but a typical laptop adaptor from my spares box is 18V, which is just asking for problems.

I think the correct solution would be to use a switching regulator.


Switching regulators require additional supporting components, and are somewhat more complex to design for, but can be far more efficient across a  far wider input voltage range. I’m considering the Infineon IFX91041EJV which features an adjustable output voltage, output current up to 1.8A, and a supply voltage range up to 45V.


Not having a suitable switching regulator to hand, I put together a simple test circuit using an LM317 linear regulator on a solderless breadboard. I didn’t have a TO-220 heatsink either, so I’ve been measuring the temperature directly from the tab on the regulator. During a typical workout for me, the regulator reaches 30-40 degrees C above ambient when running from a 12V supply. Of course this relies on me being puny and not using the full resistance of the trainer ;)


So, not an ideal solution, but I think it’s acceptable while I work on the PCB design for a switching regulator. I’ll build this version up a bit more permanently on stripboard, with a heatsink added for an extra safety margin.