5
\$\begingroup\$

I want to virtually simulate a flow sensor with a second Arduino that is getting controls from a PC through Serial COM port. The flow sensor is a hall effect sensor so it either transmits LOW or HIGH level.

Is it safe to directly connect a digital output pin from #1 Arduino to digital input pin in #2 Arduino? Should a resistor or a diode put between the two pins?

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$

Yes, if you also connect the two grounds. That's the point of digital inputs and outputs.

There should be no need for a series resistor unless you are doing something unusual.

\$\endgroup\$
4
  • \$\begingroup\$ If I connect the two grounds should they be on the same voltage source? \$\endgroup\$
    – papaiatis
    Commented Jul 14, 2013 at 17:02
  • \$\begingroup\$ @Papai: Huh? Connecting the two ground means running a wire from the ground of one unit to the ground of the other unit. \$\endgroup\$ Commented Jul 14, 2013 at 17:11
  • 2
    \$\begingroup\$ Since Arduino is usually a development environment (and things may go wrong), and there is no harm in a series resistor between output and input, I'd advise to use one. I usually use 220 or 330 ohm between microcontrollers/Arduino's signal pins. The maximum current will be limited to about 20mA when things accidentally go wrong. \$\endgroup\$
    – jippie
    Commented Jul 14, 2013 at 17:12
  • 3
    \$\begingroup\$ @papaiatis they can be on different voltage sources and share the ground only (+ signal of course). \$\endgroup\$
    – kenny
    Commented Jul 14, 2013 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.