Coder Social home page Coder Social logo

mildsunrise / power-trinket Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 54 KB

〽️ DC power monitoring using a Trinket and INA219 breakout

License: GNU Lesser General Public License v3.0

Python 14.36% C++ 85.64%
attiny85 adafruit trinket power-meter usb

power-trinket's Introduction

power-trinket

Little project that uses the Trinket and INA219 current sensor breakout from Adafruit to monitor the power consumption of a DC device, using up to 26V and 3.2A, and shows realtime lectures of voltage, current and power.

Software screenshot

Communication is done via TrinketFakeUsbSerial which is explained in Adafruit Learning System.

Install

You should have Python, PIP and libusb installed.
On Debian-based OSes, you can do:

sudo apt-get install python-dev python-pip libusb-1.0-0

Then install the PyUSB and docopt Python modules:

sudo pip install pyusb docopt

You will also need the Arduino IDE, correctly configured to use the Trinket, and with the TrinketFakeUsbSerial and TinyWireM libraries installed.

Now go on and use it!

Use

You need a 5V Trinket working at 16MHz to use this. Upload the sketch and build the following circuit:

Sketch breadboard view

Connect the load and power supply, plug the Trinket via USB, and run the Python script:

python power-trinket.py

If everything goes well, the Trinket will be detected as soon as it boots the sketch and the script will start displaying realtime lectures at the console.

You can see which options it accepts with:

python power-trinket.py --help

power-trinket's People

Contributors

mildsunrise avatar

Stargazers

 avatar

Watchers

 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.