Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdenkampe authored Feb 4, 2019
1 parent 82004c8 commit 5c580a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This library is designed to use an Arduino as a Modbus master to communicate wit
- [Using the library](#usingLibrary)
- [Notes on Modbus maps](#notesModbusMaps)
- [Notes on TTL and RS485/RS322 electrical communications standards](#notesRS485)
- [Hardware interface suggestions for EnviroDIY Mayfly](#hardwareMayfly)
- [Hardware interface suggestions for EnviroDIY Mayfly and other Arduino boards](#hardwareMayfly)

_____

Expand Down Expand Up @@ -119,7 +119,9 @@ _____


## <a name="notesRS485"></a>Notes on TTL and RS485/RS322 electrical communications standards
While Modbus RTU specifications define the format of a data frame transferred over a serial line, the type of serial signal is not defined. Many Modbus sensors communicate over [RS-485](https://en.wikipedia.org/wiki/RS-485). To interface between RS485 and the TTL used by standard Arduino-type boards, you will need an RS485-to-TTL adapter. There are a number of RS485-to-TTL adapters available. When shopping for one, be mindful of the logic level of the TTL output by the adapter. The MAX485, one of the most popular adapters, has a 5V logic level in the TTL signal. This will _fry_ any board that can only use on 3.3V logic. You would need a voltage shifter in between the Mayfly and the MAX485 to make it work. Also note that most RS485-to-TTL adapters are implemented _without_ automatic flow control. That is, you must manually set voltages on driver enable and receiver enable pins to control the data flow direction. While this library includes functions for setting the enables, I've found commutation to be much more stable on adapters with built-in flow control. You will also need an interface board to communicate between an Arduino and any Modbus sensor that communicates over [RS422](https://en.wikipedia.org/wiki/RS-422) or [RS232](https://en.wikipedia.org/wiki/RS-232). Again, mind your voltages and the method of direction control.
While Modbus RTU specifications define the format of a data frame transferred over a serial line, the type of serial signal is not defined. Many Modbus sensors communicate over [RS-485](https://en.wikipedia.org/wiki/RS-485). To interface between RS485 and the TTL used by standard Arduino-type boards, you will need an RS485-to-TTL adapter. There are a number of RS485-to-TTL adapters available. When shopping for one, be mindful of the logic level of the TTL output by the adapter. The MAX485, one of the most popular adapters, has a 5V logic level in the TTL signal. This will _fry_ any board that can only use on 3.3V logic. You would need a voltage shifter in between the Mayfly and the MAX485 to make it work. Also note that most RS485-to-TTL adapters are implemented _without_ automatic flow control. That is, you must manually set voltages on driver enable and receiver enable pins to control the data flow direction. While this library includes functions for setting the enables, I've found commutation to be much more stable on adapters with built-in flow control. You will also need a [hardware interface board](#hardwareMayfly) to communicate between an Arduino and any Modbus sensor that communicates over [RS422](https://en.wikipedia.org/wiki/RS-422) or [RS232](https://en.wikipedia.org/wiki/RS-232). Again, mind your voltages and the method of direction control.

## <a name="hardwareMayfly"></a>Hardware interface suggestions for EnviroDIY Mayfly
For our use with the [EnviroDIY Mayfly datalogger](https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger) board, we we have developed a Modbus-Mayfly wing shield that combines AltSoftSerial TTL to RS-485 conversion with an optional power boost to 9V or 12V.
For use with the [EnviroDIY Mayfly datalogger](https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger) and other Arduino framework boards, you will likely need some additional [Hardware for using ModbusRTU with RS-485 on Arduino](https://github.com/EnviroDIY/SensorModbusMaster/tree/master/hardware).

We have developed a [Modbus-Mayfly-WingShield](https://github.com/EnviroDIY/SensorModbusMaster/tree/master/hardware/Modbus-Mayfly_WingShield) that combines AltSoftSerial TTL to RS-485 conversion with an optional power boost to 9V or 12V. This has worked quite well for us for a variety of deployment configurations and sensors.

0 comments on commit 5c580a0

Please sign in to comment.