element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experimenting with Current Sense Amplifiers
  • Challenges & Projects
  • Design Challenges
  • Experimenting with Current Sense Amplifiers
  • More
  • Cancel
Experimenting with Current Sense Amplifiers
Challenge Blog Blog #9: Measuring USB Flash Disk Power Consumption
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: misaz
  • Date Created: 31 May 2022 10:47 PM Date Created
  • Views 9824 views
  • Likes 8 likes
  • Comments 4 comments
  • Current 6 Click
  • MikroE Click Board
  • Experiment
  • python
  • pcb
  • usb
  • csa
  • Pï 3 Click Shield
  • current sense amplifier
  • MAX40080
  • Experimenting with Current Sense Amplifiers
Related
Recommended

Blog #9: Measuring USB Flash Disk Power Consumption

misaz
misaz
31 May 2022
Blog #9: Measuring USB Flash Disk Power Consumption

I welcome you to my 9th blog as part of Experimenting with Current Sense Amplifiers Design Challenge. In my first blog post #1 I described my experiment plans as part of this contest. In blogs #2, #3 and #4 I shown basic usage of MAX40080 Current Sense Amplifier sensor. Then in blog posts #5, #6 and #7 I introduced my libraries which I created as part contest for simplifying usage of MAX40080 CSA sensor. Finally in previous blog post #8 I introduced my CLI utility which I will use as part of experiment described in this blog post. In this and next blog post I show my experiment with monitoring current consumption of USB devices. Both blog posts will show similar setup but with different purposes. In this blog post I will show measuring power consumption of flash drive connected to Raspberry Pi and in next blog post I will show self-monitoring of current consumption (Raspberry Pi will monitor his own power consumption).

For measuring power consumption of USB device, you need to connect CSA or amperemeter somewhere between USB port and USB device. So, at beginning you are in following simple situation. You have Raspberry Pi, and you have Flash drive:

image

This is standard approach of connecting flash drive to the Raspberry Pi (or PC) but for measuring power consumption it is quite impractical. So instead of direct connection we can use extension cable:

image

This connection is better because we have cable which we can modify for attaching CSA (or amperemeter). We can remove isolation in the middle of cable, cut VBUS wire and connect CSA here, but this approach destroys the cable, so I designed a better way. I designed my own PCB which have two USB connectors (left and right) and directly connects data and GND wires but splits the VBUS line. Splitted VBUS line allow me to connect CSA here. Schematic of this board is shown on following diagram.

image

You can see two USB connectors. They are different type. One of them is USB A (which is standard USB 2.0 socket) and second is micro B. Data wires are directly connected and I added test points on some signals for possible future use. VBUS line is connected to jumper which can be used for directly connecting VBUS wires of left and right connector when CSA is not attached. And finally, there is terminal block for connecting CSA.

After placing components to the bord, it looked as follows:

image

I ordered this board as OSH park. Because it is very small, it cost only $3.10 (for 3 pieces). After about month I received it and it is shown on following photo:

image

Finally, after assembling components onto it, it looks as follows:

image

So now I can place this board to the setup and connect CSA to the circuit. Note that I need to change USB cable.

image

Connection is complete. Let’s experiment!

Measuring flash drive power consumption

I will show experiment on video which replaces about 1000 words Blush

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

https://www.youtube.com/watch?v=o3_bO_oeTh0

Results

image

At the video you have seen results visualized on the following image. We can see that Sony flash drive used as part of experiment consume about 73 milliamperes when it is idle and regularly do some tasks which make 4 mA power consumption peaks at regular interval. When reading the flash driver current consumption double to about 150 mA and oscillates. In plots we can see pattern created by blinking LED. When writing data to the flash drive it behaves completely differently and two patters are repeated. I guess that one part is erase and second part is writing data to the previously erased flash cells.

image

I tried experiment with few other flash drives, so let’s see differences.

ADATA USB 3.0 32GB Flash Drive

image

I run the same script against flash disk on the image above. While it is designed as USB 3.0, my board, cable, and Raspberry Pi 3B are limited to USB 2.0 only. The power consumption of this flash disk look as follows:

image

When this USB flash is idle, it is significantly more efficient. In idle state it consumes only 38 mA in comparison with SONY flash drive which consumed 73 mA. Similarly, it consumes less energy when reading and writing data. Note that while it consumes less current it is still faster. This flash drive has no LED so patterns disappeared. Interestingly we can’t see any pattern when writing data. It looks like driver works in completely different way. We can see that when writing data, power consumption oscillated between idle state (38 mA) and about 125 mA. It is most probably because flash drive is designed as USB 3.0 and we are using only USB 2.0 bus, so experiment can’t saturate the flash drive performance capacity completely.

Non-branded flash drive received from marketing campaign

As a next model I chosen this non-branded flash drive, which I received for free somewhere (most probably when I was registering my website domain first time, but it is not important now). It is USB 2.0 only and its capacity is 16 GB.

image

Results was following:

image

This flash drive has LED so there some patterns appeared again. Otherwise, behaviour looks similar to previous one. Idle consumption is slightly higher (50mA), reading consumption is similar but this flash drive is more efficient when writing data. When writing power consumption is about 80mA excepts short peaks in comparison with 120 mA power consumption of previous model. But note that this model is slower.

SanDisk 8GB

At last, I applied the same procedure to SanDisk flash drive visualized at following photo. Its capacity is 8 GB and supported interface is only USB 2.0.

image

Results are following:

image

This is the most efficient USB flash drive which I have tested. At idle consumes only 28 mA. When reading power consumption is 60 mA and 80 mA when writing. Flash drive is the slowest one in case of write operation and interestingly it alternates between idle power consumption and 80 mA power consumption. It looks like flash drive interleaves write operation with time slots when it efficiently does nothing. Similarly at middle of the transfer it started to do something completely different and power consumption changed behaviour for the while.

Resources

If you are interested in trying this experiment yourself, you can download all resources which I have used in experiment, you can freely use download links below. I also attached collected data, so you can run visualization script yourself and freely zoom into the data or do other types of analysis. You can download schematics, gerbers and folder containing Kicad project of PCB used in experiment. There is also link to OSHPark where you order board easily. You can also download source codes of shell script and python script for plotting data. Finally, there are links to Gtihub page of MAX40080 utility which I described in detail in previous blog post #8.

  • MAX40080 CLI Utility (Github)
  • Schematics (PDF)
  • Gerbers (ZIP)
  • Kicad project (ZIP)
  • OSHPark direct link: (3 pcs cost 3.10$ and free international shipping as of 2022-05-31)
  • collect_data.sh script (SH)
  • plot.py script (PY)
  • Collected data (ZIP)

Last words

Thank you for reading this blog post and watching video. In the next blog post I will shown my experiment promised in first blog – self monitoring power consumption of Raspberry Pi. Experiment will be very similar to this experiment, but connection will be slightly different and power consumption will behave differently. At the time of writing this blog post one weak remains before contest deadline. I completed all my experiments promised in first blog (and little bit more), but I need to write related blog posts which is quite time consuming. Similarly recording video took me a lot of time.

Thank you for your attention and stay tuned to my next blog posts about my experiments. Thank you very much.

Next blog: Blog #10: Raspberry Pi Self Power Consumption Measurement

  • Sign in to reply
  • misaz
    misaz over 3 years ago in reply to aspork42

    Thank you for feedback. Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • aspork42
    aspork42 over 3 years ago

    Nice write up and great job on the automated scripting! That was super slick.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • misaz
    misaz over 3 years ago

    EDIT 2022-06-03:

    - Updated text in Resources section to be more clear.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • misaz
    misaz over 3 years ago

    EDIT 2022-06-01:

    - Video was fixed and it is avalaible now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube