Hi iugmoh,
You are right that you are reading the input voltage not the voltage on the motor (maybe I missed this requirement) but here is the possible solution:
Your IRF840 has a 0.85 Ohms ON resistence and your current sensor 0.2 Ohms (total 1.05 Ohms). Under maximum current allowed, 3 Amps, your maximum voltage drop will be 3.15V so the difference from the input voltage will be on your motor. You can compensate for that in your PIC program as one fixed voltage drop (read it under normal running conditions if such thing exists) or a variable one by using your current reading and apply it to the known fixed resistance involved (1.05 Ohms) if you want to get fancy.
This will change with the load, input voltage or how worn the motor is.
I’m pretty sure that we can better help you make decisions and select the best approach if you define your requirements in more detail.
Here are just a few questions for you:
• What will be an over voltage or over current situation? Define it.
• How are you going to address the inrush currents at start up?
• What is your target resolution and accuracy on voltage and current readings?
• Do you want to continuously have and monitor/display these readings or just be able to set trigger points at max/min conditions?
• Is your motor running under constant or variable load?
• What is your power source and its specs?
• Are there other requirements that you have in mind and didn’t mention yet?
• Is your project cost sensitive?
• Is this a one time deal or it will become a production item?
• Is this a hobby style product or used in a sensitive application (medical field or so)?
Please keep in mind that the answers you get from the forum are as good as your supplied information on what you trying to accomplish.
Regards,
Nick




Bookmarks