Go Down

Topic: Several Serial Devices (Read 2301 times) previous topic - next topic

yamandu

Hi,

I have an Arduino Duemilanove in my project and I need to comunicate serial with 3 devices:
-LCD 16x2
-Xbee
-Barcode scanner

The barcode scanner is the only not working
It has a serial cable and a RS232 interface built in, is not a handheld, its kinda OEM.

I could read it sometimes but no more.
Now it looks like a power supply issue.
I was able to feed it with another power supply so it can scan normaly.
But now when I try to read from it using software serial arduino just freezes.
I am using pin 9 and 13 for the scanner.

liudr

Try reading some more from that scanner you will smoke your arduino. RS232 runs on +- 12V and Arduino serial runs on 0 +5V so you should have something in between to shift the voltage levels.

CrossRoads

You should use an RS232/TTL adapter like this
http://www.nkcelectronics.com/rs232-to-ttl-converter-board-33v232335.html
or
http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.html
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

yamandu

Thank you all for quick replying!

I think will not smoke the Arduino because the specification of the scanner states the power is 5v.

I had better success reading using RX and TX pins and using the real Serial.

Will I still need the converter?

But I get weird data!
I dont know the relation to the printed barcode it reads, any clue?
Is it because I dont have that converter?

CrossRoads

Measure the Rx & Tx lines out of the scanner when it is not sending - are they resting something besides 0 or 5V? Like + 10, +12V, maybe -10 or -12?
Then they are using RS232 levels and you will need the adapter, or make one up.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

yamandu

Ok, Im gonna do this. Thanks!

And how about the strange chars I got, is it related to voltage too?
Or I may need to do some kind of conversion in the software?

CrossRoads

Either voltage related (so 0's are seen as 1's and 1's as 0's),
or datarate speed mismatch.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

liudr


Either voltage related (so 0's are seen as 1's and 1's as 0's),
or datarate speed mismatch.


Could also be inverted polarity besides all those.

yamandu

After several test and trials and some discussion with the hardware supplier I could not make it work yet.

In the last email from the supplier he asked me the following:
Please let me know if your Arduino accepts only RS232 TTL level data or not?
If that's the case, then we have to provide you the pinout/p assignment of the CD-620-R to you because our CD-620-R provides signal data as RS232 level, that may cause misread of code.

I am insecure to answer this.
Anyone knows this, please?

liudr


After several test and trials and some discussion with the hardware supplier I could not make it work yet.

In the last email from the supplier he asked me the following:
Please let me know if your Arduino accepts only RS232 TTL level data or not?
If that's the case, then we have to provide you the pinout/p assignment of the CD-620-R to you because our CD-620-R provides signal data as RS232 level, that may cause misread of code.

I am insecure to answer this.
Anyone knows this, please?


You may reply arduino accepts TTL UART signals, 5V and 0V. It doesn't accept RS232 +-12V. You probably damaged either the scanner or arduino when you try to connect 0-5V arduino with +-12V scanner.

robtillaart


do you have a link to the datasheet of the barcode reader?

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

yamandu

Hi,

the specs for the scanner are here
https://docs.google.com/open?id=1UATrfNBpafU1nfoPEwpVw5Oky_B7SpJIgnsRFYZIqQmgxZASBI61l2Mp2M4I

I have replied the manufacturer and will wait...

Interestingly I am reading a EAN13 barcode with this number 7896672201424
but in arduino I read this values: 100,76,204,102,38,102,102,230,166,230,102,230,166,0

Looks like nothing was damaged. But is kind of a decoding problem.

robtillaart

The number of digits seems correct (assuming the 0 is an indicator for END OF CODE)
but the numbers do not make sense at all (at least for me), looking at them binary does not help either.

Can you post the barcode itself - image or description -
sw = small white
ww = wide white
sb = small black
wb = wide black

maybe the bitstream encodes the raw barcode before ascii conversion... (datasheet gives no clue)





Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

yamandu

robtillaart, I am thinking the same way, but have no results on decrypting this thing yet.

The barcode scanned is attached here.

I have read about the EAN 13 encoding but hadnt helped.

This thing is such a puzzle.

robtillaart

have you read wikipedia - http://en.wikipedia.org/wiki/European_Article_Number - might help to decode it

if this is teh code there might be 3 different codes used simultaneously !
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up