My team wants to integrate a flex sensor into our driver station controls. We were thinking using an Arduino might work but we really don’t know how it would be done. Any help would be appreciated, in particular interfacing the information the Arduino would put out (flex sensor values) with the driver station.
You could just wire the flex sensor directly to the IO Board, and read the values from that, no need to interface between the Arduino and the cRIO.
From my experience, flex sensors are incredibly unreliable – not in the respect of reading, but more in interpretation of what a certain reading means.
The flex sensors have so many different ways to bend (providing ambiguity in what a certain reading actually means), that if you are going to try to use them for much more then binary calculations (Am I touching something?) it’s probably going to be difficult to get to work, if it does.
I would imagine that you’re not going to use flex sensors for wall following or the sort, but just something o keep in mind if you’ve never worked with them before.
I want to use the flex sensor as part of a controller, not on the robot.
I believe most flex sensors, if not all, act as variable resistors giving analog values. In this way, you’d wire the flex sensor into one of the analog inputs on the Arduino. The Arduino has an analog-to-digital converter on-board and you can program it to “write” those values through the USB port via serial interface. If for some reason you are unable to or don’t want to use the 0-1023 numerical values the Arduino reads from the analog ports, you can always map them to different values or really do whatever you want with them.
What exactly is a flex sensor, as in what purpose would it serve better than another sensor?
Flex sensor to Arduino is just an analog input. There may be some “Analog read” sample code, but if not, writing your own is not difficult. Arduino reference is very helpful, and the info on the analog read command can be found here:
http://arduino.cc/en/Reference/AnalogRead
If you give me some more information, I would be able to write the code for you. All the best,
-B
If any of you know instructables.com, I was looking through it one day and came across this:
http://www.instructables.com/id/Arduino-Wireless-Animatronic-Hand/
Now I know you can’t use the wireless part, but you may be able to use the concept.
Hope this helps.