IR obstacle sensor pins

Hi,

I'm going to install an IR obstacle sensor (like this one) to my Arduino nano.

I've found quite a few instructions on how to connect the sensor board to Arduino. Most of them connect IR VCC -> Arduino 5V, IR GND -> Arduino GND, and IR OUT -> any of the Arduino digital/analog input like this tutorial. But I also read this article on Instructables that connects the IR pins to A0, A1, and A2, which seems a lot cleaner. I know this should work but is there any thing that could go wrong in this approach if this device is supposed to work a week long uninterrupted?

Thank you.

But I also read this article on Instructables that connects the IR pins to A0, A1, and A2, which seems a lot cleaner.

That's just the easiest way to connect the module to the Arduino. But this way you have to make two of the analog pins being GND and 5V (by driving them LOW and HIGH) to simulate the power pins. You may do this with this module because it draws not much current. Don't use that as a general recipe to connect sensors.

The first way is a bit more work to connect the module to the Arduino but it's much easier to program and the cleaner way in my opinion.

Hi Pylon,

Thank you for your answer!

I agree that the second way is a little hacky but I need to connect 5v and gnd to my Bluetooth module so I figure it would be easier that I separate the two boards.

Thank you!

I agree that the second way is a little hacky but I need to connect 5v and gnd to my Bluetooth module so I figure it would be easier that I separate the two boards.

This is absolutely not related. The first way separates the two boards even better. Please describe what you mean with that sentence.