|
Re: Using an Arduino w/ a RoboRIO
gvbravo makes a good point about the roboRIO being a 3V3 device that expects a maximum voltage of 3.3 volts to be applied to a DIO or digital I/O pin. In my article above using the Arduino with a Maxbotix sonar, I mentioned that you would connect the Arduino output to the cRIO digital input - ok, no problem or to a roboRIO digital input - NOT ok. Do not directly connect an Arduino output to a roboRIO input.
The Arduino is a 5v device so a digitial output will be close to 5v and may destroy the roboRIO input. As mentioned, you can purchase a level shifter that converts the 5v and 3.3v levels. An alternative that works in this case is to use a voltage divider between the Arduino output pin and the roboRIO input pin. A web search will turn up many examples of this circuit. I used a 100 and 200 ohm resistor in series that divided the 5v by 2/3 = 3.3v. Calculated: 5v x (200/100+200) = 3.3v.
Also mentioned above is to connect the Arduino to the roboRIO using I2C. In my example above, this would be overkill because I only wanted to tell the robot controller that the Arduino/Maxbotix "says" the 8 ft distance has been confirmed. However, I2C is an effective solution especially when your Arduino has a lot of data to send and receive from the roboRIO.
Again, take care connecting devices to the roboRIO.
-Larry
|