Rs232 communication problem with LRF and adaptor USB to 232 REV B Parallax
I have been working on a project to analyse body weight of a pig with 3 LRF. The project consist of creating a sass where the pig will walk inside it and 2 LRF will get the distance from left and right side of the pig inside the sass to get the width of the animal, the height will be taken from a top installed LRF. the 3 LRF are installed on servo-motor. the right and left LRF will be aligned to read the croup of the pig and to align the top LRF at the center of the pig for the height reading. Ha Ha! i already ear you asking how im gonna get the lenght of the pig? Well well well, with speed and time! with two fixed triggering pointing laser that the pig will break when it will pass in the entry. Before the pig pass between the fixed laser a LV-MaxSonar EZ3 high performance ultrasonic range finder will get the speed of the pig and the basic stamp will analyse the time the pig will pass over the two fixed laser , got it!. this is the project in brief.
My problem is that I try to communicate with a usb to 232 adaptor and the soft LRF ImageViewer to have a picture of the pig at the exit of the sass with an other LRF but i always have a time out error after a few second, sometime i see random ascii characteres passing in the terminal console, I tried with a internal PCI 485 Serial card with no success either and yes I had drop resistor the signal level . The usb to 232 adaptor Rev B is from Parallax. I connected the 232 RX to the JP1 Sout of the adaptor and the TX to the Sin. I think the communication signal of the adaptor is TTL level so I dont need resistor to drop the voltage level. The circuitry is on a Breadboard and wonder if it is only the problem because, with experience, i know breadboard can give bad contact or parasite to electronic signal.
If my setup is ok i gonna produce a nice little PCB to get a free error circuitry
after a day of debugging I'm out of imagination!
many thanks
My problem is that I try to communicate with a usb to 232 adaptor and the soft LRF ImageViewer to have a picture of the pig at the exit of the sass with an other LRF but i always have a time out error after a few second, sometime i see random ascii characteres passing in the terminal console, I tried with a internal PCI 485 Serial card with no success either and yes I had drop resistor the signal level . The usb to 232 adaptor Rev B is from Parallax. I connected the 232 RX to the JP1 Sout of the adaptor and the TX to the Sin. I think the communication signal of the adaptor is TTL level so I dont need resistor to drop the voltage level. The circuitry is on a Breadboard and wonder if it is only the problem because, with experience, i know breadboard can give bad contact or parasite to electronic signal.
If my setup is ok i gonna produce a nice little PCB to get a free error circuitry
after a day of debugging I'm out of imagination!
many thanks
Comments
Use a USB to 5V TTL adapter like Parallax's USB2SER.
The USB to RS232 adapter outputs a negative voltage (typically -7V) for a logic low voltage and a relatively high positive voltage (typically +7V) for a logic high voltage. Both are very destructive to standard 5V logic inputs (like Sin).
With a question like yours, you really need to post a schematic showing all the connections. It's very difficult to offer advice without more information.
well about the main schematic of the project, I already produce the PCB for the main circuitry and it works well , i had only the problem with the usb interface to communicate with the LRF.
But if you think it is a good idea to publish thoses schematic then here we go...
The main PCB is not exactly has the schematic since it is only a prototype for now, all inputs voltage capacitors will probably be replace with .33Uf ceramic, CDS Triggers have been change with LDR. The PCB for the LRF use for the image at the exit of the Sass is not made yet since I have problems with the breadbord setup.
this is the physical prototype on a sketch design
I'm not sure if you can see clearly the picture ?
many thanks again
bye
Lets resume!
all the stuff that you see is for gattering the body weight of the pig. At the exit of the sass an other fixed LRF that is not installed on the sass but installed about 5 feet apart in front of the exit of the sass will take a side picture of the pig that fit the referenced weight for record. Since the pig have a painting number on then, the farmer with that record(the picture) later on will get those pigs by number that fit the right weight. The LRF that take the picture will be triggered by human with the Image viewer on a autonomous portable computer via the USB2SER adapter.
you answered to my question a few threads ago ,well exactly your first one LOL
and i ordered the adapter this morning.
Sorry for the trouble and many thanks again
bye
In post #1 you mention an USB to 232 adaptor while in post #5 you refer to an USB2SER adapter. Which is it?
Is the serial connection to the LRF shared with anything else? I've read about problems when serial lines are shared that it possible to accidentally change baud settings in one device as the PC communicates with a second device connected to the same line.
(BTW, Imagination is the key to an efficient prototype!)
I will connect the rx and tx of the USB2SER adapter to the Sout ans Sin of the LRF.
I think I dont need the rst pin!
I have french background!
Sorry to dredge up an old topic, but I was having a similar problem. I just ordered my LRF and got it today. I spoke with Chris on the phone on Friday about it before placing my order, and he recommended the 4D Systems USB Programming Adapter, which I believe is using RS-232 communication. So far, it works fine with the serial terminal. It's out putting numbers with no issue, but I had the same timeout issue when I tried to use the LRF Image Viewer.
Based on what I'm reading here, it sounds like I may damage my LRF if I continue using the 4D adapter? Should I now be replacing my 4D with a USB2SER? I will be ordering another 2-3 LRF's, so I want to get it right.
Thanks for the help!
4D Systems USB Programming Adapter:
http://parallax.com/product/28072
I basically said the same thing as Chris but I took longer to say it. We both link to the same Wikipedia page.
The reason the adapter is safe is it's not an USB to RS-232. The minimum voltage swing for RS-232 is -3V to +3V (it can be as high as -15V to +15V) . The 4D Systems adapter is similar to the PropPlug's 0V to 3.3V output.
The 4D System adapter has lots of FTDI pins broken out so it can be a bit more useful than the PropPlug in some applications. It also has the 5V power output which is nice (though I agree it shouldn't be used to power the LRF).
Unless you need the extra features the 4D System's adapter provides, if you're going to purchase more adapters, you might want to think about some of the inexpensive USB to serial adapters on ebay (or the PropPlug).
Duane,
Why would you not recommend powering the LRF from the 4D Systems adapter? I suggested it as a possibility because the adapter powers the uOLED displays which can consume more current than the LRF.
Because I was remembering incorrectly. I thought someone who knows more about this suggested against it but now that I stop to think, I realize I'm mixing up this thread with some other (either here on the Parallax forum or on the Let's Make Robots forum). I stand (gratefully) corrected.
Edit: I just reviewed the thread and I couldn't find anyone warning against the use of USB power for the LRF. I had threads crossed in my mind. Maybe I should take up cross-stitching since I'm good at crossing threads?
That said, as I pointed out 4D Systems uses the USB Adapter (uUSB-PAS) to power the uOLED Displays when connected to the PC via this interface. So it should work.
I was a little surprised to find that the adapter only requests 90mA from the port (the default value). It is possible that a device drawing more current will do one of three things...A) it may work just fine, it may cause the USB Hub to report excessive current or C) the devcie may simply not get enough current with no indication why and not operate properly. I could use M_PROG right now to set the adapter to request 500 mA, but I am surprised 4D did not set it that way when the 3.2" uOLED draws 165 mA with a mostly black screen. As I recall if the entire screen were white it would be much higher.