I am making an automatic oil dispenser, so to make it work I need communication from weighing scale to arduino to read signal so that further I can make that project.
But right now I am trying to get serial data from RS232 to TTL converter, but it wont give me right data or can say I am getting garbage/random characters and values
But, when I connect RS232 to USB connection and receive data in serial monitor it is showing right data (Screenshot in attachment)
I just checked pin voltages, on RS232 side it is around minus 9 volt, and on arduino/TTL side there is some voltage showing up but less than 1 volt!
I am not sure it needs octal or something else, I used HyperTerminal with 9600 baudrate and also with arduino terminal result is like [+000.000 Kg] and like this in screenshot **PS- this result is with RS232 to USB cable **
Try:
Looping back the RS232 side then manually apply 0v or 5v (trough a 220 Ω) on the TX pin on the TTL side.
Monitor the TTL RX pin for 0v and 5v.
The RX pin should go from 0v to 5v.
Yes, I have tried without octal, same random numbers are obtained as output!!
What is looping back?
I applied 5v through a 220 ohm resistor on TX pin on TTL side but there is no 5v on TTL RX pin (around 500-600 mV), and current measured on RS232 side is on RXD pin around -9v, and when I connect RS232 to RS232 to TTL converter, some blinking starts taking place without any external voltage source (arduino etc), maybe my coverter is broken! Please do suggest what should I do now?
Loop back:
On the converter, make sure the Vcc and GND pins go to 5v and GND on the Arduino.
On the RS232 side, (DB09 connector) connect pin 2 to pin 3.
On the TTL side, TX pin through a 220 Ω (prevents accidentally damaging things) to 5v then to 0v.
On the TTL side, measure the voltage on RX (should go 5v then 0v).
Edit
You may have a bad pin on the Arduino.
Try different pins for mySerial.
larryd:
Loop back:
On the converter, make sure the Vcc and GND pins go to 5v and GND on the Arduino.
On the RS232 side, (DB09 connector) connect pin 2 to pin 3.
On the TTL side, TX pin through a 220 Ω (prevents accidentally damaging things) to 5v then to 0v.
On the TTL side, measure the voltage on RX (should go 5v then 0v).
Edit
You may have a bad pin on the Arduino.
Try different pins for mySerial.
I followed exactly of your steps, but there is no 5v or 0v on RX pin, whereas it is around 3v
I have tried almost all pins on my Arduino uno but nothing works!!
Because my weighing scale only delivers data but donot take any data back
PLEASE do help me out, I think my converter is not okay as when I measured voltage on RS232 connection by Ground and RXD pin is around -9v but when I measure on converter it shows only around -3v!!
PS - when I am measuring weight through RS232 to USB cable then weight shows in format like "+000.000 Kg", example - when I measured 395 gram object it shows like "+000.395 Kg" and so on.
Your help will be highly appreciated, My other hardware and code is ready and now I am stuck in this situation! Please do suggest any type of communication or circuit which I can use, I have MAX3232 in case my converter doesnot work
larryd:
“I followed exactly of your steps, but there is no 5v or 0v on RX pin, whereas it is around 3v”
Are you saying the TTL RX pin always stays at +3v when you follow the steps?
OR
Are you saying it does go from 3v to 0v when you follow the steps?
Are you connecting 5v or 3.3v to Vcc on the converter?
Do you have a NPN transistor?
I have connected TX to 5v arduino output through 220 ohm resistor and TTL GND to arduino GND and VCC to arduino 5v and measuring voltage through RX pin from TTL converter gives 5v, and also connecting RX to TX pin of RS232 connection.
But if in meanwhile I connect RX pin to arduino input pin 8 which is as specified in my code, nothing works, no data is received back everything blank
Yes I have BC547 NPN transistor.
I hope there is some other way I can read data from RS232 to arduino? Please do help me out!