Forum >Arduino IO Expansion V5 RS485 Problem
Arduino IO Expansion V5 RS485 Problem

Hello!
I bought the Arduino IO Expansion V5 shield and test it.
The device does not accept RS485 signals. It successfully sends data but does not accept them.
I measured the voltage between the following contact of SP485 chip (see attached image):
- Vcc <-> GND = 5.14V
- DI <-> GND = 5.14V
- A <-> B = 1.8-2.5V (changes when receiving data)
- DE <-> GND = 0V
- RE <-> GND = 0V
- RO <-> GND = 0V
RO pin is zero and Serial.read() is nothing too!
Why i can not get data by rs485?
Thank you very much!
Best regards,
Alexander
P.S. Datasheet of SP485: [url=http://www.datasheetcatalog.org/datasheet/sipex/SP481CN.pdf]http://www.datasheetcatalog.org/datasheet/sipex/SP481CN.pdf[/url]
[img]
[img]
I bought the Arduino IO Expansion V5 shield and test it.
The device does not accept RS485 signals. It successfully sends data but does not accept them.
I measured the voltage between the following contact of SP485 chip (see attached image):
- Vcc <-> GND = 5.14V
- DI <-> GND = 5.14V
- A <-> B = 1.8-2.5V (changes when receiving data)
- DE <-> GND = 0V
- RE <-> GND = 0V
- RO <-> GND = 0V
RO pin is zero and Serial.read() is nothing too!
Why i can not get data by rs485?
Thank you very much!
Best regards,
Alexander
P.S. Datasheet of SP485: [url=http://www.datasheetcatalog.org/datasheet/sipex/SP481CN.pdf]http://www.datasheetcatalog.org/datasheet/sipex/SP481CN.pdf[/url]
[img]
[img]
2012-03-29 15:55:55 Dear pyaterok:
I am afraid that you bought a fake dfrobot IO expansion shield. All our boards are in black and with DFRobot logo on it. We are not sure whether your board is compatible with ours or not.
R2D2C3PO
I am afraid that you bought a fake dfrobot IO expansion shield. All our boards are in black and with DFRobot logo on it. We are not sure whether your board is compatible with ours or not.

2012-03-29 08:46:38 [quote="Lauren"]
Could you please post your sketch? I'll try to find some problems.
And which version of the Arduino ide are you using?
[/quote]
My Arduino IDE version is 1.0. I use Arduino Uno.
Sketch code:
[code]
int ledPin = 13;
int EN = 2;
int val;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(EN, OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(EN, LOW);
val = Serial.read();
if (Serial.available() > 0 || val != -1) {
digitalWrite(ledPin, HIGH);
delay(1000);
}else{
digitalWrite(ledPin, LOW);
delay(1000);
}
}
[/code]
but the LED is off
pyaterok
Could you please post your sketch? I'll try to find some problems.
And which version of the Arduino ide are you using?
[/quote]
My Arduino IDE version is 1.0. I use Arduino Uno.
Sketch code:
[code]
int ledPin = 13;
int EN = 2;
int val;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(EN, OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(EN, LOW);
val = Serial.read();
if (Serial.available() > 0 || val != -1) {
digitalWrite(ledPin, HIGH);
delay(1000);
}else{
digitalWrite(ledPin, LOW);
delay(1000);
}
}
[/code]
but the LED is off

2012-03-29 08:37:21 [quote="Hector"]
Hi Alexander,
Just to make sure, have you switched the 3 jumpers on the side to 485?
[/quote]
Hi Hector,
Yes, 3 jumpers are switched to 485 side. Thanks!
pyaterok
Hi Alexander,
Just to make sure, have you switched the 3 jumpers on the side to 485?
[/quote]
Hi Hector,
Yes, 3 jumpers are switched to 485 side. Thanks!

2012-03-28 19:30:46 Could you please post your sketch? I'll try to find some problems.
And which version of the Arduino ide are you using?
Lauren
And which version of the Arduino ide are you using?

2012-03-28 18:21:08 Hi Alexander,
Just to make sure, have you switched the 3 jumpers on the side to 485?
Hector
Just to make sure, have you switched the 3 jumpers on the side to 485?

2012-03-28 12:48:09 [quote="Lauren"]
Hello, Alexander
Have you try to use the EN pin to switch the 485 chip between the receiving and the transmitting mode?
There's a driver pin on the SP485 connected to the D2 ( Digital pin 2 on the Arduino ). When you turn it to HIGH, the SP485 will go into the transmitting mode. When finish the command transmitting, you could set the D2 pin to LOW level to open the receiving mode.
We have a URM04 ultrasonic module driven with the Arduino and IO Expansion v5 via the RS485 interface, and we also supply the sketch for it as a rs485 sample. So you could also take a look at the sample. Maybe it's useful.
Here's the link: [url=https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)]https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)[/url]
Hope it's helpful. ;)
Regards
Lauren
[/quote]
Yes, I use in my sketch folowing lines:
int EN = 2;
pinMode(EN, OUTPUT);
digitalWrite(EN, LOW);
and voltage betweeen RE and GND = 0V which means that 2 pin is set to LOW.
Do you have any other ideas about why the data receiving is not working?
Thank you very much!
pyaterok
Hello, Alexander
Have you try to use the EN pin to switch the 485 chip between the receiving and the transmitting mode?
There's a driver pin on the SP485 connected to the D2 ( Digital pin 2 on the Arduino ). When you turn it to HIGH, the SP485 will go into the transmitting mode. When finish the command transmitting, you could set the D2 pin to LOW level to open the receiving mode.
We have a URM04 ultrasonic module driven with the Arduino and IO Expansion v5 via the RS485 interface, and we also supply the sketch for it as a rs485 sample. So you could also take a look at the sample. Maybe it's useful.
Here's the link: [url=https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)]https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)[/url]
Hope it's helpful. ;)
Regards
Lauren
[/quote]
Yes, I use in my sketch folowing lines:
int EN = 2;
pinMode(EN, OUTPUT);
digitalWrite(EN, LOW);
and voltage betweeen RE and GND = 0V which means that 2 pin is set to LOW.
Do you have any other ideas about why the data receiving is not working?
Thank you very much!

2012-03-27 19:22:43 Hello, Alexander
Have you try to use the EN pin to switch the 485 chip between the receiving and the transmitting mode?
There's a driver pin on the SP485 connected to the D2 ( Digital pin 2 on the Arduino ). When you turn it to HIGH, the SP485 will go into the transmitting mode. When finish the command transmitting, you could set the D2 pin to LOW level to open the receiving mode.
We have a URM04 ultrasonic module driven with the Arduino and IO Expansion v5 via the RS485 interface, and we also supply the sketch for it as a rs485 sample. So you could also take a look at the sample. Maybe it's useful.
Here's the link: [url=https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)]https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)[/url]
Hope it's helpful. ;)
Regards
Lauren
Lauren
Have you try to use the EN pin to switch the 485 chip between the receiving and the transmitting mode?
There's a driver pin on the SP485 connected to the D2 ( Digital pin 2 on the Arduino ). When you turn it to HIGH, the SP485 will go into the transmitting mode. When finish the command transmitting, you could set the D2 pin to LOW level to open the receiving mode.
We have a URM04 ultrasonic module driven with the Arduino and IO Expansion v5 via the RS485 interface, and we also supply the sketch for it as a rs485 sample. So you could also take a look at the sample. Maybe it's useful.
Here's the link: [url=https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)]https://www.dfrobot.com/wiki/index.php?title=URM04_V2.0_(SKU:SEN0002)[/url]
Hope it's helpful. ;)
Regards
Lauren
