Show Posts
Pages: 1 ... 49 50 [51] 52 53 ... 62
751  Using Arduino / Project Guidance / Re: Upgraded Generator control board Possible? on: June 15, 2011, 11:35:31 pm
I disagree.  My neighbor has a new generator for home backup that is totally electronic and works really well.  There's little effort in placing the arduino in a sealed plastic box and taking wires out to "old school relays"  or new school sealed low voltage relays or solid state devices that would last forever without having the contacts burn.  Once you got the basic operation working, adding things like frequency control, oil sensing and altitude sensing would be possible.  You could turn the choke on harder for cold starts, do automatic restarts, disconnects when power came on, etc.  Besides, you could put a cool control panel on it and show it off on trips.

Reliability is not about the era the device was created, it's about testing, adapting and design.  Cars used to be ready for the junk yard in 75,000 miles.  Nowadays we run them twice that before changing the spark plugs.  Something sure seems to be better about electronic controls.  Sure there will be some challenges and it will probably cost twice what you think it will, but you'll have a device that can tell you things like low spark, run temperature and oil temperature that you just can't get now.

Then, when you finish with that project, you'll start to look at the other control systems on the rest of the motorhome.  Automatic leveling and airshock adjustment would be cool too.  Maybe a computer controlled system to keep the batteries in top condition or signal tracking on the satellite TV. 
752  Community / Bar Sport / Re: Your latest purchase on: June 15, 2011, 12:30:03 pm
mowcius:  I'm just guessing here, but I suspect that the British may not have the kind of corporate waste that we see in the US.

cr0sh: Thanks, I think I'll drive over and take a look.  I'm North of phoenix in New River so it'll be about a 40 minute drive.
753  Community / Bar Sport / Re: Your latest purchase on: June 14, 2011, 08:40:03 pm
I live close enough to drive to Apache reclamation, is it worth the gas?
754  Using Arduino / Project Guidance / Re: wireless sprinker system control on: June 14, 2011, 04:17:38 pm
I see what you mean about the Nordic device.  Nice little radio, can't see I blame you for wanting to use it.  The one from sparkfun that is on a breakout board is 19.95 and I pay 20.21 for an XBee so the price difference is not worth worrying about.  Both of them would be fun to play with.

I originally didn't intend to hook up to the internet.  My mind was changed one day when I forgot to turn off the pool motor before I left the house.  That problem is now solved.  Plus it is so cool to pull out the cell phone and show off how I can turn the temperature down or up in the house from a couple of thousand miles away.  Doesn't help impress the girls at the bar though; they still want the guy with the Mercedes.  The reason for the central arduino that controls everything is that I wanted to play with an Arduino 2560 and have a bunch of blinking LEDs, LCD Display, and such to just set and stare at.  (OK, maybe I'm being too honest here).

Each of my thermostats is autonomous as far as setbacks and such, but greater control is more easily accomplished by having something else control them.  So the central box does that.  I got tired of walking from one to the other programming stuff in for them to do.  Plus, I ran out of memory on the darn things a couple of times.  The pool controller is a simple translation device from the idiotic pool control protocol to something more reasonable (in my mind).   Fine grain control of the pool is part of the central controller.  For example I turn the light on at 8PM for an hour to attract bugs that the bats fly around and catch.  This makes it fun to set on the patio watching the bats dive, skim across the water and then bank away from the side.  Ah, the joys of rural living.

Real Time Clocks are just way cool.  I went with a slightly different method simply because I could.  It was fun figuring out how to use a GPS module (that had an RTC inside it) to get and broadcast the time.  Now I can sample the time anywhere around the house, yard, barn, cactus patch or that pack rat den over there.  Silly I know, but it is fun.

As you can tell, my system is a hodgepodge of different technology and techniques.  Very little was originally designed to operate together  and much of it was invented along the way.  Way Cool.  In my mind, this is a fun thing to do and experiment with.  A smoking voltage divider is a lesson in Ohms law, not a failure.

But, I am soooo going to get one of those relay boards.  I could hook an XBee to it and control.......sigh.
755  Using Arduino / Project Guidance / Re: wireless sprinker system control on: June 14, 2011, 10:57:08 am
For power:  I used a big ol 24V transformer in my AC unit to power my web enabled thermostats for my home.  When these are rectified and filtered they put out about 37V DC that has to be regulated to 5V somehow.  I used a really cool device  I have two of these and they have both been working really well for several months.  This saved me a lot of money and time searching for a transformer.  There are other options on that site as well.  You can then use the same AC voltage through the relays to run the solenoids.

Regarding XBees, if you are going to be doing other stuff via wireless control, such as monitoring the soil moisture in various spots, flipping on a light for yard accents, and so forth, the XBee is probably the better choice.  Sure, they are more complicated, but are they really more complicated than tuning, writing your own retry code, testing range yourself, addressing and such?  PaulS and I disagree on the complexity of Series 2.  Once you get two of them working (took me a week the first time and 12 minutes the second) adding another one is about 45 seconds of work.  I even built a remote temperature sender in around 45 minutes from the ground up using one of these and a few other parts.  Don't bother with a shield for these, contrary to what you hear and read, they can be hooked directly to the darn Arduino if you use the low power models.  You can use a cheap adapter board like the if you want to use the high power devices.  The low power ones have a surprising range outside using the wire antenna.  Inside, not so good, so you might need a third one to relay; that is incredibly easy also.  And, you can get three of the low power ones for the price of one high power one (depending of course on where you buy it)

I might suggest that you use an arduino as the controller and web enable it.  The reason is that you will not have to have a computer hooked up and working all the time.  A little arduino controller is fun to build and can have timers (using timeAlarm library) that do things for you.  This way you can put it on the web and watch the sprinklers from Paris while you're on vacation.  But this is a decision you can make at any time.  You can also put the timers in the sprinkler arduino, but you would have more programming in it then.

Take a look at my blog to see how I control my thermostats, measure the power in the house, control the swimming pool and such using XBees, Arduinos and such.  The thermostat tab is where I did something similar with 24V control, ethernet boards and relays.  My project is ongoing and will be until I get too old to hold the soldering iron.
756  Using Arduino / Project Guidance / Re: Never built one before building a skinner box with web based button control on: June 14, 2011, 10:18:00 am
This is a really cool idea.  If you really want to do it, the folks on this board will totally help you on it.  Let me start you off with a few questions that matter a lot.

How far is the coup from power?  Do you have something like a light to scare off the 'coons nearby?
How far is the coup from where some computer stuff is plugged in.  Like, do you have an ethernet plug somewhere nearby?  How hard would it be to run some wires to it.
Sunlight?  Maybe solar power is possible to recharge batteries.

See, the feeder has to be with the chickens, but the arduino can be somewhere else.  Suppose you built a screw driven conveyor that dropped corn and ran wires from it to the house?  If that's too hard or not fun enough, how about an XBee on the feeder with a little control circuitry that is wireless to an Arduino in the house.  If that isn't fun enough, put the arduino in the coup with the feeder hook an XBee to it and another one in the house hooked to something on the web.

Webcam?  You simply got to have a webcam !  We would all want to see how fat we could make your chickens.

Think about the physical aspects of doing this.  The electronics will be based on how you think it could be done the best.
757  Using Arduino / Programming Questions / Re: Serial garble at beginning of output. on: June 13, 2011, 11:43:18 pm
Now, go edit the first post and add [Solved] to the subject line  smiley-twist

tee hee.
758  Using Arduino / Programming Questions / Re: ascii char to int conversion on: June 13, 2011, 05:53:41 pm
You're certainly welcome.  Remember though, there's about as many ways to do this as there are people on this forum.  My particular method has some advantages and some disadvantages; notably seeming waaay to complicated. The main purpose is to have some fun and accomplish something interesting.  If you implement Pauls's suggestion of an ending character, then the loop will get even simpler.  Just have a new case with that value, save your integers and go do something with them.
759  Using Arduino / Networking, Protocols, and Devices / Re: Using XBee and USB cable at the same time. on: June 13, 2011, 03:03:44 pm
Working from memory here, so take it for what it's worth.  The DH, DL address is factory set for broadcast when shipped.  That means everything talks to everything in peer to peer mode.  That should make them talk, but not efficiently.  This doesn't mean that someone in the supply chain set up a test bed that changed the devices before you got them.  Once again, I have zero experience with Series 1, but that's what I've read people's experiences have been.  If you already have a couple of them running in the house in some other mode, there may be problems.  Series 2 will work out of the box if there is already a coordinator running.  If there isn't you gotta make one, then they work.
760  Using Arduino / Programming Questions / Re: Serial garble at beginning of output. on: June 13, 2011, 02:38:38 pm
I took your code bit and compiled it for a Uno under ide 021 and it worked fine.  I realize you've been trying to find a problem and cutting and shaping code so I won't point out the little problems here and there, but it worked.

I saw what you're getting when I hit the reset button on the Arduino and also when I killed the serial window and restarted it.  What you're probably seeing is stuff that was coming in already and just hadn't gotten there yet.  If you want to see it like I did, upload it, then start the serial window so it starts off fresh.  This is pretty common in my experience when you're sending data to the serial out and start up the serial window.  It gets a burst of junk from the previous run.  Put a couple of Serial.println(); lines in before you print start to show the separation and have fun.
761  Using Arduino / Programming Questions / Re: ascii char to int conversion on: June 13, 2011, 02:15:48 pm
Naw, when you're waiting for Y, you're also collecting X data.  I could have bumped around on the X, but it was already getting too complicated for a simple illustration.  Sorta took the easy way out.
762  Using Arduino / Installation & Troubleshooting / Re: Uno, 57600 baud, bad data on: June 13, 2011, 02:02:23 pm
Dear Badly,

Thank you.  You gave me enough information to find the problem.  It wasn't me and this HAS been discussed a lot, but on the old board.  The 57600 baud rate is basically broken (at least under 021) and you can make it work by fudging the baudrate some.  I found that


made it work fine for long lines of input and such.  I'll look into this more and gather more data, but you got me over the hump.

763  Using Arduino / Installation & Troubleshooting / [Solved, sort of] Uno, 57600 baud, bad data on: June 13, 2011, 01:13:45 pm
This little piece of code :
void setup() {
  Serial.println("just testing");

void loop(){
  char c;
  if (Serial.available() > 0){ // is there a character in the buffer?
    c =;
    Serial.print("Incoming character is ");
    Serial.println(c);         //just shows the incoming character

Doesn't work properly at 57600 baud,  Change the baud rate to anything else and it just takes off and works fine, even 115200.  If I send the Uno one character at a time, I get the character properly; if I send a line like "Hello there" I get the "He" ok and the rest is junk.  When I searched for other folks that had had this problem I noticed a bunch of them having problems with this baud rate for GPS applications, but nothing else.

What's up with this?  What am I overlooking?
764  Using Arduino / Programming Questions / Re: ascii char to int conversion on: June 13, 2011, 12:52:00 pm
This is a very different way to do this.  Suppose you don't want to hang around waiting for a character to arrive because you have other things the processor can be doing.  This little bit of code checks for a character and uses a minimal state machine to tell where you are in the input.  This is not meant to discount other methods, just to show you a different way.

Using this you can type X123 wait an hour, type Y456 and the values get assigned while the processor could be blinking lights and stuff.  Of course you'll have to modify it to make it work for your purposes.  It's just an illustration, think of it as a toy and play around.

#include <ctype.h>

void setup() {
  Serial.println("just testing");

#define waitforX 0
#define waitforY 1
#define waitforYdata 2

char data[50];
int xValue = 0;
int yValue = 0;
int state = waitforX;

void loop(){
  char c;
  /* just another way of doing it, this method doesn't block and
  is controlled by a switch statement.  You can do other stuff while
  you wait for the data to come in.  To see what happens uncomment
  the line below and watch the scrolling window while you type.  */
  //Serial.println("Loop running");
  // to get more of a feel for it, change to "no line ending" in the
  // terminal window (menu at the bottom) then send one character
  // at a time.
  if (Serial.available() > 0){ // is there a character in the buffer?
    c = toupper(; // I just got tired of pressing the shift key
    Serial.print("Incoming character is ");
    Serial.println(c);         //just shows the incoming character
    switch (state) {           //decide what need to be done with it
      case waitforX:           // haven't got the X yet
        if (c == 'X'){         // there it is
          Serial.println("got the X");
          xValue = 0;  //start the X value off with zero
          state = waitforY;    //gather data until the Y shows up
      case waitforY:
        if (c == 'Y'){         // the Y came in, gather Y data
          Serial.println("got the Y");
          yValue = 0;          // start the Y off at zero
          state = waitforYdata;
        if (isdigit(c)){       // ignore non numbers
          xValue = (xValue * 10) + (c & 0x0f); //gather incoming numbers
          Serial.print("current Value of X is ");
      case waitforYdata:       // same kind of thing with the Y data
        if (isdigit(c)){
          yValue = (yValue * 10) + (c & 0x0f);
          Serial.print("current Value of Y is ");
        if (c == 'X'){  // this just starts over again
          Serial.println("got a beginning X");
          state = waitforY;
            default: //ignore anything else
765  Topics / Home Automation and Networked Objects / Re: Web server / Home Security on: June 12, 2011, 09:46:50 pm
This is obviously not a secure way to do it, that would be a really, really big example.  However, this will parse an input (a little bit) and gives you something to start with and expand upon.  This is ONLY a code fragment so you will have to adapt it to your code.  Just steal the idea to get you started.  I'm sure you will notice that I started with the same example you did.

   Client ControlClient = Control.available();
   if (ControlClient) {
    // an http request ends with a blank line
    while (ControlClient.connected()) {
      if (ControlClient.available()) {
        char c =;
        // if you've gotten to the end of the line (received a newline
        // character) you can send a reply
        if (c != '\n' && c!= '\r') {
          netbuf[index++] = c;
          if (index >= sizeof(netbuf)) // max size of buffer
            index = sizeof(netbuf) - 1;
        netbuf[index] = 0;
        // standard http response header
        strcpy_P(general, PSTR("HTTP/1.1 200 OK"));
        strcpy_P(general, PSTR("Content-Type: text/html"));
        if (strstr_P(netbuf,PSTR("GET / ")) != 0){   // This will put up the time if you have it.
          strcpy_P(general, PSTR("<html><body><h1>"));
          strcpy_P(general, PSTR("My Web Site<br>"));
          tNow = now();
          strcpy_P(Sgeneral,PSTR("%d:%02d:%02d %d/%d/%d"));
          strcpy_P(general, PSTR("<br></h1></body></head></html>"));
        else if (strstr_P(netbuf,PSTR("GET /supersecretpassword")) != 0){ // obviously not totally secure, but you can check stuff this way
          tNow = now();
          strcpy_P(general,PSTR("Wow, you guessed it !"));
          strcpy_P(general,PSTR("You messed it up dummy"));
Pages: 1 ... 49 50 [51] 52 53 ... 62