OPEnSLab-OSU / OPEnS-Hypnos

Power Control Board for microcontroller projects, designed at OPEnS Lab OSU.
https://github.com/OPEnSLab-OSU/OPEnS-Lab-Home/wiki/Hypnos
GNU General Public License v3.0
5 stars 0 forks source link

Measuring SD card current #1

Closed kamocat closed 4 years ago

kamocat commented 4 years ago

Currently there isn't a way of measuring the current consumption of the SD card separate from the reset of the system. A simple 1-ohm high-side sense resistor would allow measurement, requiring minimal board space. Optionally, this signal could be wired back and monitored by the Feather.

Benefits of measuring the SD card current:

baonguyen21 commented 4 years ago

The issue has been viewed. What do you think is the best way to read the voltage drop across the resistor, just an analog pin? Do you think that the drop through the MOSfet also effect the reading? At the moment, the LOOM team report that the analogRead from Feather M0 is not working properly.

kamocat commented 4 years ago

Maybe you're right, that no-one is going to measure the current from the Feather. I found a different issue that complicates this, though. My SD card seems to be feeding power back into the 3.3V rail through the SPI bus. I haven't tried a current test (because I don't wish to break the SD card), but it's enough to turn on the LED. I think it's getting the power either from MOSI or SCK, because setting CS low didn't completely fix it. Maybe a schottkey diode would do it? I guess the simple answer is that if I want the feather to sleep, I need to disable all the output drivers first.

baonguyen21 commented 4 years ago

Did you have the SD card inserted then started the SPI protocol? I am trying to replicate the issue on my end for troubleshooting.

kamocat commented 4 years ago

Closing this issue. I changed my mind about the current consumption, I can put a sense resistor on the 3v3 rail if I want.