View attachment 185245
Well something like the bottom schematic would accomplish that, assuming that the brake sensor works like the ones I've encountered. (Top one is just the stock Qiroll). Brake sensor to ground on one side and a pullup resistor to VCC(3.3V) on the output. When braking, the sensor will pull the output to ground. Unfortunately this is the opposite of what you want, since pulling the Qiroll's throttle input to ground is what
activates the motor.
So you'd need a NOT gate of some sort, whether you make it out of a transistor and a couple resistors or a logic IC. Also note the voltage regulator off the battery, you hardly need any power so a linear reg is fine but you do need something (ideally with those capacitors on the input and output). I used this series before I went surface-mount:
https://www.digikey.com/en/products/detail/diodes-incorporated/AP7381-33V-A/7802342
Also if you get a dual NAND gate, you could arrange the logic so the switch still works. When you want it to run nonstop except when braking you could wrap a rubber band or something around the switch (lol), or replace the switch with a slider/latching button instead of momentary. When you only want assist sometimes, you could take the rubber band off/actively manipulate the switch and it would control (with the brake cutout still there as a backup).
https://www.digikey.com/en/products/detail/texas-instruments/CD40107BE/376603
Actually you might have to go with the second option -- AFAIK if you plug in the Qiroll with the throttle held down (which is what the NOT circuit would look like) it errors?
View attachment 185246