Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: Xbee Arduino API problem on: July 10, 2012, 05:33:01 pm
I'm having the exact same problem using series 1 xbee modules.
2  Using Arduino / Sensors / Re: CO2 Parallax sensor on: July 08, 2012, 10:37:55 pm
I just finished playing around with this sensor and got this:

1) it actually works!!!  smiley
2) to get graduated readings use test point 1 (TP1)
3) Alarm out or (E3 ALM) gives you the set point value for a 3.3v HIGH trigger (I cant think of an mcu type application where you would use a trigger considering graduated readings are available on TP1) 

this is my configuration...

E1   > set at 5v HIGH from any available pin
E2   > NA
E3   > 6-12v (don't use a 9v battery as it will drain very quickly - the mg811 and sensors of this type are gas-guzzler's)
E4   > ground
TP1 > to analog in (graduated readings - using arduino's analog map can come in handy)

Now my big question is: how to calculate PPM?

Thanks Parallax!
3  Using Arduino / Microcontrollers / Re: Standard Fuse Settings for 16Mhz ATMega328p on: June 23, 2012, 06:34:37 pm

These setting did it for me too... 16mhz atmega328p.

lfuse = 0xff
hfuse = 0xde
efuse = 0x05

4  Using Arduino / Programming Questions / Re: Send DATA (temperature) from arduino+xbee shield+xbee to xbee+PC in mode API on: June 22, 2012, 05:07:15 am
Hi. Just got it working correctly!!!! Yeeeeeeeee - HAAAAAAAAAAAA!!!! SUCCESS!!!!! how sweet it is...

Incredibly my atmega328p was damaged (probably when I tried making a power inverter) - note: if anyone is planning on making a power inverter make absolutely sure you use opto-couplers. The strange thing about the damaged atmega328p is that I had no problem uploading .pde's and turning pins on and off but somehow the RX/TX was damaged.

5  Using Arduino / Programming Questions / Re: Send DATA (temperature) from arduino+xbee shield+xbee to xbee+PC in mode API on: June 21, 2012, 06:36:57 pm
Hi, I'm using the 800.15.4 (series 1) and (like many many others) am  getting, well... squat and would appreciate any help - at all.

Here's the code I'm using that reads and lights up an led to recognize its at least receiving, then echo's back the character received :

void setup() {
  Serial.begin(9600);       //initialize serial
  pinMode(13, OUTPUT);      //set pin 13 as output
  digitalWrite(13, HIGH);
  digitalWrite(13, LOW);
  digitalWrite(13, HIGH);
  digitalWrite(13, LOW);

void loop() {
  while(Serial.available()){  //is there anything to read?
    char getData =;  //if yes, read it
    digitalWrite(13, HIGH);
  digitalWrite(13, LOW);

here are the results on x-ctu. Data entered in sequence 1,2,3 etc.. and getting periods back. I was hoping it would look like this 11,22,33 etc.. but no. What am I doing wrong????

Notice how entering 5 and 7 return the same hex value??? good grief.

6  Topics / Science and Measurement / PCF8574 Expander Library on: June 09, 2012, 07:15:46 pm
Here's a library for the PCF8574 in case anybody wants it. This works in v1.00 - if anybody wants to alter it for v1.01 please do so.

The .h file >

// pcf8574 lib by william lewis
#ifndef PCF8574_h
#define PCF8574_h

#include <inttypes.h>

class PCF8574Class
    void Prox(int, int, int);
    void Set(int, int);
    int read(int);      
    void write(int, int);    

extern PCF8574Class PCF8574;


The .cpp file >>

// pcf8574 lib by william lewis
#include <Wire.h>

#include "PCF8574.h"

static int current_data;
static int state;

int pin_array[2][8] = {
  0B01111111, 0B10111111, 0B11011111, 0B11101111, 0B11110111, 0B11111011, 0B11111101, 0B11111110,
  0B10000000, 0B01000000, 0B00100000, 0B00010000, 0B00001000, 0B00000100, 0B00000010, 0B00000001

void PCF8574Class::Prox(int addr, int pin, int x) {
  state =;  

  if (x == 1)  
  state &= pin_array[0][pin];                      
  else if (x == 0)
  state |= pin_array[1][pin];                        
  PCF8574.write(addr, state);       // ON

void PCF8574Class::Set(int addr, int bits){
    write(addr, bits);

int PCF8574Class::read(int addr) {
  Wire.requestFrom(addr, 1);

  if (Wire.available()) {

void PCF8574Class::write(int addr, int data) {
  current_data = data;  

PCF8574Class PCF8574;

The .pde >>>

#include "PCF8574.h"
#define EXPANDER_A B00100000 //0x20 //PCF8574
#define EXPANDER_B B00100001 //0x21 //PCF8574

void setup() {
 PCF8574.Set(EXPANDER_B, 0x7F);  

void loop(){
PCF8574.Prox(EXPANDER_B, 1, 1);  //this turns ON bit 1 on your secondary expander B
PCF8574.Prox(EXPANDER_B, 1, 0);  //this turns OFF bit 1 on your secondary expander B

PCF8574.Prox(EXPANDER_A, 1, 1);  //this turns ON bit 1 on your primary expander A
PCF8574.Prox(EXPANDER_A, 1, 0);  //this turns OFF bit 1 on your primary expander A

7  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: October 06, 2011, 11:37:51 am
Hi. There are no "dim" questions here, and yes I most definitely agree with you. A "stable" battery backup system is necessary. Unfortunately, while this system does work, it is not as stable as my needs require - so far. Ie: I require that it not "reset" on power off then power on - but it does when current/voltage flutuations are triggered by mcu events connected to other relays at the exact moment of AC power off - Otherwise it works like a charm.

As soon as I'm able, (four other projects cooking) I'll upload a schematic of what I've got so far.  Considering it took about 2 hours to make, it seems someone with more experience could maybe use it as a reference point to come up with a stable system.  The advantage to this kind of system is that when it does work and is hooked up to a 12 volt rechargeable battery pack your mains off/battery on time is up to you - I'm talking days not hours.

So by all means have at it, it's a "Must have" project!
8  Using Arduino / Storage / Re: SD card error - SOLVED.. then solved again. on: July 19, 2011, 04:47:23 am
1. if your sd card is not spi compatible.. you simply will not get any results - if (as a last resort) you use your cel phone's sd card (assuming its recent) make sure you get your cel phone's permission.. mine was in the cel phone switch off menu.

2. The 74HCT244N also works.

9  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: July 10, 2011, 10:53:57 am
Rethinking this:

1) Considering that without the mq-2 sensor and the lcd backlight and all relays disconnected my current draw is 50mA I can definitely use 12v 4ah batteries.. and achieve the 5-6 or more hours battery on time. Because the lcd with backlight on "looks cool" (hee hee) doesnt justify its usage on power off.

2) With a solar charger this could run on batteries indefinitely..

3) So.. on power off -> disconnect mq-2, lcd backlight, all relays

UPDATE: 7/11

Eureka! Just survived a real life power outage! Power came on and off 4 times, then stayed off for 55 minutes. Power is now back on and my clock has maintained time, and my arduino did not reset.

IT TAKES A LICKIN.. AND KEEPS ON TICKIN BABY! hee hee   smiley-eek-blue

10  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: July 07, 2011, 08:38:08 pm
Tried the 12v 4ah batteries and these dont deliver enough current to justify their use.. even with 2 of these wired in parallel. So Im headed back to the 9v setup for the time being.

I think that in order for a 12v system to work I will need a higher voltage transformer and a 12v battery capable of delivering higher current.

Anyway.. for now, Im going back to the 9volt setup to iron out kinks. It has met and exceeded my expectations.
11  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: July 06, 2011, 07:28:19 pm
Hi.. Thanks for the tips. The tip about sharing current between the 7805 and the tip32b is definitely going into my bag of tricks. Thats a biggy.. thanks again.

1. If you remove SPST relay and diode with question mark you get a reset on power off.

Anyway, Im moving over to 12v 4amp hour batteries to arrive at a 5-6 hour battery on time. Considering my projects draws .25 amps at power off these 12v batteries should do the job. Lets see.. 4 (amp hours) / .25 amp = 8 hours.. something tells me it doesnt work that way.. but well see. I just hooked up a .26 amp fan to one of these 12v batteries


12  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: July 06, 2011, 07:14:51 am
Here's the high current version... "works like a charm". Runs all the sensors (Im using 5 sensors including the gas guzzling mq-2) without skipping a beat (a.k.a. does not cause reset).

Ran this circuit with a dc motor at high current long enough to know the tip32b gets "very" hot.. consequently I highly recommend a beefy heat sink (a 22.5 square centimeters aluminum block seems sufficient at about 1.5amps) if running high current values. As well, I have to assume the tip32, BD536 and the like will also do the job.

"task remaining": disconnect batteries when fully charged: Use the rtc ds1307 for this? hmmm.

happy motoring!
13  Topics / Product Design / Version 2 -> Corrected Charging Circuit on: July 05, 2011, 08:38:54 am
Ok... here's the corrected version. The first version wasn't charging the batteries correctly.. this one does.

"Im not responsible if your house blows up.. heh heh." - evil mad scientist hot on the trail
14  Topics / Product Design / Re: BATTERY BACKUP with charging (will not trigger arduino reset) on: July 04, 2011, 09:05:00 am
You're right.. datalogging needs at least one sensor providing feedback to make sense. Knowing how long power was off is as simple as a digitalread high when power comes back on.

Still, the idea can be taken to higher voltages and currents, so that sensors can stay on, etc.


15  Topics / Product Design / BATTERY BACKUP with charging (will not trigger arduino reset) on: July 04, 2011, 05:40:56 am
Hi Compadrinos.. Here's a (crude yet functional) first attempt at a 9v battery charging low-current (5V 30mA) battery backup system that will not cause your arduino to reset when power goes out.  As I plan to use data logging I need a way to maintain system time using a ds1307/37 and data logging - this to indicate time and duration of a power outage. Problem is if youre using sensors (like the mq-2 gas sensor) this will drain your 9v battery in seconds.. so next version will cut off relays and sensors and only maintain time and data logging functions. I'll try a 12v version of this to maintain sensor functions as well. The main thing is it does not trigger a reset.

Project goals:
1) disallow arduino reset
2) maintain system time and data logging
3) charge a 9volt battery when power comes back on.

Btw.. I tried the ICL7673 but it caused a reset on power outage.

Mods, suggestions, etc, welcome.
Pages: [1] 2