|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Wiring Maxbotix ultrasonic sensor to serial on cRIO?
My team is planning to add a ultrasonic sensor at the pits (MB 1013 http://www.maxbotix.com/Ultrasonic_Sensors/MB1013.htm ) to our bot using the serial port on the cRIO to aim our launcher.
What is the best way to wire it (even through another port), and how would we go about coding it? Thanks all for the help to a very inexperienced team |
|
#2
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
Are you programming in LabView?
If so go to the opening splash screen, select Support, Find FRC Examples, go down to sensors folder and open it, find EZ-1 MB1010 Sonar - Analog.lvproj. and start it. The example shows how its done. Whoops, I just re-read your post where you say you plan to use the serial port. Sorry, that's gonna be trickier. Last edited by BitTwiddler : 20-02-2014 at 19:37. |
|
#3
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
we are also programming in C++
|
|
#4
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
We are doing the same thing. The serial port on the Maxbotix sensor (at least our model) is not real RS-232. It is an inverted TTL serial port. We had to make a circuit to invert the signals then pass it through a TTL-RS232 converter to get it to work.
Good luck! |
|
#5
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
you could run the TTL signals to and from the DIO ports but then you'd need a driver to extract out the serial data. Not sure if there's a library API that does that.
|
|
#6
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
We are using the same sensor on our robot. I wired it so it would give an Analog voltage(white wire on a PWM to pin 3) and plugged it into the analog module on the cRIO. In the code, I did:
Code:
AnalogChannel *UltrasonicSensor; UltrasonicSensor = new AnalogChannel(1); float Distance = UltrasonicSensor->GetVoltage(); Heres the datasheet for the sensor. Read the pin out section of the sensor and wire accordingly. http://www.maxbotix.com/documents/HR..._Datasheet.pdf |
|
#7
|
||||
|
||||
|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
Look at the attached pics. One will show you what to wire to the rangefinder. The other pic is from team 358 website. It shows you the Analog Input Module (NI 9201) and the Analog Breakout. You should plug the pwm cable from the ultrasonic rangefinder to any of ports 1-7 on the analog breakout.
My team is programming in LabVIEW, so I can't help you with code, sorry. Hope this helps. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|