Skip to content

Hypnos Updates

Winnie Woo edited this page Apr 4, 2023 · 35 revisions

Hypnos Updates | Main Page

September 27, 2021 - SD's CS pin reassigned

Author: Bryson Goto

  • CS pin changed from GPIO 10 to GPIO 11

The lab has been having pin conflicts when assembling a LoRa Ethernet Hub including the Hypnos board as the Adafruit Ethernet Featherwing. Both of these hardware use GPIO10 as their chip select (CS) pin and as a result, it prevents one or the other from functioning. To mitigate this, we've changed the CS pin to GPIO11 to avoid this pin conflict. We chose this pin because to our knowledge, GPIO11 is free from other commonly used hardware.


July 3, 2021 - HardwareX article published

Author: Bryson Goto

  • HardwareX publication released

After months of research and writing, the HardwareX article for the Hypnos has finally been released for publication! Special thanks to Bao Nguyen, Chet Udell, and John Selker as coauthors for this publication and opportunity. The link can be found here.


December 4, 2020 - HardwareX article and AGU conference

Author: Bryson Goto

  • Publications and Community Sharing

For the past couple of months, we have been working on writing a HardwareX article about the Hypnos board with the help of some other lab projects. As an open source project, we want our work to be shared with the community which is what inspired us to do this. It is in review right now and will be published in the future! Here is an abstract:

"Open source in-situ environmental sensor hardware continues to expand across the geosphere to a variety of applications. These 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. This is 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 PCB that can be dropped into any project to achieve these commonly-required capabilities. 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 microcontroller 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."

We are also presenting at the American Geophysical Union (AGU) Conference next week. There, we will be able to share our work with the community that include other engineers, scientists, researchers, and others!


July 29, 2020 - First batch manufactured

Author: Bao Nguyen

  • At least 50units has passed quality control
Show More

After set back for testing and redesign multiple, we finally decided to use a PCB/PCBA service right here in the US to make it happen. They assist the order in every step and respond with lightning speed, even for price quotes. Here is the picture of one board that got delivered.

In response to the need for Hypnos V3.2, I have cut some time from eDNA and make some testing tool for anyone who would like to pick up the Hypnos V3.2 now and for later quality control. Want to get the same pogo pin? Here

Important: This guide will mostly cover testing for uSD, RTC, and 3.3V rail. If you are worried about 5V rail and higher voltage rail, you should test them using a multi-meter. The code already covers activating those rails.

Step1: Insert your uSD and coin cell into the Hypnos V3.2. USB cable to the Feather and hold them like a sandwich for electrical connection.

Step2: Open Arduino Serial monitor (baudrate 9600) and you should see something like below. If not unplug your USB and reconnect, reopen your serial monitor ASAP.

Step3: You should see the 3VRail LED turn on constantly while the 5VRail LED would blink around 3 seconds.

Step4: Unplug and plug the USB again, you should not see "RTC lost power ....". This mean that the backup battery is working.

Step5: Mark the uSD holder if pass, then go out and sense something!!

Step6: Unplug the Feather to reset uSD info, repeat for the next board.

If the PCB manufacture did everything right, these should be all of the steps you need for 3VRail quality control. 5V and higher voltage rail are not ICs and they are less likely to fail.

Here is the code I use (non Loom): RTC SD.zip


January 27, 2020 - Diode Implemented

Author: Bao Nguyen

  • uSD current leak is minimized down to ~1.9 uA
Show More

After testing 3 diodes mentioned from the previous post, the SM5817PL-TP give us only 1.9uA leakage from the uSD VCC pin when all of the SPI pins are set HIGH and 3VRAIL is off. The 3V led only lit up dimly since the current is so low. Forward voltage drop when powering SD card was 255.3 mV.

This diode has been implemented in the most recent PCB push on GitHub.

Here are the battery current draw (Li-po connector) data on Feather M0 Proto:

Test mode Mastech Multimeter AstroAI Multimeter
SPI(disable) + Hypnos + Loom Sleep 170uA 170uA
SPI(disable) + Loom Sleep 220uA 227uA
SPI(enable) + Hypnos + Loom Sleep 414uA
SPI(enable) + Loom Sleep 115uA

Thank you Max Chu for providing the test result.

Test code for leakage current - diode: Hypnos_SD_power.zip


January 3, 2020 - Diode choice

Author: Bao Nguyen

  • Can we pick a diode that has lower leakage current?
Show More

Operating voltage of uSD is 2.7V to 3.3V. The first spec is that forward voltage drop at 150mA need to be lower than 0.5V. If voltage drop exceed this number, the SD card is not guaranty to have enough power to write. Next criteria would be low reverse current at 3.3V reverse voltage.

In the previous post, we use CUS10S30 . This diode has low enough forward voltage drop and 30uA leakage current at 3.3V. 30uA and 1.7V (after reverse voltage drop) is enough to light up the power LED.

Let's pick an diode with lower leakage current:

  • SM5817PL-TP - Vf 0.3V at 200mA, 3uA reverse current at 3.3V
  • SBR2A40P1-7 - Vf 0.35V at 200mA, 8uA reserse current at 3.3V
  • DFLS140-7 - Vf 0.4V at 200mA, 1uA reserse current at 3.3V

Test code for leakage current - diode: testcode.zip


January 2, 2020 - Hardware fix limitation

Author: Bao Nguyen

  • A diode can reduce current draw to 30uA
Show More

The current issue is that when the Feather goes to sleep, there is a 300uA leak when 3.3V rail is shutdown and SPI pins return to pulled up. The first attempt for the hardware patch is adding a Schottky diode like below. The probes are between the 3.3V RAIL and the VCC of the uSD card. uSD card has operating voltage : 2.7V to 3.3V.

Just like any other SD card code, once communication is completed, the 3V3 rail is switched off. With the diode, we go from 300uA to around 30 uA. With 30 uA, the 3.3V LED will still turn on dimly.

We were able to to archive 0uA (based on the accuracy of the multi-meter), with and without the diode through software.

digitalWrite(5, HIGH); //< Disabling all pins before going to sleep.
digitalWrite(6, LOW);
pinMode(23, INPUT);
pinMode(24, INPUT);
pinMode(10, INPUT);

0uA 0uA

The hardware can help reduce sleep current down to 10 times, but software fix will be best.


November 25, 2019 - Software fix for Hypnos V2 under testing

Author: Bao Nguyen + Grayston

  • SD card seem to have it SPI pins leak current back to 3Vrail
Show More To find a fix with Loom, Marshal Horn has suggested a patch by re-config the mode of the SPI pins.

The easiest way to interface the Hypnos with Loom is externally though the Arduino Sketch:

  1. In setup, as close to the beginning as makes sense, insert the following.:
pinMode(5, OUTPUT);
digitalWrite(5, LOW); // Sets pin 5, the pin with the 3.3V rail, to output and enables the rail
pinMode(6, OUTPUT);
digitalWrite(6, HIGH); // Sets pin 6, the pin with the 5V rail, to output and enables the rail
  1. To make ensure Loom is aware of the components on board, the following needs to be added to the config json within the 'components' array:
{\
'name':'SD',\
'params':'default'\
},\
{\
'name':'DS3231',\
'params':'default'\
}\

This sets up the DS3231 RTC for time stamping and interrupts, as well as the SD for reading and writing. If the SD card fails to initialize consistently, ensure your enabling the power rails as the SD needs them to function.

  1. Within your main loop, place the following code before and after the Loom.sleep() function:

Before:

digitalWrite(5, HIGH); //< Disabling all pins before going to sleep.
digitalWrite(6, LOW);
pinMode(23, INPUT);
pinMode(24, INPUT);
pinMode(10, INPUT);

After:

digitalWrite(5, LOW); //< Enabling all pins after wake up has completed.
digitalWrite(6, HIGH);
pinMode(10, OUTPUT);
pinMode(23, OUTPUT);
pinMode(24, OUTPUT);

The fix is under testing by Max and will be flashed for longer term testing for SmartRock project.


November 14, 2019 - SDcard current draw test

Author: Bao Nguyen

  • Testing current from SD card to determine bug fix
Show More Here is the test with SD.h library: With Sandisk 16Gb Black
State Current
Idle 0.81 mA
Read/Write 23mA

With Sandisk Ultra 16Gb

State Current
Idle 0.73 mA
Read/Write 20mA

Here is the test with SDFat.h library: With Sandisk 16Gb Black

State Current
Idle 0.93 mA
Read/Write 13.75 mA
Sleep 0.18 mA

With Sandisk Ultra 16Gb

State Current
Idle 0.86 mA
Read/Write 14.4 mA
Sleep 0.17 mA

PS: Thank you Max for his rigorous testing of the Hypnos V2. He helped identified the source of current leak.


November 12, 2019 - Hypnos V2 Bug Found

Author: Bao Nguyen

  • 3VRail does not turn off completely if there is SD card.
Show More After some testing with the code, it seems that the CS (Chip Select) is leaking current back into the 3VRAIL after the rail has been cur off. The schematic shows that CS is pulled up to 3VRAIL => 3.3V from I/0 will source the 3VRAIL when released from communication protocol. Removing the 80k that pulls the system up to 3VRAIL seems to help if SD card is not initialized.

The current leak is detected from MOSI, MISO, CLK when the SD card is initialized. One suggestion from Marshal Horn that a Schottky Diode with low forward voltage drop should be placed between the 3.3VRAIL and the SD card VCC. This can prevent current from flowing back to the rail and turn on the LED.

PS: Dr.Chet wanted the LED for easier troubleshooting, and it really helped.


October 21, 2019 - Hypnos V2 Bug Found

Author: Bao Nguyen

  • 5V line for the final PCB does not work. Bug found and fixed.
Show More Bug found at N-MOSFET for the 5V rail. The footprint layout swap the Drain and Gate. The fix has been applied for the latest push.

October 2, 2019 - Hypnos V2 testing

Author: Bao Nguyen

  • LEDs, 5V current draw work as expected
Show More

At the moment, V1 is still out for long term basic functionality tests like RTC and SD cards. Back in the lab, V2 PBCs have arrived but only the MOSFET circuitry is soldered. As the test to simplified the circuit in comparison to V1, two resistors are removed and shorted. With this new circuit, the LEDs light up as expected, good voltage output.

To test the trace width and Mosfet capability, 15-ohm resistor is placed across GND and 5V rail. The current draw is recorded as 0.3A with voltage drop at 5Vrail -> 4.7 Volts. With the design, 0.3A should be the max current for the 5V rail. More tests will be performed on the 3Vrail for later updates.

Extra: Shorting the EN and GND would shutdown the 3.3V regulator. This is a neat trick for "shipping mode". User once received the board can just remove the jumper and the system would boot up normally.


September 20, 2019 - Hypnos V2 Development

Author: Bao Nguyen

  • Refine Hypnos V1 design with LEDs
Show More

While Hypnos V1 is still going through testing, functionality is stable. To make troubleshoot the code/hardware easier, some LEDs is added for each power rail. This LED only turn on when the rails are being switched on. Some improvement from the old design to ensure the proper functioning of Feather. Here are the changes made from V1 to V2:

  • Add 2 low power LEDs with current limiting resistors
  • RTC is now powered from 3V3 instead of Vbat (using power from Vbat turns on Feather Battery Charger LED)
  • Pull up resistor for SD chip select just like adalogger
  • Rounded PCB corner
  • Move the reset button to the middle of the board - mechanically more stable
  • Add solder jumper for RTC-INT, normally connected

September 11, 2019 - Hypnos V1 is stable

Author: Bao Nguyen

  • Hypnos V1 proves that it is fully functional
Show More Hypnos is sent out to 3 different projects for long term testing and also design feedback.

The project that use Hypnos V1 for testing are:

  • Sitkanet
  • Loom
  • SmartRock

Once Hypnos V1 is tested for long term deployment, Hypnos V2 will be ordered + test for extra functionality.


September 10, 2019 - SD card fail to initialize

Author: Bao Nguyen

  • SD card fails to initialize, power rail was not turn on before accessing the card
Show More

When testing the first Hypnos PCB, we was able to get the power control as well as RTC DS3231 to work. However, for the SD card, we couldn't get the same behavior as Adafruit Adalogger. The sample sketch that we ran is called Datalogger in File -> Examples -> SD -> Datalogger.

The Serial Monitor keeps saying the SD card fails to initialize. The SD card is powered when pin 5 is set to LOW, however, digitalWrite(5, LOW); is in the loop(). When the setup() is run, the code check for the SD card, but the card is not yet powered so the program stuck in a while(1) loop. By moving digitalWrite(5, LOW) to setup(), the SD card work as expected.

Clone this wiki locally