0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« on: October 30, 2012, 11:37:03 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5914
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #1 on: October 30, 2012, 12:15:30 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16426
Available for Design & Build services
|
 |
« Reply #2 on: October 30, 2012, 12:30:23 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« Reply #3 on: October 30, 2012, 01:04:48 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16426
Available for Design & Build services
|
 |
« Reply #4 on: October 30, 2012, 01:24:16 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« Reply #5 on: October 30, 2012, 01:27:40 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16426
Available for Design & Build services
|
 |
« Reply #6 on: October 30, 2012, 01:37:02 pm » |
Either voltage related (so 0's are seen as 1's and 1's as 0's), or datarate speed mismatch.
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5914
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #7 on: October 30, 2012, 02:07:17 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« Reply #8 on: December 07, 2012, 12:00:36 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5914
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #9 on: December 07, 2012, 12:08:19 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 86
Posts: 9355
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #10 on: December 07, 2012, 01:49:02 pm » |
do you have a link to the datasheet of the barcode reader?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« Reply #11 on: December 10, 2012, 09:58:53 pm » |
Hi, the specs for the scanner are here https://docs.google.com/open?id=1UATrfNBpafU1nfoPEwpVw5Oky_B7SpJIgnsRFYZIqQmgxZASBI61l2Mp2M4II 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.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 86
Posts: 9355
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #12 on: December 11, 2012, 02:41:17 pm » |
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)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 18
Arduino rocks
|
 |
« Reply #13 on: December 11, 2012, 03:13:49 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 86
Posts: 9355
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #14 on: December 11, 2012, 03:30:00 pm » |
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 !
|
|
|
|
|
Logged
|
|
|
|
|
|