Most programing language will get you to that point providing that they have the adequate software frameworks to access external devices through USB, RS232, Ethernet, etc.
You can probably do that with Java, but you can also do that in Python and C/C++.
Essentially it all boils down to personal preference, community support and framework support that suppose to make your life easier and allow you to focus on the stuff you really want to do instead of the glue code that makes it work.
In regards to operating system, while Android is based on Linux it is mostly intended for devices such as PDAs and Mobile phones/smartphones. It might suite you but it also includes a lot of things that you don't really need.
I think that starting on any Linux distribution and continuing from there on is a good place to start.