Go Down

Topic: RS232 data stops when Ground is plugged in (Read 281 times) previous topic - next topic

Cabooska

I'm having difficulties reading volume sensor data from an ultrasonic device to my computer. My setup works sometimes, and seemingly stops working for no apparent reason. I plug in the TX wire into converter and Putty will display random/garbage data. Plugging the ground wire in will sometimes give me the exact data I need or will no longer display anything, random characters and all. When I remove the ground wire, the random data starts filtering in. I can't find the resources needed to explain what's going on here.

The Setup:

The cable is a RS232 USB to Serial converter, plugged into the PC. (http://www.shopqvs.com/store/p/3871.aspx)
The USB cable has a DB9/Seriali Gender Changer connected (http://www.shopqvs.com/store/p/2649.aspx)
My sensor has a working voltage of DC 9V~36V, Baud rate 9600, no parity bit, 8 data bits, 1 stop bit, no flow control.

I'm using a 12V adapter plugged into the Arduino, wires from Vin and GND to the sensor's wires.
The sensor's ground and TX are then plugged into the RS232 USB cable.


wvmarle

RS232 is not TTL. You need to convert your RS232 levels to TTL levels or risk killing your Arduino. Use a MAX232 chip or similar.

Also please post images inline, so we don't have to download them, like this:



Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Cabooska

Thank you for the response, but I don't believe it's what I'm looking for. I'm simply reading in data from the sensor to my PC using a RS232 to USB converter. The Arduino is only powering the sensor.

I'm trying to understand why, when plugging in the sensor's ground, does the input stop. I'm using PuTTY to read the serial data over COM.



In the image above, the white space and random characters fills in every second. The moment the ground is plugged in, it stops. Now sometimes, it will display the correct output from the sensor.

To  your comment, I've gone this route of using a RS232 to USB to determine where my problem is. I am using a MAX232 chip when I want to read from on the Arduino. But I run into the same problem. Once ground is plugged in, there is no output. On occasion, the output does come through but I'm at a loss for what could be causing this.

wvmarle

The Arduino is only powering the sensor.
Why do you use an Arduino as power supply? That's a bad idea already.

Anyway, a clear circuit diagram is required here.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Cabooska

Quote
Why do you use an Arduino as power supply? That's a bad idea already.
That may very well be my problem. I got the impression it was okay to use a 12V DC power supply, then the power provided to the sensor from Vin.

I'll get a clear circuit diagram posted tonight.

Thank you!

wvmarle

For small amounts of power you can get away with it but you're dropping 7V over that tiny regulator - which can dissipate maybe 500 mW - so about 70 mA would be the limit.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Cabooska

Here is the circuit diagram.



The sensor wires as seen from the bottom of the circuit. Blue and Green are intentionally left out.




The board is an Arduino 101 with the following tech specs:


My sensor's tech specs says:
"Input voltage is between DC 9V~36V. Sensor can be connected to the 12V or 24V car battary directly."

For small amounts of power you can get away with it but you're dropping 7V over that tiny regulator - which can dissipate maybe 500 mW - so about 70 mA would be the limit.
I'm confused by this as I've read that the Vin pin will output the same voltage supplied by the power jack. I recall reading the Vin bypasses the regulator? I'm probably wrong there. Using a multi-meter I get ~11V when measuring the Vin and Gnd pins. This should be enough to power the sensor.

"It should be noted. The Vin pin on the Power Pins I/O will copy the voltage input supplied through the power jack, and act as an output of that voltage. In this way, you effectively have a customisable output voltage pin on the Arduino which will replicate the input voltage of your power supply."

It seems like maybe the sensor might not be receiving enough power, but it doesn't explain why it sometimes works and sometimes doesn't.

Appreciate any more of your thoughts. Thank you.

wvmarle

Here is the circuit diagram.
That's a wiring diagram. Not a circuit diagram.

Why don't you connect the sensor to your 12V supply? The Arduino doesn't seem to do anything but sitting in the way.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Cabooska

Why don't you connect the sensor to your 12V supply? The Arduino doesn't seem to do anything but sitting in the way.
Two Questions:
Eventually, I'll need to power both the Arduino and the sensor using the power supply. Do you know of a power supply part/device that I can still plug into the Arduino and pull power from it for the sensor?

Can you recommend a power supply part that lets me hook the sensor wires to it directly? I only have wires coming from the sensor, and no adaptors.

Thank you!

wvmarle

#9
Sep 27, 2017, 07:06 pm Last Edit: Sep 27, 2017, 07:06 pm by wvmarle
Eventually, I'll need to power both the Arduino and the sensor using the power supply. Do you know of a power supply part/device that I can still plug into the Arduino and pull power from it for the sensor?
Your existing 12V adapter will do just fine for this. Just add a splitter cable in between or so - like this one:


Quote
Can you recommend a power supply part that lets me hook the sensor wires to it directly? I only have wires coming from the sensor, and no adaptors.
Then buy a few connectors and solder them to the wires. 12V normally uses 5.5x2.1mm connectors.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Cabooska


Go Up