Giter Club home page Giter Club logo

narcoleptic's Introduction

Narcoleptic uses some features of the microcontroller to reduce power consumption.
These are:

  Sleep mode:
    Freezes all microcontroller functions to dramatically reduce power.
    
  128kHz internal oscillator:
    This is a very low power oscillator, used to inform the microcontroller when to
    wake up.

  Power reduction:
    Unused microcontroller functions can be powered down to save additional power.


Power saving tips:
  Narcoleptic only reduces the current used by the microcontroller. It does not
    reduce the current of anything connected to it.
  A power-on LED can use 20mA.
  A voltage regulator can use 15mA.
  The FTDI USB to serial chip uses about 15mA, so Arduino Duemilanoves and
    Diecimilas are not suitable for low power use without modification.
  Running at 3.3V and 8MHz uses much less energy than 5V at 16MHz.
  Pull-up and pull-down resistors use energy if they are passing current. Prefer
    normally-open switches over normally-closed. Consider using software pullups,
    and only turning them on when you need them.
  The Atmel ATmega328P data sheet has a section on "Minimising Power Consumption".

Narcoleptic tricks:
  The 128kHz oscillator is not very accurate. It drifts by ±4.5% over the full
  voltage and temperature ranges. Narcoleptic measures its speed against the main
  clock, and bases all its timings on the corrected value. Provided the operating
  voltage and temperature remain stable, Narcoleptic should maintain < ±1% accuracy.

  The 128kHz oscillator only provides sleep periods of 8,4,2,1 seconds, 500, 250,
  125, 62, 31 and 15ms. Narcoleptic performs multiple sleeps to achieve the requested
  timing.

Keeping track of time:
  Narcoleptic shuts down almost everything - even the millis() counting routine.
  To get around this, Narcoleptic keeps track of the time in sleep mode.
  
  If you replace: millis()
  with:           (millis() + Narcoleptic.millis())

  your timing calculations will take into account the time in sleep mode.


Narcoleptic gotchas:
  When doing a Narcoleptic.delay(), the following systems are frozen:
    Serial communication
    PWM outputs
    millis() ticker
    All timer activity
  
  Narcoleptic is best used when nothing is going on anyway, to simulate a power-off
  state.
  
  In a well optimised circuit, Narcoleptic can run for several years off
  a couple of AAA batteries.

narcoleptic's People

Contributors

cathedrow avatar brabl2 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.