Author Options:

Question about electrical safety for a project with a 60V Power Supply and a Nema 34 Motor? Answered

Hi Instructables Community,

I'm working on a project with someone where we are making a VR game that uses a stationary exercise for interaction. For example, if you turn up a hill in the game while exploring a map, it gets harder to pedal.

The resistance on the exercise bike is controlled by turning a knob.

The knob just controls a brake-like device that adds friction to the flywheel.

We're just going to use a stepper motor to control the knob with a belt.

We, somewhat unscientifically, compared the torque required to turn the knob on the bike to how much torque Nema 17 and Nema 23 motors require to pull parts of a 3D printer back and forth and decided we probably need to use the bigger NEMA 34 motor.

The stepper motor driver and motor we are going to require a 50V or 60V, 5A DC power supply.

The motor will need to be attached to the frame of the bike near the resistance knob.

This is the stepper motor and driver we are planning on using. This is the power supply we are planning on using.

The stationary bike we are using is made of steel and very heavy and will be moved around a lot when people want to try it or move it out of the way. I'm a little worried that since the bike will be moved around a lot and since the motor will be connected to the bike, that if a wire got pinched or damaged it could lead to an electrocution hazard.

How can I make the electronics on this project as safe and fool-proof as possible?

My plan for safety right now is:

  1. Use a GFCI power adaptor to power the power supply (link)
  2. Keep the power supply and driver in a metal, grounded project enclosure (link)
  3. Ground the steel frame of the stationary bike.
  4. Keep the project enclosure fixed to the stand of the bike so that it moves with the bike when the bike is moved out of the way.
  5. Put the wires to the motor in some sort of heavy-duty insulation or conduit that's securely fixed to the frame to avoid any pulling/s shearing.

Any advice/feedback/recommendations would be greatly appreciated.

I don't have any photos of the set-up right now since this project is still in the planning stage.


The forums are retiring in 2021 and are now closed for new topics and comments.

2 years ago

Hi Jack,

Thank you for your advice. We already have it working well using the knob and stepper motor. It wasn't really the project for cracking open a control theory textbook. We weren't looking for much precision or consistency. It was just sort of a fun little thing. "Oh, I'm going up a hill and now it's harder to pedal!"

I mostly had questions about best practices w.r.t electrical safety but I think I've sorted them out with advice from others in the meat world.

Someday if we have time to write it up, we'll make it into a post on here.


Jack A Lopez
Jack A Lopez

2 years ago

I think you may be making a kind of naive, newbie, mistake, in your thinking about how to control the mechanical resistance of your exercise bike.

Speaking vaguely, some physical systems are more easy to control than others.

More specifically, the art of control theory divides these control problems into two categories, namely, open loop control and closed loop control.

What I am saying is it might be naive to think you can just command the resistance torque (or power absorbed divided by angular speed) of the bike, simply by moving a knob to a particular angle, or to think you can move the knob to a particular angle, simply by sending a specific number of discrete step commands to a stepper motor.

It might not be obvious to you why this would not work.

Speaking vaguely again, some kinds of physical systems are easy to manipulate, i.e. move in ways completely predicable, and those are the kind that work well with open loop control.

For everything else, there is closed loop control. That is you need to actually measure the physical quantity you're trying to control, and use feedback to ensure the system is moving (changing) just the way you want it to.

More specifically, like for your knob driven by stepper motor, if torque required to turn the knob is too stiff, then, it will stall instead of stepping. Moreover, for every stalled step, the true mechanical resistance torque of the bike, drifts from the number of "steps" where your software thinks it is.

Also there may be drift in the physics of the exercise bike itself. I mean, like a drift in the relationship between knob angle, and true mechanical resistance torque. For example, if the mechanical resistance is provided by a belt rubbing against a wheel, the belt might be slowly getting smoother with time, as the wheel rubs parts of it away.

The designers of the bike expected feedback to come from the user; i.e. he or she would notice how much physical resistance in the pedals, and turn the knob accordingly.

But if you want to take over that responsibility from the user; i.e. you want your software to control how much mechanical resistance, then that means your software has to be smart, which kind of implies some kind of closed loop control.

Or at least that is the way I see it.

By the way, those NEMA numbers for stepper motors, refer to the dimensions of the square faceplate, like the width of one side that square bracket, in units of 0.1 inches. E.g. a NEMA 23 motor has faceplate 2.3 inches wide.


The NEMA number is only an approximate guide to how powerful the motor is. That is to say, two different stepper motors with the same size faceplate might have different amounts of torque. So you should look up a specification for torque, for each specific motor, provided you can find someone publishing this spec.

Also BTW, I humbly suggest looking at other methods for mechanical resistance used for exercise bikes, as these might have physics that is inherently easier to control. Some suggestions: the kind that use magnetic damping; i.e. a copper or aluminum wheel moving close to, but not touching, strong magnets. Or you could use an alternator, of some kind, connected to a programmable electronic load; i.e. one that uses feedback, and can be commanded to offer a constant electrical load; e.g. a specific impedance (in ohms) or a specific amount of dissipated power (in watts).