( ! ) 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 39
Call Stack
10.0002343224{main}( ).../index.php:0
20.0004344912require( '/var/www/public/arduino/wp-blog-header.php' ).../index.php:17
30.60374980200require_once( '/var/www/public/arduino/wp-includes/template-loader.php' ).../wp-blog-header.php:19
40.60844994728include( '/var/www/public/arduino/wp-content/themes/suffusion/single.php' ).../template-loader.php:98
50.60844994728get_header( ).../single.php:6
60.60844995000locate_template( ).../general-template.php:41
70.60854995080load_template( ).../template.php:671
80.60885006840require_once( '/var/www/public/arduino/wp-content/themes/suffusion/header.php' ).../template.php:722
90.61675018200wp_head( ).../header.php:50
100.61675018200do_action( ).../general-template.php:2879
110.61675018472WP_Hook->do_action( ).../plugin.php:478
120.61685018472WP_Hook->apply_filters( ).../class-wp-hook.php:312
130.64215063136Suffusion_Framework->specific( ).../class-wp-hook.php:288
140.64255063328require_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>