| Literature DB >> 35607655 |
Bao Nguyen1,2, Bryson Goto1,2, John S Selker1,3, Chet Udell1,3.
Abstract
Open source in-situ environmental sensor hardware continues to expand across the globe for a variety of applications. Sensor-management systems typically perform three fundamental tasks: sample sensors at a specified time or period, save data onto retrievable media, and switch power to components on and off in between sample cycles to conserve battery energy and increase field operation time. These tasks are commonly accomplished through integrating separate off-the-shelf components into the desired system such as: power relays, SD card hardware, Real-Time Clocks (RTCs), and coin cell batteries. To enable faster prototyping, the Openly Published Environmental Sensing Lab abstracted all of these requirements into a single printed circuit board (PCB), Hypnos, that can be included in any project to achieve these commonly-required capabilities: powering on and off connected sensors on a schedule and logging collected data to the removable SD card. The hardware is laid out in a "Feather" form factor, a popular configuration in the open-source hardware community, to easily mate with other industry standard products. The onboard RTC acts as an alarm clock that wakes a user-attached microprocessor from low-power sleep modes in between sample cycles. By integrating all these components into a single PCB, we save cost while significantly reducing physical system size. The design as well as a suite of code functions that enable the user to configure all the Hypnos board features are detailed.Entities:
Keywords: Data logging; Environmental sensing; Low-power state; Open source hardware; Real-time clock; Relay
Year: 2021 PMID: 35607655 PMCID: PMC9123445 DOI: 10.1016/j.ohx.2021.e00213
Source DB: PubMed Journal: HardwareX ISSN: 2468-0672
Fig. 1Front and Back View of Hypnos Board.
Fig. 2Assembled Top View of Hypnos Board.
Fig. 3μSD card module: μSD card holder, diode, and 100 nF capacitor placement. Diode polarity indicator facing toward μSD card holder.
Fig. 4Real time clock, 100nF capacitor, and interrupt push button placement. Polarity notch indicator on real time clock facing toward top of the Hypnos board.
Fig. 5Polarity Indications (Green lining on LED and circle in corner for large P-Channel MOSFET). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)
Fig. 6MOSFET Polarity Indicator on Hypnos board.
Fig. 7Reset push button, 30kΩ resistors, and LED placement. Green lining polarity indicator facing outward for LED. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)
Fig. 8100kΩ, 6.2kΩ, and 3kΩ Resistor and 100 pF Capacitor Placement.
Fig. 9MOSFET Circuitry Placement.
Fig. 10+ V Rail Component Placement: Match circled polarity indicator of large P-Channel MOSFET with Hypnos’ circled polarity indicator.
Fig. 11Low Temperature Solder Reflow Profile: Sn42/Bi57.6/Ag0.4 solder assembly, designed as a starting point for process optimization [13]
Fig. 12Hand Soldered Component Placements.
Fig. 13The Feather needs to connect to these header rows (red). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)
Fig. 14Sensors or sensor expansion board connect to these header rows (pink). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)
Fig. 15Soldered stacking pins on Feather.
Fig. 16Hypnos stacked on top of Feather.
Fig. 17Hypnos stacked between Feather and sensor board.
Fig. 18Hypnos stacked on top of the Feather and connected to external sensors.
Fig. 19Hypnos stacked on top of Feather and manually wired to sensor.
Fig. 20Voltage Rail Diagram.
Fig. 21Hypnos Board Pinout Diagram.
Fig. 22+ V rail Pins.
Fig. 23Battery Performance of SitkaNet.
Fig. 24Focused Battery Performance of SitkaNet.
Battery Level Comparison Table.
| Hypnos | No Hypnos | ||
|---|---|---|---|
| Starting Comparative Voltage | 3.76 | 3.77 | V |
| Ending Comparative Voltage | 3.53 | 3.51 | V |
| Comparative Voltage Drop | 0.23 | 0.26 | V |
| Comparative Samples | 83,282 | 3,050 | |
| Average Voltage Drop / Sample Cycle | 2.8 | 85 | μV |
| Full Battery Voltage | 4.1 | V | |
| Ending Battery Voltage | 3.53 | V | |
| Total Voltage Drop | 0.57 | V | |
| Total Samples | 126,705 | ||
| Average Voltage Drop / Sample Cycle over entire Hypnos battery life | 4.50 | μV |
| Hardware name | |
|---|---|
| Subject area | Environmental, Planetary and Agricultural Sciences |
| Hardware type | Electrical engineering and computer science |
| Open Source License | GNU General Public License v3.0 |
| Cost of Hardware | |
| Source File Repository | GitHub: |
| Design file name | File type | Open source license | Location of the file |
|---|---|---|---|
| Hypnos V3.2.brd | BRD | GPL 3.0 | |
| Hypnos V3.2.sch | SCH | GPL 3.0 | |
| Hypnos V3.2_Gerber.zip | ZIP | GPL 3.0 | |
| Hypnos V3.2_centroid.csv | CSV | GPL 3.0 |
| Designator | Component | Number | Cost per unit - USD | Total cost - | Source of materials | Material type |
|---|---|---|---|---|---|---|
| PMOS1, PMOS2 | MOSFET P-Ch 30 V 3.8A | 2 | $0.33 | $0.66 | Semiconductor | |
| PMOS3 | MOSFET P-Ch 30 V 4.3A | 1 | $0.39* | $0.39 | Semiconductor | |
| Q1, Q2 | MOSFET N-Ch 60 V 310 mA | 2 | $0.16 | $0.32 | Semiconductor | |
| R4, R11 | 100kΩ ± 1% 0.25 W Chip Resistor | 2 | $0.10 | $0.20 | Non-specific | |
| R1, R2 | 30kΩ ± 5% 0.25 W Chip Resistor | 2 | $0.10 | $0.20 | Non-specific | |
| MICROSD | MicroSD Card Socket | 1 | $1.95 | $1.95 | Non-specific | |
| RTC | Real Time Clock (RTC) IC Clock/Calendar i2c | 1 | $9.04* | $9.04 | Non-specific | |
| U$1, U$2 | Tactile Switch 50 mA 32 V | 2 | $0.34 | $0.68 | Non-specific | |
| B1 | Coin Cell Battery Holder, 12.0 mm | 1 | $0.91 | $0.91 | Non-specific | |
| R6, R7 | 10kΩ ± 5% 0.25 W Chip Resistor | 2 | $0.15 | $0.15 | Non-specific | |
| C1, C3 | 0.1µF ± 10% 100 V Ceramic Capacitor | 2 | $0.26* | $0.52 | Ceramic | |
| LED1, LED2 | Red 625 nm LED - Discrete 1.8 V | 2 | $0.50* | $1.00 | Non-specific | |
| R9 | 3kΩ ± 1% 0.25 W Chip Resistor | 1 | $0.10 | $0.10 | Non-specific | |
| R8 | 6.2kΩ ± 1% 0.25 W Chip Resistor | 1 | $0.23 | $0.23 | Non-specific | |
| C2, C4 | 100pF ± 5% 50 V Ceramic Capacitor | 2 | $0.10 | $0.20 | Ceramic | |
| D1 | Diode Schottky 20 V 1A | 1 | $0.44 | $0.44 | Non-specific |
| #include < SD.h> |
| // Date and time functions using a DS3231 RTC connected via i2c and Wire lib |
| #include “RTClib.h” |
| RTC_DS3231 rtc; |
| const int alarmPin = 12; |
| const int sdPin = 10; |
| const int analogPin = A0; // Analog pin to take values from |
| File myFile; // Test file object to write to on SD |
| void setup() |
| { |
| Serial.begin(9600); |
| pinMode(5, OUTPUT); |
| digitalWrite(5, LOW); // Sets pin 5, the pin with the 3.3 V rail, to output and enables the rail |
| pinMode(6, OUTPUT); |
| digitalWrite(6, HIGH); // Sets pin 6, the pin with the 5 V rail, to output and enables the rail |
| pinMode(sdPin, OUTPUT); |
| pinMode(alarmPin, INPUT_PULLUP); |
| // Checking if SD and RTC is active |
| if (!SD.begin(sdPin)) { |
| Serial.println(“initialization failed!”); |
| return; |
| } |
| Serial.println(“initialization done.”); |
| if (! rtc.begin()) { |
| Serial.println(“Couldn't find RTC”); |
| Serial.flush(); |
| abort(); |
| } |
| if (rtc.lostPower()) { |
| Serial.println(“RTC lost power, let's set the time!”); |
| // When time needs to be set on a new device, or after a power loss, the |
| // following line sets the RTC to the date & time this sketch was compiled |
| rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); |
| // This line sets the RTC with an explicit date & time, for example to set |
| // January 21, 2014 at 3am you would call: |
| // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0)); |
| } |
| // Disables and clears alarms |
| rtc.disableAlarm(1); |
| rtc.disableAlarm(2); |
| rtc.clearAlarm(1); |
| rtc.clearAlarm(2); |
| DateTime now = rtc.now(); // Get current time |
| // Print current time and date |
| char buff[] = “Start time is hh:mm:ss DDD, DD MMM YYYY”; |
| Serial.println(now.toString(buff)); |
| // Set alarm time |
| rtc.setAlarm1(now + TimeSpan(0, 0, 0, 10), DS3231_A1_Second); // In 10 s time |
| // open the file. note that only one file can be open at a time, |
| // so you have to close this one before opening another. |
| myFile = SD.open(“test.csv”, FILE_WRITE); |
| int testValue = analogRead(analogPin); |
| // if the file opened okay, write to it: |
| if (myFile) { |
| Serial.print(“Writing to test.csv…”); |
| myFile.println(testValue); |
| // close the file: |
| myFile.close(); |
| Serial.println(“done.”); |
| } else { |
| // if the file didn't open, print an error: |
| Serial.println(“error opening test.csv”); |
| } |
| } |
| void loop() |
| { |
| if (rtc.alarmFired(1) == true){ |
| // Print current time and date |
| DateTime now = rtc.now(); // Get the current time |
| char buff[] = “Alarm triggered at hh:mm:ss DDD, DD MMM YYYY”; |
| Serial.println(now.toString(buff)); |
| // Disable and clear alarm |
| //rtc.disableAlarm(1); // Not used as only disables the alarm on the SQW pin |
| rtc.clearAlarm(1); |
| // Perhaps reset to new time if required |
| rtc.setAlarm1(now + TimeSpan(0, 0, 0, 10), DS3231_A1_Second); // Set for another 10 s |
| } |
| digitalWrite(5, HIGH); // Disabling all pins before going to sleep. |
| digitalWrite(6, LOW); |
| pinMode(23, INPUT); // Disables SPI communication to SD before going to sleep |
| pinMode(24, INPUT); |
| pinMode(10, INPUT); |
| delay(3000); |
| digitalWrite(5, LOW); // Enabling all pins after wake up has completed. |
| digitalWrite(6, HIGH); |
| pinMode(10, OUTPUT); // Enables SPI communication to SD after going to sleep |
| pinMode(23, OUTPUT); |
| pinMode(24, OUTPUT); |
| } |