Git Product home page Git Product logo

tacho's Introduction

Tacho

Python script to drive a tachometer on Raspberry Pi GPIO using PWM

Screenshot

Required hardware and schematics

The components needed to drive a standard automotive RPM gauge are pretty simple. You need:

  • 12V power source (or battery) for the gauge
  • Optocoupler 4N25 to separate the gauge signal and Raspberry Pi GPIO.
  • 75 (or so) Ohm resistor for optocoupler input
  • 20kOhm resistor for pull-down for gauge signal line (might depend on gauge)

The script assumes BCM GPIO 4 (Pin 7 in Rasperry Pi) to be used for driving the gauge. Pin 9 is used for the ground. Opto-isolator acts like normal led, so putting a small ~75 Ohm resistor makes it ok with 3.3V.

The Hz is calibrated to specific hardware using the calibration array in the beginning of the script. You probably need to adjust the numbers here to make it match your hardware. Mine had huge variations especially between 4 to 6.

Operating modes

Run the script by giving the operating more as the first parameter:

  • test - Goes trhough test cycle setting values from 1 to 8
  • [value] - displays the given float value between 1-8
  • cpu - displays CPU load percentage from 0 up to 80%
  • network - displays network inbound traffic in MB/s.
  • mqtt [server] [topic] - subscribes to MQTT broker / topic for values.

Optional 'quiet' parameter disables the console output.

For example the following puts the script to refresh CPU on the background

sudo ./tacho.py cpu quiet &

Note, that because GPIO on RPi needs root access 'sudo' must be used.

tacho's People

Contributors

samie avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

offbye

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.