Forum Replies Created
-
AuthorPosts
-
You mean the USB5V on the FTDI header? That’s only used if you’re supplying power to the board via an FTDI adapter when programming. You should definitely be using the SW5 pin for powering a sensor and not using the FTDI header.
What does your resistor divider network look like? What values, and how do you have them connected in relation to the sensor, and the power and ground pins of the Mayfly? Is the sensor properly connected to a Ground pin on the Mayfly as well?
What pin is the sensor getting power from? If it’s the Switched 5v pin (labeled SW5), or from one of the grove terminals (assuming you’ve moved the jumper over to the 5v setting), you still need to switch on the 5V boost regulator by putting this line, preferably in your setup routine:
digitalWrite(22, HIGH);
The 5v boost regulator (as well as the switched 3.3v aux regulator) are not enabled unless you set pin 22 high. This is so the regulators don’t stay on all the time and waste power when the logger is sleeping between measurements. If you want to leave it on constantly, it’s easiest to put the statement above in your setup routine. If you’re making a sleeping logger, then you’ll want to set 22 high and low at different times in your loop, making sure to add sufficient time for the sensor to settle after powering up before taking a reading.
Which analog pins of the Mayfly are you attempting to use to measure the voltage? And can you share the code you’re using to read the voltage?
Some of you have already noticed that the Mayfly boards and kits are back in stock on Amazon. If you’re planning to order more than a dozen of any item, I’d appreciate an email at mayfly@envirodiy.org so that we can tell you if there’s enough of that item in stock or to find a better way to get you the larger quantities.
For the past few years, we’ve only offered the vertical microSD card adapter as part of the starter kit. But if there’s significant demand for it, I suppose we could add it to our Amazon store as a separate item.
Here’s some sample code that I just put together to demonstrate the code for waking and sleeping the Xbee. You’ll notice it’s a little more complicated than just setting the D23 pin high or low. That’s because the pin should be pulled high when you want to sleep the Xbee (like I mentioned in my previous post), and if you want to sleep the Mayfly (Mayfly sleep function not shown in the code below), you’ll want to enable the input pullup so the Mayfly pin still looks high to the Xbee unit, otherwise when the Mayfly sleeps, the Xbee won’t get the HIGH signal needed to keep it asleep and will therefore wake up.
It’s also a good idea to leave a few seconds before and after your payload transmission to give the Xbee network adequate time to do the behind-the-scenes payload transmission stuff.
Arduino12345678910111213141516171819202122232425262728293031323334353637383940414243#define XBEE_SleepPin 23void setup(){//Initialise the serial connectionSerial.begin(57600);Serial1.begin(9600); //this is the Xbee UART, default Xbee speed is 9600 baudpinMode(8, OUTPUT); //Green LEDpinMode(9, OUTPUT); //Red LEDdigitalWrite(8, HIGH); //turn on the Green LED and leave it ondigitalWrite(9, LOW); //turn off the Red LED, we'll use it later to indicate Xbee wakepinMode(XBEE_SleepPin,OUTPUT); // Set the Xbee "wake-up pin" (D23) to outputdigitalWrite(XBEE_SleepPin,LOW); // wake-up XBee to start withSerial.println("Xbee Testing Sketch");delay(2000);}void loop(){wakeXbee();delay(3000); //give the Xbee a few seconds to wake up and be seen by the networkSerial1.println("This_is_the_xbee_payload"); //this is the text that gets sent via the Xbee RF moduledelay(3000); //give the Xbee a few seconds before putting it back to sleepsleepXbee();delay(10000); // wait 10 seconds, then do it all over again}void sleepXbee(){Serial.println("Putting the Xbee to sleep");delay(100);pinMode(XBEE_SleepPin,INPUT_PULLUP); // Set the "wake-up pin" to input and enable the internal pullupdigitalWrite(XBEE_SleepPin,HIGH); //put the Xbee to sleepdigitalWrite(9, LOW); //turn off the RED LED when the Xbee is asleep}void wakeXbee() {Serial.println("Wake up the Xbee");delay(100);pinMode(XBEE_SleepPin,OUTPUT); // Set the "wake-up pin" to outputdigitalWrite(XBEE_SleepPin,LOW); // wake-up XBeedigitalWrite(9, HIGH); // turn on the RED LED when the Xbee is awake}We had a big run on boards and kits the past couple weeks, I guess it’s the spring monitoring season again. I usually try to keep the Amazon store well-stocked, but we sold more in the past few weeks than we did the previous 2 months, so I’m working on replenishing the Amazon inventory ASAP. I sent some boards to Amazon last week which should be available later today or tomorrow. More boards and kits will be sent to Amazon later this week or next week. It looks like we’re out of protoshield boards as well, so I’ll send more of those too. We’ve also got a couple new items coming later this month, and I’ll post an update about them when they’re ready.
To address your points:
1. Any power source connected to the 2 pins labeled “Ext 12v” will power the Mayfly but will not charge any LiPo batteries connected to the two LiPo jacks.
2. The solar panel connected to the JST jack labeled “SOLAR” should never exceed 6 volts. The charging circuity on the Mayfly uses a small chip that has a 6v maximum input (and 500ma max charge rate). This is the reason that connecting a 12v source to the external power pins (see point 1 above) won’t charge the battery. The 20v-1A note on the schematic denotes the rating of the protection diode, not the input voltage source
3. Using a 12v-to-5v USB converter connected to the Mayfly’s USB jack will power the board, and charge any LiPo that’s connected to it, so that’s the preferred method for now. Hopefully the next version of the Mayfly will be more flexible about input voltages and charging.A couple other points to make:
If you’ve jumpered over SJ13 to power the bee socket’s Vcc pin (pin 1), remember that the bee socket’s pin will be continuously powered by whatever battery is on the LiPo jack, and will not turn off even if you turn off the Mayfly’s main power switch. If you have a board like the new Digi 4GLTE board, the 4GLTE board will wake up when the Mayfly is turned off since the Mayfly can’t assert the sleep pin anymore. I’ve modified a few Mayfly boards to get around this issue, but it’s not easy, and have now made a tiny new adapter board that goes between the 4GLTE bee and the Mayfly that will solve this problem, along with giving the user some handy status LEDs since the 4GLTE bees have no indicator lights on them at all. I’m hoping to have those adapters in about a month.Second, the CS451 needs 6-18v excitation, which the Mayfly can’t provide. How are you powering the sensors, and are you using the SDI-12 or RS232 protocol on them, and how are you interfacing them with the Mayfly? Without an adapter or voltage level shifting circuitry, the higher voltage signal will damage the input of the Mayfly. I’ve made a variety of custom level shifters and voltage boost boards for different sensors (6v, 9v, 12v, etc) or used relays to control power to higher loads. Either way, the signal needs to be conditioned properly before feeding it back to the Mayfly.
Yes, it is possible for a Mayfly logger to read data from a Sontek SL sensor. Several years ago when we first started using the Mayfly, we connected it to Sontek IQ+ units, which have basically the same power and data interface requirements that the Sontek SL units do. The sensors need 12 volts DC to operate, which the Mayfly can’t provide directly, so just connect a 12v battery to the power leads for the sensor. The sensor has separate data leads/connectors for interfacing the sensor with a laptop or data display unit. The data is typically stored onboard the sensor, but you can echo the data to the Mayfly by using SDI-12 or RS-232 after each sample. It’s easier to use SDI-12, but it will require you to tweak the commands for your particular sensor and parse the returned data. You’ll also have to add a voltage level-shifting circuit on the data lines between the Mayfly and the SL. With the RS-232 options from the SL sensor, you can use an off-the-shelf RS232-to-TTL adapter and just have the Mayfly listen for (and capture) a really long string of data after each reading, and then parse that string. On the IQ+ modules, that string contained something like 30 different variables, but I assume it would be much shorter with the SL.
I bought some of the Xbee3 LTE-M modules a few weeks ago and they had hardware version D printed on them, so they appear to be the latest version. I also updated their firmware to a version that came out a few weeks ago which supposedly has some improvements too. Digi also states in the manual several time (including with big warning symbols) that Bypass mode has been deprecated and should not be used because it causes instability in the cellular connectivity. So I’m now switching ours over to transparent mode to see if they are more stable. Previously in Bypass mode, I had the same issue that Cal did where things would work fine for a few days, but then the module would stop responding and require me to reset it. I’m hoping that operation in transparent mode will be better.
Something else that I discovered lately is that because of the workaround we did with using the SJ13 option for powering the Bee socket pin 1 directly from LiPo is that the module is now constantly powered. This is great as long as the Mayfly is turned on and can put the LTE-M bee to sleep by asserting the bee’s sleep pin high. The Mayfly is able to keep that pin high even when the Mayfly is asleep (if you write your code correctly). However, when the Mayfly gets turned off at the main power switch, the Bee module is no longer kept in sleep mode by the Mayfly, so it wakes up and stays on permanently until someone turns the Mayfly back on. The LTE-M bee draws about 7ma when idle, so it’ll drain a battery after a short while if you don’t have a solar panel connected. So for now, I just remove the Bee module from the socket when I turn the Mayfly off. It’s possible that you could solder a pullup resistor to the bee sleep pin, but that gets messy and could cause other issues. So our next version of the Mayfly board will incorporate some new changes to how all the Bee socket stuff is handled to fix this problem and to add some other functionality.
-
AuthorPosts