LCD backlight on stalker powered from caps?

Hi all :slight_smile:

I am setting up a stalker with 2000ma li-po + 5v solar pannel
as a remote temp sensor using nine DS18B20’s
long story short…

"Chicken farm temp sensors for day old chicks 500m from home
to give

serial print 9 readings via xbee pro to pc in house at 20 min intervals
and
LCD print 9 readings to LCD display at brooder on demand by press of button.

+more functions such as warning buzzer etc…"

however
I am trying to get a 20x4 (5v) LCD to run on demand at the remote station
All goes well while the 5v usb is connected

IE; 3.3v logic runs lcd and
5v usb power drives lcd backlight

My question is can I setup backlight to be powered from capaciters on press of button?

eg 2x (2.5v 10f) supercap’s
and can they be refilled from 3.3v?

Also just saw note about xbee pro needing more power than 3.3 rail will deliver,
is this still true for v2.1 or
should I just have a seperate 5v power supply for the 5v stuff
(ie 9v battery thru a step down dc-dc)

Code bellow for those interested.

please keep in mind that code is work in progress…

Thanx if you can help…

[code]

/* Connect Temperature Sensor DS18B20
cable to Arduino Digital I/O Pin 6,7,15
*/

/-----( Import needed libraries )-----/

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 10, 13);

//LCD pin atmel pin
// 1 gnd
// 2 +5
// 3 gnd( backight potentiometer ctr pin
// 4 12
// 5 gnd
// 6 11
// 11 5
// 12 4
// 13 10
// 14 13
// 15 +5(bklt)
// 16 gnd

//stalker pinout

//d0
//d1
//d2
//d3 to control the Reset Pin of ATmega328P(wireless programming)
//d4 microSD card power controll if controll is neaded
//d5 XBee Power controll if controll is neaded
//d6 sensorA
//d7 sensorB (or BAT_READ if jumper connected)

//d8 red LED top side of the PCB any purpose you desire(nonessential)
//d9 SD Chip Select signal of the microSD card (or DP10)
//d10 lcd p13 (may be set as sd signil instead of DP9)
//d11 lcd p6
//d12 lcd p4
//d13 lcd p14
//gnd
//ref

//a7 ?
//a6 ?
//a5
//a4
//a3
//a2
//a1 sensorC
//a0 Buzzer

//nc
//GND
//GND
//5V USB
//3v3
//RSt

//usb5v
//RXD
//Txd
//Gnd
//DTR

//*3.3 *5v
//*GND *GND
//*SCL *SCL
//*SDA *SDA

/-----( Declare Constants )-----/

#define ONE_WIRE_BUSA 6 /-(Connect DS18B20 to Pin 6 )-/
#define ONE_WIRE_BUSB 7 /-(Connect DS18B20 to Pin 7 )-/
#define ONE_WIRE_BUSC 15 /-(Connect DS18B20 to Pin 15 aka analog pin 1)-/

int speakerPin = 14; //pin 14 used for buzzer(aka analog pin 0)
int LEDpin = 8; //pin used for debug LED

/-----( Declare objects )-----/

/* Set up oneWire instances to communicate with OneWire devices*/
OneWire hut1(ONE_WIRE_BUSA);
OneWire hut2(ONE_WIRE_BUSB);
OneWire hut3(ONE_WIRE_BUSC);

/* Tell Dallas Temperature Library to use oneWire Library */
DallasTemperature sensorsA(&hut1);
DallasTemperature sensorsB(&hut2);
DallasTemperature sensorsC(&hut3);

//Individual addresses for the sensors or 1-wire protocol objects
// only have addresses for 2 sensors as yet…

//hut1 cable
DeviceAddress S1 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };
DeviceAddress S2 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };
DeviceAddress S3 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };

//hut2 cable
DeviceAddress S4 = { 0x28, 0xc7, 0x32, 0x88, 0x03, 0x00, 0x00, 0x22 };
DeviceAddress S5 = { 0x28, 0xc7, 0x32, 0x88, 0x03, 0x00, 0x00, 0x22 };
DeviceAddress S6 = { 0x28, 0xc7, 0x32, 0x88, 0x03, 0x00, 0x00, 0x22 };

//hut3 cable
DeviceAddress S7 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };
DeviceAddress S8 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };
DeviceAddress S9 = { 0x28, 0xAC, 0xC3, 0x43, 0x03, 0x00, 0x00, 0xDF };

/-----( Declare Variables )-----/

float tC1; // temperature in Celsius
float tC2;
float tC3;
float tC4;
float tC5;
float tC6;
float tC7;
float tC8;
float tC9;

int toohot = 44; // too hot temperature in Celsius
int toocold = 8; // too cold temperature in Celsius

/* Melody

  • The calculation of the tones is made following the mathematical
  • operation: timeHigh = period / 2 = 1 / (2 * toneFrequency)
  • where the different tones are described as in the table:
  • note frequency period timeHigh
  • c 261 Hz 3830 1915
  • d 294 Hz 3400 1700
  • e 329 Hz 3038 1519
  • f 349 Hz 2864 1432
  • g 392 Hz 2550 1275
  • a 440 Hz 2272 1136
  • b 493 Hz 2028 1014
  • C 523 Hz 1912 956
  • http://www.arduino.cc/en/Tutorial/Melody
    */

int length = 15; // the number of notes
char notes[] = "ccc aaa ccc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 };
int tempo = 300;

void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(speakerPin, LOW);
delayMicroseconds(tone);
}
}

void playNote(char note, int duration) {
char names[] = { ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘a’, ‘b’, ‘C’ };
int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };

// play the tone corresponding to the note name
for (int i = 0; i < 8; i++) {
if (names[i] == note) {
playTone(tones[i], duration);
}
}
}

void setup() /----( SETUP: RUNS ONCE )----/
{
/-(start serial port to see temperature results-/
delay(50);
Serial.begin(9600);

/-( Start up the DallasTemperature library )-/
sensorsA.begin();
delay(50);

sensorsB.begin();
delay(50);

sensorsC.begin();
delay(50);

// set up the LCD’s number (col,row):
lcd.begin(20, 4);

// set speakerPin as output:
pinMode(speakerPin, OUTPUT);

// set ledPin as output:
pinMode(LEDpin, OUTPUT);

}/–(end setup )—/

void loop() /----( LOOP: RUNS CONSTANTLY )----/
{

//blink LED as debug sensor
digitalWrite(LEDpin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(LEDpin, LOW); // set the LED off

Serial.println();
Serial.print(“Requesting temperature…”);

// Send the command to get temperatures in hut 1
sensorsA.requestTemperatures();

//write value for temperatures in hut 1
tC1 = (sensorsA.getTempC(S1));
tC2 = (sensorsA.getTempC(S2));
tC3 = (sensorsA.getTempC(S3));

delay(100);

// Send the command to get temperatures in hut 2
sensorsB.requestTemperatures();

//write value for temperatures in hut 2
tC4 = (sensorsB.getTempC(S4));
tC5 = (sensorsB.getTempC(S5));
tC6 = (sensorsB.getTempC(S6));

delay(100);

// Send the command to get temperatures in hut 3
sensorsC.requestTemperatures();

//write value for temperature in hut 3
tC7 = (sensorsC.getTempC(S7));
tC8 = (sensorsC.getTempC(S8));
tC9 = (sensorsC.getTempC(S9));

delay(100);

Serial.println(“success”);

if (tC1,tC2,tC3,tC4,tC5,tC6,tC7,tC8,tC9 == -127);

 {
     lcd.clear();
     lcd.setCursor(1, 0);
     lcd.print("Is a cable");
     lcd.setCursor(1, 2);
     lcd.print("disconnected");
     
     Serial.println(" ");
     Serial.println("a sensor reads -127 ");
     Serial.println("Is a cable disconected?");
     Serial.println(" ");
     
     delay(1000);// 1 second to read error message

   } 

if (tC1,tC2,tC3,tC4,tC5,tC6,tC7,tC8,tC9 == 0);

 {
     lcd.clear();
     lcd.setCursor(1, 0);
     lcd.print("Is a sensor");
     lcd.setCursor(1, 2);
     lcd.print("disconnected");
     
     Serial.println(" ");
     Serial.println("a sensor reads 0 ");
     Serial.println("Is a sensor disconected?");
     Serial.println(" ");
     
     delay(1000);// 1 second to read error message

   }      

// play sound if any limit passed

if ( tC1,tC2,tC3,tC4,tC5,tC6,tC7,tC8,tC9 > toohot
|| // Or
tC1,tC2,tC3,tC4,tC5,tC6,tC7,tC8,tC9 < toocold )

{
for (int i = 0; i < length; i++) {
if (notes[i] == ’ ') {
delay(beats[i] * tempo); // rest
} else {
playNote(notes[i], beats[i] * tempo);
}
}
// pause between notes
delay(tempo / 2);
}

//if (bollightbutton pressed = true)
//{
//digitalWrite(#,HIGH);
//}

/* show temperatures on LCD */

 lcd.clear();
 lcd.setCursor(3, 0);
 lcd.print("Hut1");
 lcd.setCursor(9, 0);
 lcd.print("Hut2");
 lcd.setCursor(15, 0);
 lcd.print("Hut3");
 lcd.setCursor(1, 1);
 lcd.print("A");
 lcd.setCursor(1, 2);
 lcd.print("B");
 lcd.setCursor(1, 3);
 lcd.print("C");
 lcd.setCursor(3, 1);
 lcd.print(tC1);
 lcd.setCursor(3, 2);
 lcd.print(tC2);
 lcd.setCursor(3, 3);
 lcd.print(tC3);
 lcd.setCursor(9, 1);
 lcd.print(tC4);
 lcd.setCursor(9, 2);
 lcd.print(tC5);     
 lcd.setCursor(9, 3);
 lcd.print(tC6);
 lcd.setCursor(15, 1);
 lcd.print(tC7);     
 lcd.setCursor(15, 2);
 lcd.print(tC8);        
 lcd.setCursor(15, 3);
 lcd.print(tC9);

/* show temperatures on serial */

Serial.print(“Hut 1 thermometer A = “);
Serial.print(tC1);
Serial.println(” Degrees C”);

Serial.print(“Hut 1 thermometer B = “);
Serial.print(tC2);
Serial.println(” Degrees C”);

Serial.print(“Hut 1 thermometer C = “);
Serial.print(tC3);
Serial.println(” Degrees C”);

Serial.print(“Hut 2 thermometer D = “);
Serial.print(tC4);
Serial.println(” Degrees C”);

Serial.print(“Hut 2 thermometer E = “);
Serial.print(tC5);
Serial.println(” Degrees C”);

Serial.print(“Hut 2 thermometer F = “);
Serial.print(tC6);
Serial.println(” Degrees C”);

Serial.print(“Hut 3 thermometer G = “);
Serial.print(tC7);
Serial.println(” Degrees C”);

Serial.print(“Hut 3 thermometer H = “);
Serial.print(tC8);
Serial.println(” Degrees C”);

Serial.print(“Hut 3 thermometer I = “);
Serial.print(tC9);
Serial.println(” Degrees C”);

delay(6000); //slow down checking to save power

}/* --(end main loop )-- */

/* ( THE END ) */[/code]

  1. What version with your Stalker.
  2. Which capacitor button you want to setup backlight?
  3. Best way is use jumper wire or sold a cable from pin 3V3, that is easy for supply power to others.
  4. We not support about software, but you can still ask someone at forum.

Hope that can help your chicken farm. :smiley:

Best regards

Yuri

  1. What version with your Stalker.

Stalker v 2.1

  1. Which capacitor button you want to setup backlight?

would like to setup so that
pressing
int buttonPin = 16; // pushbutton pin 16 (aka analog pin2)

turnes on

int BKLTPin = 17; // BKLT pin 17 (aka anlog pin3)

so that pin 17 can be a short term 5v supply from (2x2.5v 10f caps) thru "5v USB"pin

  1. Best way is use jumper wire or sold a cable from pin 3V3, that is easy for supply power to others.

I guessed the wire would be neaded :confused:
But more to the point would the caps draw too heavily on the 3.3v rail (ie shut down ATmega)
and/or should I just run a 9v battery with a voltage regulater just for the LCD?

  1. We not support about software, but you can still ask someone at forum.

I figured so but no harm in posting just in case of insight :slight_smile:

thanks

All Stalker 2.1 analog pins are input port. So you can’t use them for supply power.
You need to find another way to light your LCD backlight. :slight_smile:

ok no power from analog…

then I will try to juggle the digital pins and free one up then

thanks :slight_smile:

Glad to help you.