Giter Site home page Giter Site logo

envirodiy / envirodiy_mayfly_logger Goto Github PK

View Code? Open in Web Editor NEW
29.0 12.0 26.0 9.71 MB

hardware design files, example code sketches, and documentation for Arduino-framework EnviroDIY Mayfly data logger

Home Page: https://envirodiy.org/mayfly/

License: Other

C++ 100.00%
arduino sketches board monitoring environmental-monitoring

envirodiy_mayfly_logger's People

Contributors

aufdenkampe avatar darscott avatar fisherba avatar fryarludwig avatar mfindley avatar s-hicks2 avatar srgdamia1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

envirodiy_mayfly_logger's Issues

+5V boost efficiency mod

From v0.3 of mayfly schematic: If a hardware turn is made, I'm wondering could the +5V generation input L1/C13 be taken before the SPC3819 - ei D3/C7 (J13-2?)
The +5V boost enable of U3 EN could be tied to the 3.3VSW_EN (processor D22 Q2 gate)
This should have no functional impact, but should make the +5V boost circuit more efficient, and guarantee less likelihood of a power glitch on the 3.3V processor power line if a heavy load is present for 3.3V_SW_EN

Maxbotix sonar 0 mm readings between "good" readings, other delays

Using the sketch "mayfly_10_sonar.ino", the serial monitor gives several "0 mm" (and sometimes 9999 mm) readings between the correct distance readings. I tried to change the delay in the sketch (from 700 to 1400), and I hoped that would solve the issue for me, but I am still experiencing as many as 3-24 "0 mm" readings while the sketch runs.

I am using Mayfly v0.3, and I wonder if the constant power for the D4-5 port could be part of the issue?

Also, it seems to take ~20-30 seconds to recognize a change in measured distance, meanwhile the old distance continues to output to the serial monitor (along with the 0 mm readings). Is this an expected behavior?

Mayfly1a3 header naming

I'm attempting to use the new numbering for the two headers on the Mayfly rev1a3 and I'm having to go back to the
PCB definition to correlate visible pins with schematic.

From Mayfly1a3 silkscreen on the board, and the documentation on
the https://www.envirodiy.org/mayfly/hardware/
I can't identify which header is H1 and H2 and which is a starting pin - say pin 1 or ending pin say 19.
Maybe I'm missing something, and the rest of the board's seed pins are nicely documented.

I would expect the documentation and/or the physical board to identify some of these, and not have to go back to looking at an eagle file PCB to correlate physical pin with schematic.

PWM ports

I have recently been trying to connect multiple analog sensors to the mayfly board using a 16-channel analog multiplexer. I have reached a little hurdle however. The PWM ports are clearly labeled on the arduino uno boards, while the mayfly they are not. Does anyone now which digital ports are PWM ports?

Vbat A6 electrically noisy

Measuring the LiPo battery voltage is through a resistor divider 10M / 2.7M with a capacitor 100nF
Using this reference there is a lot of noise on the ADC.

Can the resistance's be changed to 1M / 270K for better noise immunity.

With 12.7M - the current drain 4.0V/12.7M = 0.31uA
With 1.27M - the current drain 4.0V/1.27M = 3.1uA - negligble in the overall power management
For an algorithm that detects the lowest battery voltage as an estimate for battery capacity, a windowed filter of 4 readings was implemented. The "Some Sw filtering" below used the lowest value read in the 4 to achieve some noise reduction

220321_swfiltering_8daysNoise

Upgrade solar charge controller.

The Mayfly's Lipo battery solar charge controller chip (MCP73831) has a max output of 500 mA, which is about the 550 mA peak output of the Voltaic's 3.5W solar panel that we often use for our power-hungry sensors (i.e. YosemiTech turbidity with a brush) along with Adafruit's 2-cell 4400mAh or 3-cell 6600mAh Lithium Ion Battery Packs. This means that we can't increase the solar panel size beyond this for more power-hungry applications (such as several sensors with brushes).

It would be great to have a slightly higher rated and potentially more efficient charge controller.

One option might be the MCP73871 controller that is used in the Adafruit Solar Lithium Ion/Polymer charger - v2 that can be modified to 1A charging and gets high marks in this review: https://www.voltaicsystems.com/blog/lithium-ion-charge-controller/.

Not sure if there are other pros/cons. Is there value at going with a MPPT (maximum power point tracker) charge controller?

sleep mode current

Just checking on mA consumed during sleep -
for the current 'develop' branch using logging_to_EnviroDIY.ino, on sleep the current reduces to about 3.5mA after EnviroDIYLogger.systemSleep() is executed.
This is with a barebones Mayfly0.5b and only one sensor ProcessorStats_SampleNumber() in variableList[], no SD card, no Xbee or anything. Just the rtc coin battery added to the board.
I'm expecting to get to about 0.5mA as per @s-hicks2 https://www.envirodiy.org/topic/low-power-project/
With Sensors sampling and Green and Red led its about 10.5mA

If I comment out the real work of sensor update - and just leave
EnviroDIYLogger.checkInterval() -
EnviroDIYLogger.systemSleep()
then in one case it went to sleep and consumed 0.5mA - hurrah.

However on repeating the same exercise above, it didn't reduce the current - but stayed at 3.5mA
So it could be that I just got lucky once - and it doesn't matter whether its actually running the sensors update or not.

I'm measuring current as taken for the LiIon battery with a good digital multimeter with a mA range (and also uA range).
I've modified LiIon battery extension cable so that it works for a running mayfly.
I power up from cold by plugging in the LiIon cable

I can see EnviroDIYLogger.systemSleep() has a lot of good code to do a powerdown, but I'm not getting there.

Just wondering if I'm missing a switch, or any suggestions on how to measure sleep current. Thanks

Add hot - swappable I2C buffer/isolator between I2C jack and main I2C lines

Having either the SCL or SDA line pulled low can cause an unrecoverable hang in the I2C/wire library. Any i2c device with its own internal pull ups that is running on switched power will suddenly pull both SCL and SDA low if the switched power is turned off. The next time the Mayfly tries to communicate with any I2C devices, like the RTC, it will hang forever.

http://forum.arduino.cc/index.php/topic,19624.0.html

I'm sure this is the cause of EnviroDIY/ModularSensors#176

There are alternatives to the "built in" Wire library that add a timeout to prevent the hang, but it would be very difficult to replace all the calls to wire in other people's libraries and implement an alternative. A hardware solution is needed.

@s-hicks2

Mayfly_Logger PCB in Europe

Hi ,

I am trying having access to MayFly Logger from some place in Europe either in NL or Greece. According to Amazon.com this is not possible. This leaves me with two options: a) either get the PCB from some place and solder the BOM myself on the PCB or b) getting the gerber/eagle files and print them to PCB locally or c) the long way going from the semantics --> PCB and then to the final product. What do you suggest ?

AOSongDHT.h causes cc error

AOSongDHT has compile errors.
I believe this problem is already been seen, but just adding this to track the solution.

There must be a new version of the compiler, and there is a conflict with items in the DHType enum with the same named parts in DHT.h
/* Define types of sensors. */
static const uint8_t DHT11{11}; /< DHT TYPE 11 */
static const uint8_t DHT12{12}; /
< DHY TYPE 12 */
static const uint8_t DHT21{21}; /< DHT TYPE 21 */
static const uint8_t DHT22{22}; /
< DHT TYPE 22 */
static const uint8_t AM2301{21}; /**< AM2301 */

AOSongDHT.h:
typedef enum DHTtype {
DHT11 = 11,
DHT21 = 21,
AM2301 = 21,
DHT22 = 22,
AM2302 = 22
} DHTtype;

The parts in the enum are not referenced, it looks like it is specified to improve documentation.
I solved the cc problem with a rename, this maynot be an ideal long term fix,

typedef enum DHTtype {
// should match values in DHT.h, but can have same names
eDHT11 = 11,
eDHT12 = 12,
eDHT21 = 21,
eAM2301 = 21,
eDHT22 = 22,
eAM2302 = 22
} DHTtype;

XBEE reset

In a future revision, I wonder could the XBEE -RESET be activated from a processor port.
The XBEE skt supports a number of pluggable modules, some of them are very sophisticated. Sometimes these modules become unresponsive, in an ideal world maybe you could figure out what set of commands resulted in their demise.
A practical way is to apply a reset to the module and then it should behave determinstically. Of course if the module power supply can be greated then that of the processor it may need to be decoupled with an Open Collector FET arrangement.
Some processors support a - RESET pulse coming from the processor reset line if there is an internal reset, but I couldn't see this on the mega1284.

Solar Charger Over-Voltage

Issue:

The solar charge controller (truly battery charge controller) used for the solar charging by the Mayfly (unless I am missing something) is not rated for the potential input voltages it would see over the operational range of the solar panel/converter.

The battery charge controller currently in use is the MCP73831. Conventionally the Mayfly loggers are used with Voltaic's 3.5W solar panel, or similar 6v panel (as referenced in #23). The problem being that the max open circuit voltage generated by the panel is 7.7v, while the absolute maximum input to the MCP73831 is only 7v, meaning that in low load or high insolation conditions, the input voltage could rise above the absolute maximum rating and cause damage to the chip or system.

There is a series diode (B5819W) in the circuit between the panel and the charge controller to allow for input switching, however, at the very low loading situations that would cause a high solar input voltage, the forward diode voltage is only 200~300mV, still resulting in a potential input voltage well over the 7v absolute maximum (7.4 ~ 7.5v).

Note: This same issue would also be present in the MCP73871 suggested in #23

Potential solution:

Have not researched the potential linear solutions extensively, but perhaps something in the BQ2401x line (specifically BQ24013) or the BQ2406x, which would solve this issue, and also address the desire for a larger output charge current (#23)

For our newest series of logger, we are using the LT3652, I have researched this segment of true MPPT systems in detail and could not find a better performing unit for this power range. Especially with the addition of an external control network, can result in >75% efficiency over all regions of operation, even into the <100mA input region where parasitics can dominate. And nearer to 90% for the >500mA range. Also allows for up to 2A output current.

GPRSBee class error on "logging_to_EnviroDIY.ino"

@SRGDamia1, yesterday 4 of us at LimnoTech tried out https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger/blob/master/examples/logging_to_EnviroDIY/logging_to_EnviroDIY.ino by making modifications in separate personal branches.

Unfortunately, I couldn't get the sketch to Verify, even though I have my libraries updated to the most recent. On my two different laptops (both macOS 10.12.3), I got a 'class GPRSbeeClass' has no member named 'addHTTPHeaders' error on line 477. However my 3 colleagues, all running windows, had no problem verifying their sketches and now one is logging to Data.EnviroDIY.org.

Here is the full error:

Arduino: 1.8.0 (Mac OS X), Board: "EnviroDIY Mayfly 1284p"

/Users/aaufdenkampe/Documents/Arduino/EnviroDIY_Mayfly_Logger/examples/logging_to_EnviroDIY/logging_to_EnviroDIY.ino: In function 'int postDataGPRS(bool)':
logging_to_EnviroDIY:477: error: 'class GPRSbeeClass' has no member named 'addHTTPHeaders'
     gprsbee.addHTTPHeaders(header);
             ^
logging_to_EnviroDIY:478: error: 'class GPRSbeeClass' has no member named 'addContentType'
     gprsbee.addContentType(F("application/json"));
             ^
Multiple libraries were found for "SD.h"
 Used: /Users/aaufdenkampe/Documents/Arduino/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
exit status 1
'class GPRSbeeClass' has no member named 'addHTTPHeaders'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any ideas?

LiIon 3.6V

FeatureRequest It would be nice if the Mayfly could be specified to run from a 3.6V LiIon Li-SOCL₂

eg D Cell 3.6V Lithium Thionyl Chloride Battery single use ER34615 19AHr, or ER18505 4100mAh
The advantage is a single cell battery, that is specified for an outdoor temperature range.
It is relatively high impedance, so is likely only to support a standalone Mayfly with no or low current Xbee.

Seems like this should be possible.
The AREF has an external capacitor, AREF can be routed internally " Voltage Reference Selections for ADC" and use either the AVCC, or 2.56V or 1.1V
The processor mega1284 supports a voltage range from 1.8-5.5V, so if the LDO could be bypassed it would be able to use a wide dynamic range including that of the Li-SOCl2, standard LiIon rechargeable.
(updated 2021Oct21)

Modular Coding for Mayflies

This is pasted from an email send by @fryarludwig to @SRGDamia1 about the SimpleLoggingExample and Modular-Code-Example feature branches in this repo:

I've revisited the modular code example, and my original plan for adding multiple values to single sensors would be the wrong approach. A better approach would be more time consuming and would change the current relationship between "sensors" and "dataValues" - I can see this being useful for long-term goals, but is not necessary for the workshop.

I imagine the SimpleLoggingExample would give you the best results for time committed, given your sensor requirements. This is a single-file example we put together to allow users more control while limiting inherent complexity at the same time.

To help get you started in the EnviroDIY_Mayfly_Logger.ino file:
line 37: The config.h file was moved to here - change as needed
line 74: We have a global sensor variable. Add the variables for the values you want to collect here, and feel free to get rid of the onboard_temperature value.
line 238: This is the function you'll use to update the variables you created above. Feel free to add a sensor's wake/sleep functions inside this, or you can add those on line 280.
line 252: Generate your JSON string here for the POST request.
line 267: This is where we set the time. You mentioned you sync this with the computer, so remove or replace as needed.

ADS115 input capacitor

Feature Request : For analog inputs can a capacitor or capacitor pad be added to the analog input.
The data sheet ads1113 Fig 49 layout shows the ideal of a low pass RC, but maybe this adds to much cost to the cct.
Typically to create the lowest S/N the analog has its own ground, and then tied to the digital ground in one place along the route the I2C signals travel.
"Sect 9.3.2 The ADS111x use a switched-capacitor input stage" , so there is a current pulse every time the internal capacitor is applied to the pad.

+12V not fully operational

@s-hicks2 made a comment "issue related to the current-limiting circuitry"
for "the wiper on the Yosemitech Y511A sometimes causes issues if you’re powering the sensor directly from the Mayfly 1.0 revA3 (current release) onboard 12v boost regulator. I’ve come up with a workaround, but will have to apply it to the next manufacturing run of boards, and also make a couple minor changes to the Modbus adapter half-shield design"

https://www.envirodiy.org/new-mayfly-data-logger-and-accessories/#comment-492

This is to track what is the operational limits of +12V Mayfly 1.0 revA3
Its very typical that high risk new circuits may not reach full design criterar, but they should be characterized so that purchasers can make decisions.

UART RXD0 Pullup Qu

On the Mayfly 0.5b the UART RXD0, Processor Pin9, is a CMOS input.
Under normal operation mode when it is deployed it would be in UART mode and it would appear to float.
I'm curious, its normally good practice to pull up/down high impedance CMOS inputs, so that they can't oscillate. Was this considered for this input.
When a user is using the FTDI and is powered VUSB/5V_FT, it would be driven, but this is typically only when its in development mode with USB cable plugged in.
I seem to have seen an occasional stream of unexpected UART RX ~ however its difficult to characterize,
I have had unexpectedly variable power measurements which could explain variability I've seen in #21

Schematic Diagram shows SJ1 as open

A slight schematic error for SJ1

On 0.5b Schematic SJ1 is show as open for both A7 and D10.
Under the heading "Solder jumper information" it doesn't indicate its PCB default is SJ1-A7
https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger/blob/master/hardware/mayfly_v0p5b_schematic.png

On the PCB's I have has SJ1 has a cu connection to A7
Elsewhere, the documentation does describe as SJ1-A7 to enable the RTC interrupt to be processed.

The schematic does show cu connections for SJ3, SJ4, , SJ8, SJ9,SJ11, SJ13,

+12V generation - NCP1403 opt

wrt Mayfly 0.3: If a turn of hardware is done, I wonder would it be possible to conside a layout where by the NCP1403 could be added - possibly as a user option in desoldering the NCP1402 +5V generation.
It seems like the NCP1403 could facilitate generation of +12V with a reliable current of 20mA, even when the input voltage has dropped to 3.0V,
The cost would be laying out the board with three optional components 2 resistors, 1cap (RFB1 RFB2 Cc in cct below). Possibly boosting the outcap rated voltage to +15V.
This components would require one bypass strap to facilitate the current NCP1402-50T1 +5V

image

This could support the large number of +12V sensors, both analog 4-20mA and also with the addition of a RS485 interface the modbus sensors.

determining sufficient LiIon charge for heavy power usage.

For Mayfly rev1 with a fully discharged LiIon battery, using a BQ24074 that is now being charging by a solar panel, what algorithm can be used to estimate the available power in the LiIon battery.?

For a charging system, with a heavy power usage, like an LTE modem, or instruments on +12V boost, there needs to be sufficient reservoir of available power before turning on the devices.
If there is an excessive power usage, then processor will have a brown-out, and reset.

The software measuring the Voltage on A6 through a high impedance 10M/2.7M combination measures Vin, which is wire-ORed through an ideal diode/Q3 from the power path output of V_BATT, and through D5 VUSB.
The V_BATT is from the BQ24074, that is either regulated 4.4V from Vin (solar) or LiIon_V.
Only when there is no charging power, does the Voltage on A6 represent approx the LiIon_V.

Assuming solar charging, and the system is just power up, one possibly method/algorithm of determining the LiIon_V is to wait a period of time (2hours~15minutes) and take the lowest measured descended Voltage as representing the LiIon_V. If its is insufficient, a sliding window could be implemented to look for a LiIon_V. This could be indicated by a state on the LEDs (short User switch press), and the waiting bypassed by a long User Switch press.
Another option on the mega1284 is to look for the reset reason as from a brownout. If this occurs then to implement the above algorithm However this requires modifying the Arduino BSP framework, as currently it is read and thrown away at startup.

Value of C2

Hi ,
It seems that I have destroyed C2 . According to schematics, it seems to be 100uF. Is this correct ? I couldn't locate an SMD with 100uF.

Xbee Decoupling capacitor

Cellular modules recommend a low ESR ceramic decoupling capacitor close to the power pins, with the lowest impedance current loop path.
For Maylfly 1.0A3 there doesn't appear to be a large decoupling capcitor between BEE_VCC and GND, though perhaps the path through the regulator to the regulator's 10uF and low impedance LiIon battery wroks
Can a largish ceramic capacitor (100uf) be applied to Xbee pins.
I'll post references to data sheets, but I have limited access this afternoon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.