Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: Linking two Mayfly Boards Together

Home Forums Mayfly Data Logger Linking two Mayfly Boards Together Reply To: Linking two Mayfly Boards Together

#17384
Shannon Hicks
Moderator

    I use pin 22 on line 145 because I’m using a prototype Mayfly board that is able to generate 12v to directly power the external sensors. If you’re using an external 12v source for your sensors, then it’s fine to put -1 on line 145.  And I’m using a Max13412 RS-485 chip on my modbus adapter, which has auto direction control and internal 5v generation, which makes it easy to connect since it only needs a single 12v supply, but the auto direction control means I can set line 146 to -1 also.  In my experimenting, I found that communicating with this chip using pins 5 and 6 using AltSoftSerial was the most reliable way to do it, so that’s why my code looks like it does.  There’s probably other ways to do it, but this method has been very stable so far.