Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Bringing in serial data through UART on 20-Pin connector

Home Forums Mayfly Data Logger Bringing in serial data through UART on 20-Pin connector Reply To: Bringing in serial data through UART on 20-Pin connector

Shannon Hicks

Are you sure you need to use UART 0 for your incoming data from your deice?  The RX0/TX0 pins on the 20-pin header are directly wired to the main UART 0 of the Mayfly, which are the same pins that are used when programming the Mayfly board via your computer (using either the USB port of the FTDI header).  So if you have a device connected to RX0/TX0 of your Mayfly, and that device is actively sending data to the Mayfly, then you won’t be able to program your Mayfly while that device is connected, or view data on the IDE via the SerialMonitor.  Unless you’re using UART 1 for something else (like a bee module in the Mayfly bee socket) then I would suggest you connect your serial device to UART 1 using the RX1/TX1 pins instead.

If you want to use one of the other digital pins (the other 20-pin header on the adjacent side of the Mayfly) then you could use one of the pins like D4, D5, D6, D7, D10, D11, or a few others, but only if you aren’t using those pins by something else on your board or in your sketch, and only if you implement SoftwareSerial via libraries.  However, SoftwareSerial has issues and limitations, so it’s better to use a hardware UART instead if it’s free.