I'm trying to intercept the signal from a externally powered button using an Arduino Mega 2560. The button connects to an DC external device with 4 lines:
Button External Device (DC)
O------------------ Red ------------------------O
O------------------ Black ----------------------O
O------------------ Yellow ---------------------O
O------------------ Green ---------------------O
Red and black are hot and return lines that supply the button with constant power (because it has an LED inside).
I've identified that potential difference from the green (+) to yellow (-) line is
1.7 volts when not pressed
0 volts when pressed (ie button closes circuit)
These lines aren't grounded, so I'm trying to read the difference with analog pins A14 and A15 connected to the green and yellow line respectively, through 1M ohm resistors.
PROBLEM:
Whenever I connect the A14 pin to the yellow line, it confuses the external device and disables the button.
I don't quite understand how the analog pins read voltage. Is what I'm doing possible? And if so, how? Thanks!
That's what I initially thought as well, but I think the red and black lines are meant to not be interfered with. Every time I connect to the black line it shorts the circuit.
I wish I could help you out with a datasheet, but it's a custom PCB. I'll get back to you if I can get.
That's what I initially thought as well, but I think the red and black lines are meant to not be interfered with. Every time I connect to the black line it shorts the circuit.
I wish I could help you out with a datasheet, but it's a custom PCB. I'll get back to you if I can get.
Can you take a high resolution, well focused picture of both sides of the circuit board, as well as the connectors? Your description is confusing to me, and a visual reference might help. Sounds as if it may be malfunctioning. Connecting a ground to the ground wire should not disable the device.
blairallday:
Every time I connect to the black line it shorts the circuit.
What are you connecting to the black line? A multimeter set for measuring voltage could not cause a short circuit. Nor could an Arduino I/O pin set as INPUT.
You have the board, you have a multimeter. Start measuring what is connected to what and draw a schematic. Once you have the schematic, it will probably be clear how you can intercept the signals.
PS (after Robins new reply below)
Can you identify the 16 pin chip net to the coloured connectors?
Thanks for the pictures. That board is like an Arduino with a bunch of connectors - there is an onboard ATMega328p, and a 16 MHz crystal. Reverse engineering it will be non-trivial. You need to search for documentation.
I think it's going to be tough figuring out whats going on in the PCB in respect to both the hardware and software.
I was doing some research and stumbled upon the ADS1115 Differential Voltmeter, which measures differential voltage without needing to reference Arduino ground potential.
Have any of you used it? And do you think that will measure the voltage across the green and yellow lines without affecting the circuit?
GoForSmoke:
All voltages are relative to ground. If Arduino ground is not the same as the ground of what you would test then who knows what the either end sees?
Not true.
Many of the Atmega chips such as the 2560 (but not the 328) can measure differential voltages - the voltage between two of the analog pins. Many of the chips also have amplifiers so that they can measure very low voltages. Neither of the pins needs to be referenced to the Arduino GND. IIRC the only constraint is that the voltage between the two pins must not exceed 5v. RTFM.
Of course I am assuming that the differential voltage is quite separate from the Arduino GND - for example powering it with one battery and measuring a circuit powered by a different battery and with no common connection between the circuits.
blairallday:
I think it's going to be tough figuring out whats going on in the PCB in respect to both the hardware and software.
That software part is new. From your opening post, you wanted to intercept the signal; and that can easily be done once you have an understanding of the board. The board has 5 similar groups of connectors (POD1 .. POD5); once you have figured out one, the others will with high probability be similar.
Next determine the type of the 16 pin chip; I suspect that it's a multiplexer.
Is you yellow connector the only one connected to the board? Or do white, blue and red also have connections to your external device(s)?
The 2560 can treat one analog pin as ground and measure another relative to that?
You can use a low Vref to measure small voltages on any AVR. Suppose I fed one input to Vref and the other to the analog pin?
LOL, I suggested that to get the difference between light detector reads just days ago.
RTFM? For what voltage is, my manual is a physics book. Depending on the device and environment, device ground may change relative to earth ground or other device grounds wildly.
GoForSmoke:
The 2560 can treat one analog pin as ground and measure another relative to that?
I would not use the word "ground". Ground has a special meaning related to the Atmega's power supply.
In my earlier post I just said that it can measure the voltage difference between two analog pins.
If you don't believe me read the datasheet and try it. Connect a low voltage battery between the appropriate analog pins without making ANY connection between that battery and the Arduino GND. I learned about it from this Youtube video and I have tried it.
Robin2:
I would not use the word "ground". Ground has a special meaning related to the Atmega's power supply.
In my earlier post I just said that it can measure the voltage difference between two analog pins.
If you don't believe me read the datasheet and try it. Connect a low voltage battery between the appropriate analog pins without making ANY connection between that battery and the Arduino GND. I learned about it from this Youtube video and I have tried it.
...R
I believe you. The appropriate analog pins let you measure electrical potential between them.
That's not the same as feeding power to one analog pin without connecting ground between the board and the power source.
GoForSmoke:
I believe you. The appropriate analog pins let you measure electrical potential between them.
That's not the same as feeding power to one analog pin without connecting ground between the board and the power source.
I find your use of language a bit confusing. Your second paragraph conjures up one-hand clapping. But I think you just mean the more usual mode in which a single analogue pin is used to measure a voltage by reference to Arduino GND.
Robin2:
I find your use of language a bit confusing. Your second paragraph conjures up one-hand clapping. But I think you just mean the more usual mode in which a single analogue pin is used to measure a voltage by reference to Arduino GND.
...R
The second one is what the OP's earlier schematic showed which is why I tried to explain why to connect the grounds, so the volts will be on the same scale, all relative to the same ground.
GoForSmoke:
The second one is what the OP's earlier schematic showed which is why I tried to explain why to connect the grounds, so the volts will be on the same scale, all relative to the same ground.
I'm not sure where the schematic is but I have just been trying to point out that for measuring very small voltage differences there is the option of using the differential voltage facility and the associated amplifier within a suitable Atmega MCU.