A place to document my Arduino Projects. Living in a Solar Powered home for many years offers a wealth of ways to use Arduino's and connected sensors. Exploring how Arduino's work and what they can be used for.
Friday, December 3, 2010
My Laptop died!
My Dell XPS 1710 died with a fried or unsoldered display driver chip from what I can gleam from Google. I was never happy with it so I'm shopping for a new cheap laptop. I'll get back to my projects when I get all this sorted and extract my data from the Dell.
Saturday, November 20, 2010
Xbee and newsoftserial
Receiver Xbee/Arduino very simple newsoftserial |
Sensor Xbee test board. Three inputs for the A/D's selectable. |
I used X-CTU to configure all Xbee's .
The receiver Xbee is default (transparent mode) with a PAN ID that agrees with all of your transmitter Xbee's. Set all the baud rates the same. This is so you only receive data from YOUR transmitters!
I used one Xbee for transmission, it has three AD inputs A0,A1,A3 active. Configured as follows:
MY (16bit source) = 1 the first and only unit transmitting at this PAN ID
SLEEP MODE = 4 cyclic wakeup every 2 seconds transmit data go to sleep
ST =3 Time after last sample to go back to sleep. (ms)
SP = C8 sleep period 2 seconds (Hex in 10ms steps)
D0, D1, D3 = 2 This enables A/D on these inputs
IT = 4 sample each input 4 times
IR =1 time (ms) between samples
Thats all; just supply this Xbee with power and hook up the three inputs. You will see the power lite blink every 2 seconds and if you look closely the red data lite blinks also for the one RF packet that is sent.
Set up newsoftserial between the receiver Xbee and the Arduino like the Adafruit example
In my example the sampled RF packet bytes = 35 as follows:
7E, 0, 20, 83, 0, 1, 4F, 0, 4, 16, 0, 1, C1, 0, 9C, 3, 64, 1, C1, 0, 9C, 3, 64, 1, C2, 0, 9C, 3, 64, 1, C1, 0, 9C, 3, 64, FD,
My code to test xbeePacketsize
Quick view of my Headers:
8 bytes of RF header; 3 bytes of Data header; Data values, checksum.
- 7E Packet start delimiter
- 00 MSB length
- 20 LSB length Length is 32 + 3 bytes already; end is at byte 35
- 83 ATI identifer..receive 16 address packet data, the only mode I use.
- 00 MSB 16 bit source address
- 01 LSB 16 bit source address in my case 1
- 4F RSS RF signal strength -75dBm. I'll plot this vs distance soon. This is typical for wireless.
- 00 reserved Options
- 04 Total number of data samples (a/d conversions) 4 in my case
- 16 bitwise indication of channels enabled A/D see manual. This is how you setup the transmitting Xbee.
- 00 bitwise indication of digital enabled pins on the transmitting Xbee. None in my case.
- 01 MSB A/D first conversion for pin A0 in my case. 1*256 + LSB
- AB LSB A/D first conversion for pin A0. Value is MSB + 160 + 11 or 427 (0-1023 possible)
Remember I count from 1's but arrays are indexed from 0. I sometimes mix them up, be careful! Count!
My data starts at byte[11] and ends at byte[34] and byte[35] is the checksum. My case 3channels*4samples*2bytes/value = 24 more bytes. 11 + 24 inclusive is 34. 34 is the last data byte.
All data in this xbee mode will start at byte[11] and be (num sampled channels) * (num A/D conversions) * 2 bytes of data long.
It is simple to now fill a dataArray[3][4] with the outputs of the xbee A/D values for each conversion
My code xbeeDataArray
Hope this helps.
Saturday, November 6, 2010
Arduino Solar Battery Monitor
Overview
The primary battery in my Solar Powered Home is a series of 4, 6 volt 395 Amp-hrs deep-cycle lead acid batteries. The capacity of this 24 volt battery system is about 9.5 kwHr. This Arduino project measures the power into and out of the battery and the battery voltage and displays on a 2x16 LCD display the current charge state of the battery along with other useful information.
Setup of the sensors
The cables connected to this battery are large and the currents high (~60 amps max). As a current sensor I used a hall effect CSLA2CD made by Honeywell Control. I had to splice in a smaller Battery cable to go thru the sensor. The sensor output saturates at about +/- 70 amps and the output is about +/- 33mv/amp with zero amps being the mid point of the sensor power supply, in my setup 8 volts.
A small protoboard has all the sensor electronics and is located near the batteries and draws power from them. The 24 volts is regulated down to 8 volts for the hall effect current sensor and the 24 volt input is divided by ~ 1/6 to be suited for an Arduino A/D input. The two sensor outputs and a ground are wired back the the Arduino board which is located in a more convenient place several metres distant.
----------Schematic-coming soon----------
Arduino and LCD display
The Arduino and LCD display are wired up the same as the Adafruit project here with the two sensor inputs on A/D 0 and 1. A0 for the current to and from the battery and A1 the battery voltage. I have used two of the Arduino's PWM outputs for the LCD back light and contrast.
The LCD displays two pages of information alternating 3 seconds each.
Page 1: battery voltage, battery current, state of charge %, fully charged = 100%, battery mode: charging, discharging, absorb and equalize.
Page 2: Today's stats in minutes reset at dawn
charge time, discharge time, absorb time, equalize time.
The current weather including solar irradiation on the solar panels and the panel temperature (Extra sensors) are here.
Arduino Software
All my code is messy. May contain commented out debug stuff. You can rewrite it much better!
View code
download code
The primary battery in my Solar Powered Home is a series of 4, 6 volt 395 Amp-hrs deep-cycle lead acid batteries. The capacity of this 24 volt battery system is about 9.5 kwHr. This Arduino project measures the power into and out of the battery and the battery voltage and displays on a 2x16 LCD display the current charge state of the battery along with other useful information.
Setup of the sensors
The cables connected to this battery are large and the currents high (~60 amps max). As a current sensor I used a hall effect CSLA2CD made by Honeywell Control. I had to splice in a smaller Battery cable to go thru the sensor. The sensor output saturates at about +/- 70 amps and the output is about +/- 33mv/amp with zero amps being the mid point of the sensor power supply, in my setup 8 volts.
A small protoboard has all the sensor electronics and is located near the batteries and draws power from them. The 24 volts is regulated down to 8 volts for the hall effect current sensor and the 24 volt input is divided by ~ 1/6 to be suited for an Arduino A/D input. The two sensor outputs and a ground are wired back the the Arduino board which is located in a more convenient place several metres distant.
----------Schematic-coming soon----------
Breadboard version |
Without the Breadboard |
The LCD displays two pages of information alternating 3 seconds each.
Page 1: battery voltage, battery current, state of charge %, fully charged = 100%, battery mode: charging, discharging, absorb and equalize.
Page 2: Today's stats in minutes reset at dawn
charge time, discharge time, absorb time, equalize time.
The current weather including solar irradiation on the solar panels and the panel temperature (Extra sensors) are here.
Arduino Software
All my code is messy. May contain commented out debug stuff. You can rewrite it much better!
View code
download code
Friday, November 5, 2010
First Post
I got my first Arduino about 6 months ago and think they are wonderful. I have lived in a solar powered home in Tropical Far North Rural Queensland Australia for the last 20 or so years. My Arduino's are being used in sensor interfaces and data collection for many of my solar and water projects. As I'm learning I hope to keep a record here of what I've done and why. I'll try to post about projects, talk about sensors and what I use them for and will post all code somewhere. I'll figure it out as I go along.
Subscribe to:
Posts (Atom)