( ! ) 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
#TimeMemoryFunctionLocation
10.0002342624{main}( ).../index.php:0
20.0004344312require( '/var/www/public/arduino/wp-blog-header.php' ).../index.php:17
30.690026853176require_once( '/var/www/public/arduino/wp-includes/template-loader.php' ).../wp-blog-header.php:19
40.692526867704include( '/var/www/public/arduino/wp-content/themes/suffusion/single.php' ).../template-loader.php:98
50.692526867704get_header( ).../single.php:6
60.692526867976locate_template( ).../general-template.php:41
70.692526868056load_template( ).../template.php:671
80.692826879816require_once( '/var/www/public/arduino/wp-content/themes/suffusion/header.php' ).../template.php:722
90.696626889960wp_head( ).../header.php:50
100.696626889960do_action( ).../general-template.php:2879
110.696726890232WP_Hook->do_action( ).../plugin.php:478
120.696726890232WP_Hook->apply_filters( ).../class-wp-hook.php:312
130.707626934624Suffusion_Framework->specific( ).../class-wp-hook.php:288
140.707826934816require_if_theme_supports( ).../framework.php:230
ian. 022013
 

volts[1]

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()
{
Serial.begin(9600);
}

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>

(necesar)

(required)