( ! ) Warning: Declaration of Suffusion_MM_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = NULL, $id = 0) in /var/www/public/arduino/wp-content/themes/suffusion/library/suffusion-walkers.php on line 0
Call Stack
10.0001341232{main}( ).../index.php:0
20.0001341408require( '/var/www/public/arduino/wp-blog-header.php' ).../index.php:17
31.07084963872require_once( '/var/www/public/arduino/wp-includes/template-loader.php' ).../wp-blog-header.php:19
41.07564979264include( '/var/www/public/arduino/wp-content/themes/suffusion/single.php' ).../template-loader.php:98
51.07564979264get_header( ).../single.php:6
61.07564979536locate_template( ).../general-template.php:41
71.07564979616load_template( ).../template.php:671
81.07574979960require_once( '/var/www/public/arduino/wp-content/themes/suffusion/header.php' ).../template.php:722
91.08304991224wp_head( ).../header.php:50
101.08304991224do_action( ).../general-template.php:2879
111.08304991496WP_Hook->do_action( ).../plugin.php:478
121.08304991496WP_Hook->apply_filters( ).../class-wp-hook.php:312
131.10805036160Suffusion_Framework->specific( ).../class-wp-hook.php:288
141.10845036352require_if_theme_supports( ).../framework.php:230
ian. 022013


Since we are involved in off grid solar power systems, we have a need to monitor battery voltage. The Arduino can do this easily with a simple voltage divider. With some simple mods, we can control loads, generators, or notifications based on battery voltage.

To read a maximum of 20vdc, R1 should be 3k ohm, R2 should be 1k ohm, and the code would be as follows:

DisplayMoreThan5V sketch
prints the voltage on analog pin to the serial port
Do not connect more than 5 volts directly to an Arduino pin.

const int referenceVolts = 5; // the default reference on a 5-volt board
//const float referenceVolts = 3.3; // use this for a 3.3-volt board

const int R1 = 3000; // value for a maximum voltage of 20 volts
const int R2 = 1000;
// determine by voltage divider resistors, see text
const int resistorFactor = 255 / (R2/(R1 + R2));
const int batteryPin = 0; // +V from battery is connected to analog pin 0

void setup()

void loop()
int val = analogRead(batteryPin); // read the value from the sensor
float volts = (val / resistorFactor) * referenceVolts ; // calculate the ratio
Serial.println(volts); // print the value in volts


Sursa articol :http://arduinotronics.blogspot.ro/2011/03/monitoring-voltage-of-dc-battery-supply.html

 Posted by at 01:51

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>