Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

RS485


  • Please log in to reply
7 replies to this topic

#1 JamesSir

JamesSir

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 November 2011 - 05:04 PM

I'd like to connect my Netduino to our solar panel inverters. The two inverters have an RS485 connection to log information to a $600 monitor. I'd like to do it for less.

My thought was to use the Netduino with a SD card, write the logs to the card, and occassionally pick the card up and copy the data to my PC. The inverters are 200m away from my house, so wiring would be impractical.

There is some great documentation on the inverter company's web site: Sunny WebBox The docs cover the expected signals and such that will come over the RS485 port.

My question is, do I need an RS485 shield, or can I code the port through the normal serial libraries? Also, does anyone have a practical example of doing this sort of thing? I've seen reference for communicating between two Netduinos with RS485, but nothing about receiving a message from an external source.

Thoughts?

#2 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 04 November 2011 - 06:07 PM

You will need some intermediary hardware, because of the symmetric data transmission (the signal is the voltage difference of the both signal cables) and - as far as i can see - +- 12V data transmission (netduino uses +3.3V/Ground). I haven't seen any protocol description at a quick glance, so i don't know if there's further barriers there ...
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 November 2011 - 06:19 PM

I browsed several docs in the web site, but I didn't find any detail about the RS485. There must be a detailed description of the protocol used (I suppose Modbus), and the related commands. Any additional link to search into?
Biggest fault of Netduino? It runs by electricity.

#4 JamesSir

JamesSir

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 November 2011 - 07:37 PM

Hm. I'm killing time looking for the right info.
This PDF has info on converting it all to RS232, which is native to the Netduino (right?)RS485 via RS232 The cost of the converter is pretty small, so that might be an option.

Otherwise, this appears to be the most interesting doc regarding the protocol used: session protocol

Does that help?

#5 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 04 November 2011 - 09:11 PM

Regarding "native to the netduino" - you'll need a level shifter like the max232 (cheap IC) to convert the signal levels from standard RS232 levels to 3.3V levels. That document does tell you how to send the data, and the timing seems to be forgiving, so that should work out.
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 05 November 2011 - 05:18 AM

Stefan is right. Let's point the terms: "UART" is the component embedded in the Netduino microcontroller, which perform serial data exchange, in an asynchronous fashion. Most of the time, the physical interface inherits from the chip logic, thus it's TTL, CMOS, HCOMS, etc. Suitable for compatible logic devices, with very short wiring, usually within the same circuit. "RS232" is a particular physical interface (along with an handshake protocol), based on UART. Thus, you may see it as a "wrapper" around the UART. Good noise immunity, cheap hardware (e.g. MAX232), suitable for connection up to 10-15 mt. Max baud-rate about 100-200K bit/s. "RS485" is another physical interface/protocol, yet based on UART. Designed for industrial communication, very reliable, but pretty expensive as hardware. Suitable for connection up to 1.2Km, it allows baud-rate up to 1-2Mbit/s. Probably the RS232 (MAX232 shield) is the best bet for you. Unless you want to wire the inverter to your home, where the RS485 would be mandatory. In this case, the cabling will cost much more than the Netduino and stuffs around! The docs talk about 1200bit/s, which is pretty slow. Thus, you shouldn't have any problem to use a Netduino for the communication. However, the very best thing is "trying" at least once! I guess it's worthwhile. Cheers
Biggest fault of Netduino? It runs by electricity.

#7 JamesSir

JamesSir

    New Member

  • Members
  • Pip
  • 3 posts

Posted 05 November 2011 - 04:12 PM

Great responses. I will follow up with your suggestions. Thanks! My biggest problem will be testing. I'll have to take a chair and table out to the panel to actually play with the code, unless you can think of a way to simulate RS485 in my house. Thanks again.

#8 ItsDan

ItsDan

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 08 November 2011 - 07:03 PM

Long term you could look into using a set of XBee chips to send the information back, either to another netduino which could log or directly to a pc.
Follow the adventures of the Box of Crappy Surplus

Total BOCS Traveled Distance: 9708 miles | States Visited: 5
Track the Box




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.