Go Down

Topic: Strange grounding issue (Read 3776 times) previous topic - next topic

NeX


Yes, a diode between the Arduino and the remote sensor, cathode to Arduino, will protect against the Arduino driving high and the sensor driving low at the same time.

If you want to connect them directly, then use this scheme. Configure the pin as an input, and digitalWrite(LOW) to it when not sending a command. When you want to send a command, instead of doing digitalWrite(LOW), do pinMode(OUTPUT); and instead of doing digitalWrite(HIGH) do pinMode(INPUT).


thanks for the help, but actually i am using direct PORT write to toggle the pin, but i think a diode will be fine,

dc42


thanks for the help, but actually i am using direct PORT write to toggle the pin, but i think a diode will be fine,


Then you can use a direct write to the port's data direction register to achieve the same effect.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up