Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Wiring Maxbotix ultrasonic sensor to serial on cRIO? (http://www.chiefdelphi.com/forums/showthread.php?t=126949)

CRITICALThinker 20-02-2014 19:24

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

BitTwiddler 20-02-2014 19:34

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.

CRITICALThinker 20-02-2014 19:48

Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
 
we are also programming in C++

RoboMo786 20-02-2014 19:55

Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
 
2 Attachment(s)
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. :)

wireties 20-02-2014 19:57

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!

BitTwiddler 20-02-2014 20:01

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.

mega900997 20-02-2014 20:11

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();

I don't remember the conversion from voltage to feet offhand but that can be figured out with a bit of testing.

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


All times are GMT -5. The time now is 10:25.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi