The title of the post should show my complete lack of knowledge in this area, so please bare with me.
I have a "box" which when someone performs an action on it, a GPIO pin on a port on the back of the box is pulled low. At least that's what the instructions say (and that's about all they do say!). What I want to do is use an arduino to read the state of that GPIO pin using my arduino and then when it reads that the pin has gone low, I want the arduino to do something (lets say turn an LED on).
My question is, can I simply read the other device's GPIO pin state by connecting it to a digital pin on my arduino? if not, how should I go about it.
My question is, can I simply read the other device's GPIO pin state by connecting it to a digital pin on my arduino? if not, how should I go about it.
Yes, as long as the logic level of the device is compatible with the Arduino or can be level shifted to make it so, and that the devices have a common GND connection
Cool, thanks for that.
As I can't do anything with the other box, I have no way of knowing if the level is going to be the same, and as they are two separate boxes, I doubt that there is any way I can get the GND connections to be common.
Given the above, is there another (better / easier) way to do what I need to please??
First, go to wal-mart and spend $4 on a multi-meter if you don't have one. Next, take the black probe and locate ground inside the mystery box. making contact with ground and the black probe, set the meter to read volts DC. Next, take the red probe and place it on the output pin. Take a reading at high and a reading at low. If it is high close to 5 volts DC and low close to 0 volts DC, it is safe to use with Arduino. You will want to connect your ground pin of the Arduino to the ground of the mystery box also. Then connect the output pin to a digital pin of your Arduino. If the high on the mystery box is not close to 5 volts, but is lower than 5 volts, you can still read it using an analog pin. Assuming it is the right logic level (5 volts high. 0 volts low), you read it in code as follows:
sealeyr:
Cool, thanks for that.
As I can't do anything with the other box, I have no way of knowing if the level is going to be the same, and as they are two separate boxes, I doubt that there is any way I can get the GND connections to be common.
Given the above, is there another (better / easier) way to do what I need to please??
Thanks
Rob.
If you can't tie grounds together, you can't interface the two at all. An opto-coupler or similar will allow you to isolate one ground from the other, but you still need to tie the opto to ground on the mystery box.
sealeyr:
As I can't do anything with the other box, I have no way of knowing if the level is going to be the same, and as they are two separate boxes, I doubt that there is any way I can get the GND connections to be common.
You can physically connect to the other box's GPIO pins but not its ground connection? Is that right?
Thaks for all your responses on this. I'm really overwhelmed - I didn't expect more than maybe one or two responses.
First of all, the box is currently in a remote location so I need to make a physical visit to the place, but as soon as I can get there, I'm going to get a multimeter and check the level off the box.
The box is a no name device that someone built that interfaces with an audio mixing desk in a studio, and when the mixing desk goes "live" is when it pulls the gpio pin low, and it's then that I need my arduino to do its thing.
I should be able to give it a try in the next few days, so I'll post my findings then.