Changing the RS485 Wind Sensor Address (SEN0483 or SEN0482)

by FuzzyPotato in Circuits > Computers

1411 Views, 6 Favorites, 0 Comments

Changing the RS485 Wind Sensor Address (SEN0483 or SEN0482)

text2photo-f58c3c82a1a81f556bb3cc1831f186e5.jpeg
PXL_20230212_003709104.jpg
PXL_20230212_004630374.jpg
arduino.jpg

When we purchase the wind speed sensor (SEN0483) or wind direction sensor (SEN0482) they have the same address. This means that we can not use them together unless we change the address on one of the sensors.


Supplies

  • RS485 wind speed sensor (SEN0483) or wind direction sensor (SEN0482)
  • Arduino board
  • UART to RS485 shield. I like this one (DFR0259)
  • USB cable

Wiring

PXL_20230212_003759526_exported_666_1676162648849.jpg
FMYNJVTLGXYIAYP.jpg
  1. Connect the RS485 to UART converter to the Arduino board.
  2. Connect the RS485 wind speed sensor to the RS485 to UART converter.
  3. Green wire to B-
  4. Yellow wire to A+
  5. Red wire to a 12v
  6. Black wire to ground
  7. Put the Arduino RS485 shield in “auto” mode. Auto mode takes care of some communication for us and makes our code simpler.

Code


This will change the address from 02 to 03


byte address_ref_frame[] = {0x00, 0x10, 0x10, 0x00, 0x00, 0x01, 0x02, 0x00, 0x03, 0xFA, 0x00};

byte buf[11];


void setup(){  

Serial.begin(9600);  

Serial.println("Serial started");


Serial.println("-----------------------------------------------");   

Serial.println("Send");  

delay(1000);  

Serial.write(address_ref_frame, sizeof(address_ref_frame));  

Serial.flush();  

Serial.readBytes(buf, 11);  

delay(1000);


Serial.println("Buffer");  

Serial.println(buf[0], HEX);  

Serial.println(buf[1], HEX);  

Serial.println(buf[2], HEX);  

Serial.println(buf[3], HEX);  

Serial.println(buf[4], HEX);  

Serial.println(buf[5], HEX);  

Serial.println(buf[6], HEX);  

Serial.println(buf[7], HEX);  

Serial.println(buf[8], HEX);  

Serial.println(buf[9], HEX);  

Serial.println(buf[10], HEX);  

Serial.println(buf[11], HEX);    

Serial.flush();

}


Testing

Serial Monitor.PNG
  1. Open the Arduino IDE and create a new sketch.
  2. Copy and paste the code provided into the sketch.
  3. Open the Serial Monitor in the Arduino IDE.
  4. Set the baud rate to 9600.
  5. Before uploading the code make sure to move the other switch to “off” and then back to “on” once the upload is complete. If you do not do this your Arduino and PC will not be able to communicate properly.
  6. Upload the code to the Arduino board.
  7. Observe the readings from the wind sensor displayed in the Serial Monitor: If the Slave response frame looks like this: 00 10 10 00 00 01 04 D8 (7byt), the modification is successful. After setting, you need to re-power on and restart the transmitter to make this address take effect.
  • Remember that after you change the address when you send a data request to the sensor you will need to use the new address.
  • New data request frame: 0x03, 0x03, 0x00, 0x00, 0x00, 0x01, 0x85, 0xE8

Conclusion

Celebrate-free-celebration-clip-art-pictures-2.jpg

Now we have a sensor that is of a different address. This means that we can use the wind speed sensor and wind direction sensor in parallel.

Take a look at m other tutorials on how to read the sensor readings.


Happy tinkering!