RS485 Sensor Node V1.0

  • Brand: DF Robot
  • Product Code: DFR0233
  • Stock

    Warehouse Stock Status Location
    Centurion In Stock UL128
    Stellenbosch New Product Arriving Soon
  • R410.00 (price excl. VAT)


RS485 Sensor Node V1.0

This RS485 Sensor Node module can be used in various applications such as intelligent agriculture, environment monitoring, home automation...etc. It is a Internet of things device. This RS485 Sensor node provides 6 channel analog input and 1 SHT1x Humidity & Temperature digital input. The RS485 protocol supports up to 254 nodes at 1200m distance between each node. This allows a wide range cover for monitoring the environment. A screw free design allows easy connection of cables without sacrificing reliability & stability.

RS485 standard is used effectively over long distances and in electrically noisy environments. Multiple receivers may be connected to such a network in a linear, multi-drop configuration. These characteristics make such networks useful in industrial environments and similar applications. RS485 enables the configuration of inexpensive local networks and multidrop communications links. It offers data transmission speeds of 35 Mbit/s up to 10 m and 100 kbit/s at 1200 m.

Quick Spec

  • MCU: Atmega8
  • Input Voltage: 12V
  • Baud Rate: 9600
  • Available Slave Address: 0x01 - 0x7F
  • Multiple Connections(up to 127 modules
  • 1 SHT1x Humidity and Temperature Sensor interface
  • 6 channel analog sensor interface
  • 8 small switches for setting slave address directly
  • Humidity: 0-100% RH(±4.5%RH)
  • Temperature:-40 ~ +128.8℃(±0.5℃)
  • Size: 82 x 50mm

Pinout

DFR0233pinout

Wiring Diagram

DFR0233-Dia

Sample Code



/*
# The Sample code for test the data of Analogue_Test and SHT1X Module

 # Editor : Lisper
 # Date   : 2013.12.9
 # Ver    : 1.3
 # Product: Analogue_Test and SHT1X Module
 # SKU    : DFR0233

 # Description:
 # Read the Analog value and the data of humidity & temperature

 # Hardwares:
 1. Arduino UNO
 2. IO Expansion Shield V5
 3. Analogue_Test and SHT1X Module

 # Interface: RS485
 # Note: Connect the Analogue_Test and SHT1X Module with IO Expansion Shield V5 through RS485
 Set the address of the module in manual,range from 0x02 to 0x7F,take effect after 30 seconds
*/

#define uint    unsigned  int
#define uchar   unsigned  char
#define ulong   unsigned  long
#define addr  0x02     //set address of the device for 0x02
uchar cmd[50];
uchar receive_ACK[100];
int EN = 2;

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#define printByte(args) Serial.write(args)
#define printlnByte(args)  Serial.write(args),Serial.println()
#else
#include "WProgram.h"
#define printByte(args) Serial.print(args,BYTE)
#define printlnByte(args)  Serial.println(args,BYTE)
#endif

void setup() {
  Serial.begin(9600);
  pinMode(2, OUTPUT); // TTL -> RS485 chip driver pin
}

void loop() {
  static ulong timepoint = 0;
  if (millis() - timepoint > 1000) {
    read_command();
    timepoint = millis();
  }
  if (Serial.available() > 0) data_return();

  //  delay(1000);

}

/************************Send command to Analogue_Test and SHT1X Module*************************/
void read_command()
{
  int i;
  char sum_cmd = 0;
  digitalWrite(EN, HIGH); // Turn the drvier pin to HIGH -> Turn on code transmitting mode for the RS485 interface
  // Turn the driver pin to LOW  -> Turn on reading mode for the RS485 interface
  delay(10);
  cmd[0] = 0x55;
  cmd[1] = 0xaa;
  cmd[2] = addr;
  cmd[3] = 0x00;
  cmd[4] = 0x21;
  for (i = 0; i < 5; i++) {
    sum_cmd += cmd[i];
  }
  cmd[5] = sum_cmd;

  for (i = 0; i < 6; i++) {

    printByte(cmd[i]);// command send to device
#if defined(ARDUINO) && ARDUINO >= 100
    Serial.flush();// complete the transmission of outgoing serial data
#endif
    delay(10);
  }
  digitalWrite(EN, LOW);
}
/************Feedback data of the Analog value and humidity & temperature ************/\



void data_return()
{
  digitalWrite(EN, LOW); // Turn the driver pin to LOW  -> Turn on reading mode for the RS485 interface
  delay(10);
  int i = 0;

  unsigned long timer = millis();

  while (true) {
    if (Serial.available()) {
      receive_ACK[i] = Serial.read();
      i++;
    }
    if (millis() - timer > 100) {
      break;
      Serial.println("Finish reading!");
    }
  }
  print_data () ;


  /*************************************************************************/
  // Display the original data

  //        for(int j = 0; j < 26; j++){
  //                Serial.print(receive_ACK[j],HEX); // return command
  //                Serial.print(" ");
  //        }
  //        Serial.println(" ");
}

void show_0x21_command(void)
{
  sht1x_data();
  Analog_test_data();

}

/************Deal with datas from Sht1x humidity & temperature sensor************/

void sht1x_data()
{
  uint humidity;
  uint temperature;
  humidity =  receive_ACK[7] * 256 + receive_ACK[8];
  temperature = receive_ACK[9] * 256 + receive_ACK[10];
  Serial.print("H:");
  Serial.print(humidity / 10, DEC);
  Serial.print("  ");
  Serial.print("T:");
  Serial.println(temperature / 10, DEC);
}

/********************Deal with datas from 6 Analog Sensors****************/
void Analog_test_data()
{
  char register_addr;
  uint  Analog_data;
  register_addr = 13;
  Serial.print("Analog Value:");
  for (int n = 1; n < 7; n++) {
    Analog_data = receive_ACK[register_addr] * 256 + receive_ACK[register_addr + 1];
    register_addr = register_addr + 2;
    Serial.print(Analog_data, DEC);
    Serial.print(" ");
  }
  Serial.println(" ");
  delay(1000);
}

/*************************** by lisper *********************************/
//print humidity and temperature
void print_data () {
  if (checksum ()) {        // if check sum is right
    Serial.println ();
    float humidity = read_uint8_t (receive_ACK, 7) / 10.0;
    Serial.print ("humidity=");
    Serial.println (humidity, 2);

    float temperature = (read_uint8_t (receive_ACK, 9) / 10.0);
    Serial.print ("temperature=");
    Serial.println (temperature, 2);
  }
  else {
    Serial.print ("\ncheck sum error! sum=");
    Serial.println (getsum_add (receive_ACK, 25), HEX);
  }
}

//if check sum is ok
boolean checksum () {
  uint8_t checksum = getsum_add (receive_ACK, 25);
  if (checksum == receive_ACK[25])
    return true;
  else
    return false;
}

//read 2 byte to uint16_t
uint16_t read_uint8_t (uint8_t *buffer, uint8_t sub) {        // Big-Endian, first byte is high byte
  return ((uint16_t)(buffer[sub]) << 8) + buffer[sub + 1];
}

//get check sum, add from 0 to length-1
uint8_t getsum_add (uint8_t *buffer, uint8_t length) {
  uint8_t sum;
  for (int i = sum = 0; i < length; i++) {
    sum += buffer[i];
  }
  return sum;
}
/*******************************************************************************/

Resources

Shipping List

  • 1 X RS485 Sensor Node V1.0


Related Products

RS485 Shield V3 - Raspberry Pi

RS485 Shield V3 - Raspberry Pi

RS485 Shield V3 - Raspberry Pi Our friends over at LinkSprite have made this nifty little RS485 Shield V3 for the Raspberry Pi, now you will be able to have a communication port for your field bus ..

R299.00

RS232 Shield for Arduino

RS232 Shield for Arduino

RS232 Shield for Arduino This RS232 shield is designed for the Arduino controller,and it can easily convert UART to RS232 interface. The shield integrates DB9 connectors (female) that provide connect..

R225.00

Gravity: Analog AC Current Sensor

Gravity: Analog AC Current Sensor

Gravity: Analog AC Current Sensor When you want to measure AC current it is impractical and hazardous to cut in to your live wiring. The analog AC current sensor developed by DFRobot is a good solu..

R370.00

Gravity: Digital 10A Relay Module

Gravity: Digital 10A Relay Module

Gravity: Digital 10A Relay Module Introducing the Gravity Digital Relay Module – the latest addition to DFRobot’s Gravity series! This module is a little different to the other relays in our store..

R98.00

RS485 4 Way HUB Repeater - Adam Format

RS485 4 Way HUB Repeater - Adam Format

RS485 4 Way HUB Repeater - Adam Format The HUB-485-4 is a rugged, industrial-grade, optically-isolated RS485 Hub / Splitter / Repeater, which can be used to expand RS-485 networks by splitting one ..

R498.00

Gravity Analog Water Pressure Sensor

Gravity Analog Water Pressure Sensor

Gravity Analog Water Pressure Sensor This is a water pressure sensor adopts DFRobot Gravity 3-pin interface. It supports standard 5V voltage input and 0.5~4.5V linear voltage output. It is compatible..

R295.00

RS485 Shield for Arduino

RS485 Shield for Arduino

RS485 Shield for Arduino This is an Arduino RS485 shield, especially designed for the Arduino controller board. It can easily convert the UART to the RS485. This shield integrates a standard RS485 po..

R135.00

Tags: rs485, sensor, node, rs485 node, rs485 sensor, analog, 6 way, 6 channel, rs 6 way, rs485 6 channel, sht1, sht, humidity, temp, humidity and temperature, temperature, temperature and humidity