I have a simple robot that uses multiple arduinos, dc to dc converters, motor controllers and Rpis. (No diagram) I decided to add an additional arduino to monitor and control dc power that will intelligently shut down and provide status of different components of the robot. What seems to be happening is that my monitoring arduino (Mega) is inadvertently powering the components that I am monitoring, so nothing truly shuts off. All of the arduinos are connected to the Rpi via USB and I have cut all power lines of the USB cables.
So basically the devices that are off are being powered by the monitoring arduinos a0 line.
How can I monitor the power lines (5 volts) of my devices without inadvertently powering them ?
Is there a correct way to connect a voltage monitoring arduino that will not POWER the monitored circuits?
Draw us a simple diagram - one Mega and one black-box device. Without a diagram, I'm surprised that you can get anything to work. Most engineers I know find it difficult to have a technical conversation without a pen in their hand.
If A0 is an input (which analogRead() enforces) then no power can come out of it unless you are exceeding the supply rails somehow. Then it can deliver one or two milliamps before it blows up.
Yes I totally understand, When the mosfet switches are deactivated the connected components should turn off. Only if I remove the monitor lines or the USB lines do the components shut off. I cant see a ground loop either.
OK, let's pick on the Arduino at the top and the Rasberry Pi. They're both connected to the USB hub, so ignore all the other components on the diagram except those three.
You've cut power and ground on the USB cables, so there's NO GROUND between the two devices. You can't measure the voltage of a wire floating in the air and you can't measure the Raspberry's power input without a ground reference.
I would not be surprised if this releases the magic smoke from the hub, as there will be power currents flowing down those data lines.
Restore the ground lines on all of your USB cables. That will at least give you a common ground for all components to be referenced to.
I disconected the power on the usb cables so the devices could be independently powered. but arduino1 still stays on so I cut the ground wires and it still stays on. The ony way it turns off is if I remove ALL grounds from arduino1.
MY question can be put simpler maybe... Can one arduino monitor the power of another without it actually powering it ?
How will monitoring power help you at all? There should be a signal form the Rpi, indicating that power will be cut off after some time, so that each Arduino can perform a regular shutdown.
The robot is battey powered , when the battery voltage discharges to a certain point I have the robot programmed to search for a power outlet and charge up.
Everything works fine as long the Arduino 1 is not connected to USB but the Rpi must communicate with Aduino1. (I2C isnt as stable as USB)
I have tried to get around my problem by cutting power the USB power and ground connection but I can see that the Arduino 1 powers down only if the USB cable is totally disconnected . I am going to make a detailed CAD drawing ASAP. The version of the drawing I uploaded somehow is missing the pin lables. Thanks for your help !
That is still not the sort of diagram that was requested in Reply #6 ...
When I look at your diagram and read your original post I can't figure
(a) what is intended to happen
(b) what actually happens.
And you have not bothered to post your code - perhaps that is where the problem lies ?
When an analog pin is used as an analog pin (it can alternatively be used as a digital pin) it has a very high impedance and no appreciable amount of current could flow through it - check the Atmel datasheet.
Have you tried measuring the voltages at different places or measuring the currents to see what is going where?
buckstucky:
I disconected the power on the usb cables so the devices could be independently powered. but arduino1 still stays on so I cut the ground wires and it still stays on. The ony way it turns off is if I remove ALL grounds from arduino1.
MY question can be put simpler maybe... Can one arduino monitor the power of another without it actually powering it ?
You are saying the "arduino1 still stays on ", you have to show us how you connect the motor control to arduino1, may be it is power by the motor control board?
What else still stays on, when Mosfet power it off?
Show us the diagram on how you connect all the board together.
Robin2
Thanks for your response and your help. I traced the current back to the Fet board (as u suggested) which was not completely shutting off channel 1. Once I replaced the FET everything went back to normal operation.