rotronics humidity and temperature ethernet node.

I am attempting a project to create an Ethernet node that will allow UDP communications to an allen bradly micrologix 1400 or a compactlogix l32e. On this node will be a temperature/humidity sensor made by rotronic the model is a hc2-s. I am having trouble with the first step of the project. I am trying to open 2 serial ports. 1 port is the pc monitor port, and the other is the data port from the rotronics sensor. I have pin 3 and 4 tied to pins 6 and 7 on the arduino UNO ethernet board. I am using the 5 volt and gnd to power the sensor. All i have gotten is a -1 (null) value. Any ideas of where I am going wrong would be helpful. I have always done higher lever programming with plc's and labview and systems like that, so I need more help on the communications part. I know that I am supposed to recieve more than what the serial function read will give me, but, i really just want to see something. I will move forward if I get some type of response from the serial port. I included the NewSoftSerial Library to do the comms for the sensor. The datasheets for the rotronic sensor is at the end. Thanks for your time guys.

Art

#include <NewSoftSerial.h>

NewSoftSerial mySerial(7,6);      // RX pin and TX pin setup
const int setupDoneLED =  8;       // the number of the LED pin
const int loopSignalLED =  9;      // the number of the LED pin
int setupLEDState = HIGH;           // initalize the state of the monitor leds
int loopLEDState = LOW;            // initalize the state of the monitor leds
long interval = 1000;              // update rate in milliseconds
long previousMillis = 0;

void setup()  
{
  Serial.begin(9600);     // set the data rate for the usb serial port monitor
  mySerial.begin(19200);  // set the data rate for the NewSoftSerial port for rotronic comms
  pinMode(setupDoneLED, OUTPUT); // set the digital pin as output:
  pinMode(loopSignalLED, OUTPUT); // set the digital pin as output:
  digitalWrite(loopSignalLED, loopLEDState);
  digitalWrite(setupDoneLED, setupLEDState);
}


void loop()                     // run over and over again
{
  unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > interval) // save the last time you blinked the LED
  { 
    mySerial.print("{F04RDD_^M");
    previousMillis = currentMillis;
    if (loopLEDState == LOW)
      {
        loopLEDState = HIGH;
      }
    else
      {
        loopLEDState = LOW;
      }
     
     digitalWrite(loopSignalLED, loopLEDState);
     
     //if (mySerial.available()) 
      //{
        
        Serial.println(mySerial.read());
        //Serial.print("TEST");
      //}
  }
}

http://www.rotronic-humidity.com/_upload/gen_downloads/Comm-protocols.zip

I modified the code slightly. I was wondering if there is a way to verify what the settings for the data send/receive are. I need to have 8n1.

#include <NewSoftSerial.h>

NewSoftSerial mySerial(6,7);      // RX pin and TX pin setup
const int setupDoneLED =  8;       // the number of the LED pin
const int loopSignalLED =  9;      // the number of the LED pin
int setupLEDState = HIGH;           // initalize the state of the monitor leds
int loopLEDState = LOW;            // initalize the state of the monitor leds
long interval = 1000;              // update rate in milliseconds
long previousMillis = 0;
const char initString[] = "{F04RDD_^M";

void setup()  
{
  Serial.begin(9600);     // set the data rate for the usb serial port monitor
  mySerial.begin(19200);  // set the data rate for the NewSoftSerial port for rotronic comms
  pinMode(setupDoneLED, OUTPUT); // set the digital pin as output:
  pinMode(loopSignalLED, OUTPUT); // set the digital pin as output:
  digitalWrite(loopSignalLED, loopLEDState);
  digitalWrite(setupDoneLED, setupLEDState);
}


void loop()                     // run over and over again
{
  unsigned long currentMillis = millis();
  char returnData[64] = "No data received";
  
  if(currentMillis - previousMillis > interval) // save the last time you blinked the LED
  { 
    mySerial.print(initString);
    previousMillis = currentMillis;
    if (loopLEDState == LOW)
      {
        loopLEDState = HIGH;
      }
    else
      {
        loopLEDState = LOW;
      }
     
     digitalWrite(loopSignalLED, loopLEDState);
     
     if (mySerial.available()) 
      {
         returnData[0] = mySerial.read();
      }
      
    Serial.println(returnData);
  }
}

I am trying to open 2 serial ports.

A UNO only has one hardware serial port. If you need multiple serial ports, one of them needs to be able to use/connected to a software serial port, using NewSoftSerial.

I have pin 3 and 4 tied to pins 6 and 7 on the arduino UNO ethernet board.

Why? The hardware serial port uses pins 0 and 1.

What is connected to pins 6 and 7?

did you read any of the code or any of my datasheet info?

I am already using newsoftserial.
I have connected the pins 3 and 4 of the sensor to 6 and 7 of the arduino.

Well I officially feel like I am in over my head. I spent some time in October trying to get my communications to and from the humidity sensor to work to no avail. I was tied up with other priorities for a while so I let it go for a while. Just today I thought I would tackle the other part of the issue which is the communications of the PLC too the node. So far I feel like unless I figure out how to create the protocol myself I am going to fail.

The design of this was to allow comms with both micrologix 1400 series and compact logix l32/l35 series plc/pac.
The problems I am having are that the standard the PLC I am using is called ethernet/IP (ip stands for Industrial Protocol not Internet protocol) and it used for CIP (common industrial protocol). From what I have looked into it is a UDP message but it is encapsulated in a different packet. I am attempting to use explicit messaging on port 44818 not the implicit messaging which takes place on port 2222.

I do not know if anyone here knows or is interested in what I want to do but there is more to it than just a stupid ethernet node. There are numerous ways this could become a useful tool. This could be an extremely low cost remote IO interface, an HMI, or an inexpensive serial/usb to ethernet/ip monitoring tool. I know a lot of these things are possible with arduino to arduino comms however, they can really shine in an industrial environment. I colleague of mine just set up an ethernet enabled compact logix plc we got from a scrapped unit in his home for HVAC, pool-hot tub temp control and security control. I plan on doing the same but also want to add an ethernet node to my generator to monitor and control functionality via my plc and the touchscreen in the living room.

Regardless I am going to move forward but if anyone has any ideas that my help me to create a new library for this protocol I would appreciate the help.

art

http://www.odva.org/Home/ODVATECHNOLOGIES/EtherNetIP/EtherNetIPLibrary/tabid/76/lng/en-US/language/en-US/Default.aspx

http://www.odva.org/Home/CIPNETWORKSPECIFICATIONS/Order/Software/tabid/134/lng/en-US/language/en-US/Default.aspx

there is development software for free here if you register, which is also free.

Hi Arthur!
Wow - BIG project. I'm also very interested in integrating the Arduino platform into an industrial environment, but the best I've managed so far is a simple opto-isolated shield for a few 24Vdc I/O channels. It makes a handy commissioning tool, but that's about it.
Any luck so far with your Common Industrial Protocol project?

Back to it 8 months later after many delays, no luck so far though.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271505778

I am going to try a new direction. I did a little digging and this seems like a more easily approachable way of doing things. At least for someone with limited intelligence like me.

Well finally had a little time today at work. I was able to complete a project in logix500 for a micrologix1400 platform. The project is configured for the arduino using the modbusmq library. The PLC reads and writes the slave arduino perfectly. I am attaching the zip file of the project. I will be moving to the next phase now. I need to grab the data from the rotronic sensor and push it to the holding registers.

Modbus.rar (51.3 KB)

I am setting up the communications to the sensor via i2c. the sensor will only send data streaming in this mode. The sensor will start streaming and continue non-stop. I tried a few different setups but am not getting anywhere with the wire library. Any suggestions would be helpful.

attached section of airchip 3000 comms via i2c.

3512_001.pdf (107 KB)

Hello, sorry if I'm being redundant, but you succeeded to send data to the PLC using this library via EtherNet/IP protocol?

ortizvinicius:
Hello, sorry if I'm being redundant, but you succeeded to send data to the PLC using this library via EtherNet/IP protocol?

I also need the solution to this, if anyone can help .. :frowning: