element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Arduino
  • Products
  • More
Arduino
Blog Sleepy Blink
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 10 Jul 2016 11:20 AM Date Created
  • Views 1027 views
  • Likes 4 likes
  • Comments 6 comments
  • arduino uno
  • 4tronix
Related
Recommended

Sleepy Blink

Workshopshed
Workshopshed
10 Jul 2016

I've been given a new board from 4tronix to RoadTest, which is compatible with an Arduino UNO but with a significantly different form factor. The board is still in beta so has yet to gain a proper name.

image

The board is 27mm in diameter about the same size as a£2 coin it has a ATMega328P-AU microcontroller and a CH340G USB interface A blue LED is attached to pin 13 4 digital and 4 analogue pins are broken out along each size with the power connectors top and bottom

 

On the back of the board is a rechargeable Lithium ION coin cell which 4tronix thought should have a run time of about 1 hour. There is a small power switch so you can turn it off to save the battery or to speed up charging.

 

My first thought was to see if we could increase that with some power management. So I created the following "sleepyblink" code which flashes the LED for just 100ms before sleeping for 1s. The board uploads quickly, although I did see that the board changed COM port number when I powered it off an on which might cause irritation when programming it.

 

 

//Library from http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/#sthash.PhJ0PF9f.dpuf
#include "LowPower.h"
int ledPin = 13;                 // LED connected to pin 13
void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  delay(5000);                 // Nice long delay to help with reprogramming    
}
void loop()
{
  digitalWrite(ledPin, HIGH);    // sets the LED off
  delay(100);
  digitalWrite(ledPin, LOW);   // sets the LED on
  //Sleep
  LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);
}

 

The battery lasted over 33hrs, it stopped over night whilst I was asleep so I know it was less than 41hrs.

 

Next up is to make a simple badge.

  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 8 years ago in reply to Workshopshed +1
    As long as the SLEEP_MODE_PWR_DOWN is used, it should be the same. That is the maximum sleep mode. The Timers and so will be turned off, but an output pin keeps its output level. Perhaps the CH340G is…
  • beacon_dave
    beacon_dave over 8 years ago in reply to Workshopshed +1
    Atmel have an application note on reducing power consumption which may be of interest. AVR4013: picoPower Basics http://www.atmel.com/Images/doc8349.pdf There is also some related content on the Atmel…
  • Workshopshed
    Workshopshed over 8 years ago in reply to Former Member

    Had a chat with 4troniks and they mentioned that the CH340G is powered from the battery in the version I have but they plan to revise the design to power it from USB instead.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 8 years ago in reply to Workshopshed

    Atmel have an application note on reducing power consumption which may be of interest.

     

    AVR4013: picoPower Basics

    http://www.atmel.com/Images/doc8349.pdf

     

    There is also some related content on the Atmel YouTube channel which may be of interest.

     

    Getting Started with AVR: Making Our Simple App Low Power (#6) 

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

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago in reply to Workshopshed

    As long as the SLEEP_MODE_PWR_DOWN is used, it should be the same. That is the maximum sleep mode.

    The Timers and so will be turned off, but an output pin keeps its output level.

    Perhaps the CH340G is only powered via the USB ? Or is there current leakage via the unpowered CH340G chip ?

     

    Your led is now 1/10 of the time turned on. If you make a 50ms flash every 2 minutes, then it will be 1/2400 and perhaps it will run for weeks.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 8 years ago in reply to Former Member

    Thanks Koepel, I would suspect that the CH340G is powered but I've checked with the supplier.

    I wanted to mimic the default blink app hence my choice of 1s, but you are right I could gain a bit more with a shorter delay. I don't know if there is a low power mode that keeps the outputs high?

    I've taken a look at narcoleptic it's nice how it does a direct replacement for delay and millis but I think it pretty much does the same as the other library.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago

    The 33hrs is not a long time, I think you can do better.

     

    Is a schematic available ? To check if the CH340G is not using power ?

    The Power_Down mode is the maximum sleep mode.

    I use the Narcoleptic library. It can sleep longer than 8 seconds, because the library takes care of going into sleep again after 8 seconds until the total time is reached.

     

    Turning on a led during 100 milliseconds every second is a lot. Have you seen the led of a smoke detector ? It is a very short flash with a very long time in between.

     

    This is a full explanation and tests : http://www.gammon.com.au/power

    • 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