top of page

How it works

Simple Description

 

  1. RasPi runs my Python program to read the Internet bandwidth

  2. Python program calculates the servo position and sends that number to my Arduino sketch

  3. Arduino moves the servo (and therefore the gauge needle) to the position received from RasPi

  4. Wait 10 seconds... Repeat

 

Detailed Description

 

The data I need is from the router making the connection to the Internet. Routers maintain counters that I can query via SNMP (Simple Network Management Protocol).

 

snmpget is a Linux command used to read the current bytes for any interface on a specified device.

 

My Python program calls 'snmpget' to read the current bytes on the router's Internet interface. This data is just a number of bytes since the last reboot, so it must be read again and a per second number calculated. This number is then used to calculate the servo position (microsecond pulse width) necessary to move the gauge needle to the correct position. It's also at this point that I make adjustments to eliminate the servo accuracy problems. This adjusted number is sent to the Arduino.

 

The Auduino sketch waits for the data from the RasPi (Python program) and when received it slowly moves the servo.  "Slowly" is important.  The unmodified servo moves so quickly that the gauge needle will overshoot the expected position.  So the Arduino sketch has built in delays to move the needle slowly to the correct position.

 

Cost

Gauge

  • Lucky find on ebay

  • Needed to replace the face glass

  • Machine shop work

 

Arduino

 

Computer

 

Servo

 

Tests, learning, bad ideas

  • Stepper beginner kit

  • Servo beginner kit

  • Wireless idea

  • 8 experimental servos

  • Breadboard

  • Misc cable, connectors, and jumpers

 

$ 100

 

 

 

 

$ 50

 

 

 

$ 75

 

 

 

 

$ 20

 

 

$ 425

bottom of page