measuring current with picaxe 18m2

timm

New Member
Hi can anyone help. I'm using a picaxe 18m2 with darlington driving a 12v dc motor in turn driving a wheel. As the wheel passes certain pinch points in each revolution the motor draws more current as more torque is required. Is there a way to detect when the current increases over the normal current (0.2A) in order to stop the motor. Thanks for any help.
 

premelec

Senior Member
How much current increase is there? You can put the current sense resistor in series with motor connection to V- and possibly just use READADC across the resistor. [resistor circa 1 ohm... .2 amp = .2 volts...]
 

premelec

Senior Member
Just to be prudent it would be good to put a series resistor to READADC input pin in case there are some large spikes - also a capacitor from that pin to V- as large as you can without making response too slow for your purpose... if you are really uncertain of the spikes - 12VDC on the pin will kill the PICAXE !- some zener or regular diodes from pin to V- are in order...
 

timm

New Member
Thanks, that all seems a bit complicated as I have limited electronics knowledge. I have a capacitor across the motor terminals so will that prevent spikes - I don't know. I have tested with a 100 ohm resistor in series and whilst it seems to drop the supply voltage to about 10v it gives a range of 1.5v to 2.3v across the resistor as the motor torque changes, which should be OK with ADC as far as I can tell. (As a novice I find the Picaxe manuals extremely vague in their descriptions). The motor may go a bit slower but that is not a problem.
 

darb1972

Senior Member
I think you'll find that 100 Ohm is far too high in value (particularly for a motor). Generally speaking, current detection only requires a very low value resistor so a relatively small voltage drop will occur. A relatively large value resistor will cause a large voltage drop (depending on the current drawn by the load) and this will potentially cause performance issues with the load (the potential across the load might be too low, eg: your motor will run slower). More torque on the motor will also cause more current to be drawn which in turn will cause a larger voltage drop across your sense resistor.

With the load being a motor, as premelec suggested, other forms of spike suppression might be a good idea. In addition to the capacitor/s (and I would suggest several values to efficiently cover a wide band of suppression), zener diodes or 5V transorbs (or other forms of 5V clamps) might be a good idea. You might even need to clamp any negative going spikes. Motors are notoriously noisy and can generate all manner of unwanted signal/noise.
 

premelec

Senior Member
@timm - note that 2 volts voltage drop on 100 ohm resistor is .02 amperes - NOT .2 amps... Are you using a pretty small motor? There may be noise problems - often resulting in the PICAXE reseting / starting unexpectedly - with a small motor this isn't as much a problem. Perhaps define better what you are up to and we can be of assistance... ;-0 maybe even a picture of the stuff you've got to work with...
 
Top