i am working on a project that uses an avr and 74hct573 to activate a couple of relays. the motor that is activated on these relays will have a spike in current and level out at about 2 amps. what would be the best way to stop the motor if current goes over 2.5 - 3 amps. i have wrote all the code with bascom avr and everything works great just need a way to stop this thing if the current goes to high.
it is basically a protection if something is in the way of the part that is moving if the optical sensors dont see it
you could do this in hardware with a “slow-blow” fuse or a self-resetting “polyfuse” (I think polyfuse is a trademark, there are many makers). In software, you could put a (small) series resistance on the return line, and measure the voltage drop across it with an ADC input. If it’s above a threshold for more than a certain number of consecutive samples, shut off the motor.
If this is a safety issue (device might catch fire, or crush somebody, etc.) I’d go with the fuse…
does the 8515 have a comparator input? you could use that instead of an ADC since all you really want to know is whether the voltage is higher than a certain value. you’d need some way to generate a reference voltage for the comparator’s other input … maybe something as simple as a trimpot would work?
I don’t have any sample code, I’m really just thinking out loud here