ConnectingDiagram
RS485 Sensor Node V1.0 connecting diagram
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 tran
smitting mode for the RS485 interface
// Turn the driver pin to LOW -> Turn on reading mode for the RS485 interf
ace
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];
}

DFR0233

Mfr. #:
Manufacturer:
DFRobot
Description:
Development Boards & Kits - AVR RS485 Sensor Node V1.0
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet