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: 12 V External Power and Serial Viewer

Home Forums Infrastructure and Equipment 12 V External Power and Serial Viewer Reply To: 12 V External Power and Serial Viewer

Shannon Hicks

    You are correct, if you’re using the USB jack to power a v1.0 or v1.1 Mayfly using a 12v source, then there’s no way to interface the Mayfly with a PC for programming or viewing serial output.  However, all Mayfly boards include an FTDI jack that allows you to connect a variety of FTDI cables or adapters in order to communicate with the board in the event of a broken or otherwise occupied USB jack.

    Check out this post I wrote last year describing how to connect a small board called the Adafruit CP2104 Friend to a Mayfly:  https://www.envirodiy.org/topic/pc-and-mac-unable-to-communicate-with-mayfly-ver-0-5b/#post-16736

    Be sure to scroll down to the bottom of that thread to see the photo I posted showing how you’ll need to solder some right-angle header pins to the end of the Adafruit board in order to plug it into the Mayfly.  Adafruit has since updated and renamed the board the CP2102 Friend but it can be used the same way.

    If you don’t want to have to solder something, then you can purchase the older FTDI Friend model that is shipped with long double-ended male pins to let you connect it to the Mayfly with no soldering required.  I wrote about it here:  https://www.envirodiy.org/topic/com-ports-not-connecting-to-logger/#post-15418

    The older FTDI model uses a different chip than what is used on the newer Mayfly boards, so you might have to install some drivers if you use that one, I mention this in that post along with a photo of the correct way to connect the board to a Mayfly.  You could also use an FTDI cable, though I don’t know if it comes with the long pin headers so you might have to buy those separately.

    Another thing to note, there is a CP2102 USB interface chip built into every Mayfly v1.0 or v1.1.  That’s what allows you to communicate with a PC via the USB jack.  If you connect a separate computer interface board via the FTDI jack, like any of the boards mentioned above, it’s a good idea to disable the Mayfly’s onboard CP2102 chip to avoid hardware conflicts and errors when uploading a sketch.  The small brown block next to the Mayfly’s power switch contains 2 small dip switches.  Here’s a description of them from the Hardware Details page:

    Power LEDs and DIP switches:  LEDs indicate board power (green) and USB power (orange).  Useful for easily seeing if the board is on and if USB power is connected.  Green LED will be lit anytime the board has power and the power switch is in the ON position.  Orange LED will be lit anytime power is being supplied through the USB or FTDI connectors.  If Mayfly board is deployed in a sleeping logger station, it is recommended to set both DIP switches to the OFF position in order to save battery power.  Use a small pointed object to gently slide the small white squares of the DIP switch either to the ON or OFF positions.

    So if you’re powering your Mayfly with the USB jack, you’ll be wasting a lot of power keeping the LEDs on and also powering the onboard USB converter chip.  I would recommend turning both switches to OFF during your deployment, but you’ll need to remember to turn the USB switch back on if you ever want to reprogram the Mayfly via it’s onboard USB jack in the future.  Here’s something I wrote on the technical discussion thread last year:

    The dipswitches are mainly there to let people know their board is working during initial testing or desktop deployments.  Anytime a board is deployed in the field as a “sleeping” station, power savings are important during the sleep period.  So I put the dipswitches on the new versions of the Mayfly to allow people to deactivated the LEDs.  The dipswitch for the green LED only cuts power to the green LED and nothing else, but it will save you about 2 mA.  The orange LED is only on if power is being supplied through the USB jack, like when connected to a computer or when powering from the USB jack like what that converter will do.  Whenever the USB jack is powered and the USB dipswitch is on, the LED is on plus the USB converter chip, which draws some not-insignificant power, so turning off the USB dipswitch will save power and prevent the USB converter from being on constantly.  However, you’ll just have to remember to turn that dipswitch on again in the future if you ever decide to reprogram that Mayfly or want to connect to the Serial Monitor to see some output.