esaj Posted January 25, 2016 Posted January 25, 2016 As OliverH brought up the possibility of brake lights (with data from gyroscope), I recalled something I'd thought about before. ACS712 is fairly common hall-effect based current sensor. The interesting bit about this particular sensor is that it can not only detect the magnitude, but also the direction of the current. Since wheels use regenerative braking, the braking-situation can actually be identified based on the direction of the current (from batteries, to batteries), and since the sensor can detect the direction, slapping these two together, you should actually be able to build a simple circuit to light the leds when regenerative braking occurs. Here's a quick mock-up I just put together: It's missing some details (like the regulator), but the basic principle is this: The ACS712 will give out a voltage signal between 0 and 5V (roughly) that represents the magnitude AND direction of the current it is measuring. When there's no current flowing (0A), the output of the sensor is (around) 2.5V. When the sensed current flows in one direction, the voltage from the sensor will start to drop from 2.5V towards 0V (dropping more the higher the current). When the current flows in the other direction, the voltage will start to rise towards 5V. Using a simple op-amp or comparator, this voltage can be compared to a set level, and once that level is crossed, the op-amp output will go high (or low), and the output is then used to turn the leds (brakelight) on and off. The voltage divider formed by R1 and R2 is used to set the comparison voltage (here around 2.7V, just quickly picked up something from standard sized resistors). Once the signal from the sensor goes above this voltage, the op-amp output will swing high, and the NPN-transistor will start to conduct, allowing the led-lights to turn on. Once the voltage drops below the comparison voltage, the op-amp output will go low, the transistor will stop conducting and turn off the leds. R3 and R4 are just for current limiting. If the sensor was wrong way around (the voltage would start to drop below 2.5V when braking), the op-amp inputs could be turned vice-versa (and comparison voltage set to < 2.5V), or the sensor wiring could be changed to get it the "right way around". R1 could be replaced with "suitably sized" trimmer to adjust the sensitivity of the braking light to a level you want (ie. if you're just gently cruising down a slightly declined street, causing very small regenerative braking current, the light wouldn't light up, but it would turn on when going downhill at steady speed or really braking). ACS712 needs 5V voltage, so a regulator is needed for it (from the +12V output of the wheel mainboard or taken directly from a separate battery). The leds themselves and the op-amp can power directly from 12V. ACS712's are available at least as 5A, 20A and 30A -versions. If higher current would be needed (and for safety in general), I'd branch the wires going to the sensor from the actual motor / mainboard positive power cable (it's not like you need to know the actual amperage, just "something" to get the trigger level right, so ~halving the amperage going through the sensor shouldn't be a big deal). And I'd use the breakboard-version of the sensor instead of trying to make my own PCB for it : So far it's just an idea, but definitely going to try this with the generic at some point (it's currently still on loan with my gf's father). Parts needed: PCB (could be just a matrix PCB) Something like 0.25€ at cheapest with free shipping from Aliexpress ACS712 with breakout board (or chip + needed components around it, if you want to make it all into a single PCB) around 1,30€ with free shipping from Aliexpress A few resistors Maybe a cent a piece, probably need to order a set of different values, few euros Trimmer for adjustment Some cents per piece, probably need to order more than one LM7805 5V regulator (for example, pretty much any should do, the ACS712 needs something like 13mA) + a couple of capacitors Something like 1-2€, if ordering single pieces, the stupid thing is you can get them for 1-2 cent per piece if ordering something like a couple of hundred Some op-amp (doesn't need to be rail-to-rail, anything that can work with +12V and 0V probably works) LM358 for example is around 0.22€ / 10pcs from Aliexpress at cheapest, with free shipping NPN-transistor (or mosfet) for driving the leds, not much current is needed and voltage is low so almost anything will do? A cent or few per piece, might be hard to find single pieces? Bunch of red leds Around 0.50€ / 100 pieces Some casing for the leds to attach outside the wheel Depending what you use, free - infinity € Some wire Depending what you use, free - infinity € Total cost is probably below 10 euros / bucks (depending where you get the parts and assuming you got the tools like soldering iron). For producing more than one, you can probably get the components for less than euro (except the casings).
esaj Posted January 25, 2016 Author Posted January 25, 2016 Something like this would probably work fine for the led casing: Costs about 1.99€ here, it's a bicycle tail-reflector (probably could get one from an old bicycle too). Just needs some holes drilled for the leds and some hot glue to keep them in place + wiring + attachment to the wheel. Or this: It's a bike backlight with 3 leds, just tear out the battery compartment and add wires. 2.99€ here.
zlymex Posted January 26, 2016 Posted January 26, 2016 There are ready-made, inexpensive, stand-alone, automatic brake lights that incorporate accelerometer ICs inside.
electric_vehicle_lover Posted January 30, 2016 Posted January 30, 2016 Great idea @esaj!! I Hope to have this function faster with our OpenSource firmware. We can use the PS pin (the one for calibration) to control on/off of external light circuit.
Tomek Posted January 30, 2016 Posted January 30, 2016 another option (which is my plan for mcm4s when i get it) would be to add an additional microcontroller (eg arduino mini) and decode tx signals sent to bluetooth (of course only possible in case of wheels with bluetooth) advantage of this is a possibility of making own ledstrip effects etc.
esaj Posted January 30, 2016 Author Posted January 30, 2016 1 hour ago, Tomek said: another option (which is my plan for mcm4s when i get it) would be to add an additional microcontroller (eg arduino mini) and decode tx signals sent to bluetooth (of course only possible in case of wheels with bluetooth) advantage of this is a possibility of making own ledstrip effects etc. Nice idea on using Arduino Mini (or is it Nano?). Not sure what you'd need the BT-data for if making only a simple brakelight or repeating led effects, but of course for more complex cases that could be useful (like changing lights based on speed, voltage or current or something).
Tomek Posted January 31, 2016 Posted January 31, 2016 10 hours ago, esaj said: Nice idea on using Arduino Mini (or is it Nano?). Not sure what you'd need the BT-data for if making only a simple brakelight or repeating led effects, but of course for more complex cases that could be useful (like changing lights based on speed, voltage or current or something). to start with, from monitoring change of speed you can derive all kinds of breaking / acceleration effects. you can also use lights to have a (better) batter battery indicator and other warnings. well, in a nutshell replace the christmas tree effects that most wheels have as default with more subtle and practical ones.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.