how to detect current with arduino.
e.g. I want to detect if there are some voltages on two cables !
please help me
(if I don't reply it's because my profile is new and limits the number of replies)
(and if what I write is a bit weird it's because I use deepl translator and sometimes it translates weird)
Voltages are detected by using the analogue input pins with an
analogRead(pin);
Call.
Current is more tricky, you put a current through a resistor and measure what the voltage is across it. Then you use ohms law to calculate the current.
I don't thing you want to measure current at all.
All voltages being fed into an Arduino must be less that the voltage feeding the Arduino chip. So that is 5V or 3V3 depending on what sort of Arduino you have.
a voltage is measured between two points. if you want to measure measure a voltage on a cable there needs to be a reference, presumably the ground that the cable is part of
detecting a current is common in model railroads. there are several approaches. some that require the current pass thru a detection circuit which is part of the circuit. the voltage across a pair of diode is used to power the LED in an opto-isolator which becomes active when a current is present. or do you want to measure the amount of current?
another question is: if I connect the (+) to the positive cable where the current comes from to one of the analog positions, where do I connect the gnd to the (-)?