Current regulator for mini bot

Our team has been working with the new Romi system, and we are loving them.

We also have many Vex parts that we have learned to integrate to the Romi Base.

What I have asked our members to, thus far, avoid using the Vex 393 motors for other systems integrated with the Romi IO ports because, according to their datasheet, they can draw about 4 amps if they stall. In practice, it seems significantly less than this, but at ~2 amps per motor, 5 motors could be, well, a problem.

So, I am looking for a solution to add a fuse inline from VSW to the power rail.

I tried using these but when I tested them, it took about 4 amps to get them to trigger (I think the Romi is happiest with less than 2) in my house (about 70 degrees).

Would a polyswitch with a lower trigger rating be effective? If so, can anyone point me to a datasheet to help determine which one? Or, is there something better out there?

Just to confirm, we’re talking about this board? And, specifically, about the drive motor outputs (which are not the same as general IO ports)?

Assuming this is so:

The schematic shows the motor outputs are directly connected to this part, which specs 1.8A max drive current.

The part has built-in Overcurrent Protection and Thermal Shutdown, so it should be self-protecting. I don’t think adding a PTC really does anything. You may hit these limits but try to design so that stalls are unlikely.

If you are talking about any other output in the system, the answer likely changes – at least the specifics will change.

Thank you. I am talking about a similar product but the power section is the same.

However, I am talking about the five IO ports exposed by WPILib which do not seem to have the benefit of the overcurrent protection (though there is Reverse Polarity protection.

We would be using Vex Motor Controller 29s and the Vex 393 motors.

The power rail is unpowered by default, and so we would be using VSW with a voltage regulator (buck converter, I wonder if there is one with built-in current protection).

Hence my thought of needing some current protection.

OK, if I understand correctly, the current on the IO ports (used for PWM signal) will be very low – no worries here. The motor controllers will see the drive/stall current, and given that they are intended for use with the motors you have, should be fine here as well. So your question is about getting ~8V at whatever current can be had before some form of protection kicks in.

The most obvious solution here would be to just use another battery for the current source. This would actually be my first choice, assuming it’s legal/workable. If you want to power things from the battery you have, then it’s a question of where you can pull the power from.

From this manual:

  • VBAT is connected to the battery contact labeled BAT1+ and provides a direct connection to the battery supply.
  • VRP provides access to the battery voltage after reverse-voltage protection.
  • VSW is the battery voltage after reverse protection and the power switch circuit.

I copied the portion of the schematic that comes into play here:

So, the key question is where to get power, and (in part) this is driven by the specifications of the two parts shown on the line near the top of that schematic (whose part numbers are not shown there). If you are careful not to flip the polarity, you should be fine just using VBAT. Check to be sure this isn’t a higher voltage than the max voltage specified for the motor driver (which seems to be 8.5V when 9V would have been nice). If not, VBAT is fine to use. The motor controllers will still get power when the robot is off, but will not run the motors. They will not drain the batteries much in this state, so you can live with this – or either just take out one of the batteries when not in use or add a mechanical switch between VBAT and the motor controller(s).

I can’t read the part numbers off the pictures, but they are not super beefy. You can ask the vendor here. But, if it were me, I’d probably lean toward adding another battery holder and a simple mechanical power switch and use this to power the motor controller(s), or use VBAT and the switch.

Thank you.
We have the supply voltage question down. SInce it is a rail, students are just as likely to plug an analog sensor into one port and a few motors into the others. So, we are going to use a buck converter from VSW (to keep power off when the robot is off just as an extra measure of safety) and drop the ~8-6 volts (we are using rechargeables) to 5 (the motors are okay with this).

However, I am wondering about controlling the potential of 15 amps on that power rail as well as potential overflow through the ground bus into more sensitive electronics. I have reached out to Pololu as well, but I cannot find a current rating for the board in general so, I assumed 2 amps was it.

If it is higher, than the polyswitch we have would be fine. If it is unnecessary excellent, but I just do not know that much about ee and wanted to be certain to take necessary precautions.

Just looking at those two parts in the board photos, I’d be dubious of anything close to 15A (they are not beefy and no heatsinking). However, if you start to pull close to 15A, voltage drops are going to limit the current. At 15A, 1Ω of resistance is going to result in 15V of voltage drop (Ohm’s Law) and you only have half of that. In practice, you are looking at internal resistance of each battery, plus the resistance of the two parts I mentioned before (FETs). At lower voltage, you will end up drawing less current, so things self limit. Six AA batteries in series are just not going to put out 15A, even if they were short-circuited.

In particular, you will wind up dropping below 5V, where a buck converter will run into trouble. If you want a 5V rail, I’d consider using Pololu 5V Step-Up/Step-Down Voltage Regulator S18V20F5. There is an enable pin on this, and you could use this so it turns off when the robot does. I’d use a separate set of batteries for this (maybe four C or D cells), but you could use VBAT on the existing set of batteries. But you still are not likely to get 15A (these are rated around 2A, which is very realistic).

If you have questions about the details of hooking this up, I’m happy to check/help. I’ll let others chime in, maybe someone else will have a better answer for you. Just ask if more detail would be helpful. A polyswitch (or even a fuse) adds some resistance (ballpark 0.1Ω source), so you don’t want this if it isn’t needed.

1 Like

Thank you so much. This is exactly what I was looking for. I am familiar with Ohm’s Law, and the resistance of individual pieces, but not with battery resistance. I knew about it in general, but none of the specifics. This is incredibly helpful, and those converters are what I was looking for.

You also bring up a good point about the buck converter. I knew about the issue with the voltage drop, but assumed it would never get that low because the robot disconnects when the voltage feeding the Pi dips below ~5.4 Volts. However, unlike with the full robot, there is a chance that when that happens on the Romi, the motors will not stop (there is a possibility that there will be no message to do so). In that event, there is a much greater than zero chance that a voltage starve could cause the buck converter to run into trouble.

I am not looking for 15Amps. these motors are happy at ~.3 an amp a piece, I just wanted to protect the control board and user against a potentially dangerous situation.

As for the implementation, I think I understand how to wire it up. I wonder why you recommend grabbing the power before VSW? It seems that the switch can handle 3.0A continuous and 12 max.

I think we would prefer ease of use over power efficiency for the robot as a whole. As such, for now, we would like to use the onboard batteries (and switch) if possible. In my testing, I did wire it successfully using an external power source and the buck converter I have, and that will be an appropriate solution if our members need it. However, for general creation, and learning mechanisms and programming, I think the onboard batteries may be sufficient at least to begin with.

I didn’t find that page of the specs – I didn’t even realize it was a separate part and not built-in to the part you originally linked! If you are using the same batteries for everything and do not plan to draw all that much current normally, you can use VSW. The main drawback (given it will handle the current) is the voltage drop/loss over the pair of MOSFETs – this is a function of the resistance, given as “MOSFET combined on resistance (max)” in the specifications on this page. “16 mΩ @ 4.5 V” is OK for the use you’ve described.

However, given the presence of an enable pin, you already have on/off control built into the converter. It’s going to be more efficient to control on/off that way than to use VSW. In part, this is because you’re already paying for the MOSFET as part of the converter circuitry. But it’s not that big a deal for lower currents.


I am also working with the Romi, and was looking at how to add an external voltage regulator for powering the accessories connected to the five standard GPIO ports. You’ve raised some excellent points here that I hadn’t fully considered.

I had picked up three different Pololu regulators to try out. They are similar parts capable of handling increasing power levels. For a variety of reasons, I’ll consider this part first: Pololu 5V, 2.5A Step-Down Voltage Regulator D24V22F5 - the same 2.5A 5V regulator circuit that is used on the Romi controller board itself.

@nuttle raises an excellent point, which is that powering the regulator from VSW means that the accessory power must pass through the soft-switch mosfet in the controller board’s power circuit, while powering from VBAT means the regulator is always connected to the power source, even when the 'bot is powered off.

Looking at the specs for the power circuit, it appears that the mosfet can switch up to 6A, which should be enough to supply two of these regulator circuits. So I am inclined to connect VSW to VIN on my regulator. The Raspberry Pi also gets its power through this circuit.

The alternative is to connect VIN to VBAT and then use the ENable input on the regulator to turn it off. This means we would need an active high enable signal from the controller. We could use VSW for this, although it is not a regulated 5V logic level, so could theoretically have issues. I considered using the PG “Power Good” signal (from the Romi controller’s regulator circuit), but was worried this would self-oscillate when the battery power dropped below threshold. A more stable option might be to connect EN to VCC on the controller.

As a last resort, I might commandeer two unused GPIO pins to monitor PG on the external regulator and control EN in software. This would require a bit of code added to the Romi firmware image.

So I’m hoping the simple setup works. I should know later today.

1 Like

After a bunch of back and forth in my brain :slight_smile: I ended up ordering one of these which is the one @veg found on the other Romi post. Thank you. Sorry I did not see your post above sooner to let you know.

Because, The people at Pololu mentioned the monitoring pin on the 32U4, and that combined with the en pin, and/or the PG, could allow us to control it if the voltage dipped below the requisite 6v. In addition, it has a higher current limit than the boost-buck, and was a bit cheaper.

However, as I await their arrival, I did some more reading, a bit of testing, and too much pondering.

I found out that when the batteries drop below 6 volts, we get a bit more than 1.4 volts on the monitoring pin. This is more than the 1.2 required to trip the en.

I am wondering a few things.

  1. Is turning the buck converter off necessary since the device has “output undervoltage and overvoltage protection…” Will that protect it enough if it is starved for power?
  2. If not, do you think it would be easier to use the PG or a voltage divider on the en than to try to lower the .2volts on the monitoring line?

@veg Pololu did confirm the 6A limit on the board. The reason I did not go with the one you mentioned above is that I think it did not have the over-current protection. The input voltage monitor pin is hardwired to AI1(PF6) which is right next to the header used for the WPILib External IO. The WPILib IO configuration and usage seem to have no affect on its performance. Since it is hard-wired, it seems to just work :). I wanted to avoid the software monitoring because in an under-voltage situation, it is plausible that a robot disconnect would not trigger it. I am assuming all io is controlled through the simulator, and when the voltage drops the robot disconnects.

Thank you all for your help.

Which monitoring pin? Are you talking about the battery voltage divider at A1, or the PG pin? I was under the impression that PG was a digital output.

I was thinking of controlling the EN pin of the external regulator with one of the spare GPIO pins (D5 or D12, for example) so that I could turn off the accessory power under low voltage conditions. There is a module in the Romi firmware that monitors the battery voltage divider at A1 to automatically disable the motors under low voltage. It would be pretty easy to add logic to do it there.

Here is my test setup with the 2.5A board. I soldered a number of headers to the various power pins so I could experiment with different methods.

1 Like

That is excellent. Does it shut down when the input voltage drops? I was talking about A1. That is what I have been using thus far.

I got sidetracked onto assembling Romis and haven’t tested it yet. I plan to do some quick testing using a variable bench voltage supply to see what happens at different voltage thresholds, but I really need to test it under load of the arm servos using real batteries, and proper cycling takes time.


I get it. That was me a bit ago.

So, the buck converters came today, and here are some observations. I tested with two sets of batteries (one was new, the other had just force-disconnected the pi from the robot, so greater than 5 volts, but less than 6). I wired it to vsw and then to a multimeter.

The analog voltage level pin is too high. The output was 5 volts regardless of sets of batteries when I wired it to an.

I tried to use PG, but though it seemed to work correctly at first, I did not wire it correctly as it was not consistent so I think it was just floating.

The “power good” indicator, PG , is an open-drain output that goes low when the regulator’s output voltage either rises more than 20% above or falls more than 10% below the nominal voltage (with hysteresis). An external pull-up resistor is required to use this pin.


With the schematics and part numbers (for the component parts, would be on the schematic), I’d be happy to give you a hook-up diagram (for the whole thing). There’s almost enough info to be able to do this, which is kind of frustrating.

Here’s a bit more on “open-drain”. And, here’s some discussion of a somewhat similar scenario.

Here’s probably way more than you want to know about this subject.


Thank you. I will look over those docs. I understand the concept of pull-up and saw that. But, I had difficulty with the wiring. I tried to use a resistor to pull it up, but probably wired it wrong. Hopefully this will help.

It also has a 100k resistor to vin on the en pin. So, worse case, I perhaps I can run a resistor between en and ground to build a voltage divider.

Edit: Those links are incredibly helpful. I had wired PG incorrectly. Also, after rereading the specs, it seems that the minimum input voltage is 5.3 volts. The Romi disconnects around 5.4. So, there is little chance that the voltage will get that low (it is possible with a buggy program and disconnect).

In that rare event, is it possible that the…

  • Output undervoltage and overvoltage protection

Would protect the Romi and the converter?


Practically speaking, I would bet that you are fine. Six AA cells and small motors/servos are just qualitatively different than a full-size FRC robot. And, you seem to be doing more-or-less the same as what the designers chose to do with the built-in 5V supply.

The only qualification here is that I don’t have the amount of detail to be able to give you an engineer’s sign-off on any of this – and I don’t have any of these pieces around to try out or examine. I don’t know exactly how you have things hooked up.

You’re asking the right questions and doing the right things. And I get the desire to be sure nothing can be damaged, even under the conditions these robot experience. I’m hoping either someone else here or at Pololu can get you what you need if it goes beyond this. But you are likely to be OK here.


That sounds good. Thank you for all your help. I have certainly learned a lot.

1 Like

This has been my operating assumption from the start. Besides, if you don’t fry something, are you really trying?