Show Posts
Pages: [1] 2 3 ... 64
1  Topics / Home Automation and Networked Objects / Re: Gps module returning erroneous and same data on: August 01, 2014, 04:27:43 pm
I can't see any reason a powered antenna would cause the serial to mess up.  It really looks like a baud rate problem since the various lines have similarities.  However, it could be a framing error or inverted data as well.

So, I'm goiing to recommend that you switch libraries from the software serial you have to the one here:

http://arduiniana.org/libraries/newsoftserial/

unless you're absolutely certain that you have the newest architecture.  Then, you can try data inversion to see if it straightens out the framing.

Beyond that, I have no clue.
2  Topics / Home Automation and Networked Objects / Re: Arduino identification issues at router on: August 01, 2014, 09:40:23 am
One other thing to check for is local loopback.  Some home routers don't allow it, so if you're getting to the arduino by typing in 192.168.nnn.nnn and it works, but when you try http://myplace.something it doesn't from the same machine, it could be that loopback isn't allowed.  To test, call someone and have them try it or use a cell phone on the provider network.  If that works, you'll have to figure out how to enable local loopback to get to it by name or address from the local network.

I had this problem and it took me three days to figure out how to enable the dsl modem.
3  Topics / Home Automation and Networked Objects / Re: Gps module returning erroneous and same data on: August 01, 2014, 09:31:21 am
GPS sentences start with a $ and end with a carriage return, what you're getting looks like one of the baud rates is wrong.  Looking at the datasheets vs code examples for this chip I see both 4800 and 9600 being used as the rx baudrate.  So, just to set that possibility aside, put a Serial.println("Hello World"); right after the Serial.begins to be sure the IDE terminal is right, then try different baud rates for the ss.begin()

I've seen different baud rates for different chips, your problem could be something like that.
4  Topics / Home Automation and Networked Objects / Re: Smart Thermostat Project: Looking for 24 VAC to ~9 VDC Power Supply on: August 01, 2014, 01:41:10 am
Keep in mind the voltage limits of the Arduino.  If you rectify and filter the 24 volts from a heater or  AC unit you'll get around 37 volts.  If you apply that to an arduino, you'll get some black smoke and a few popping sounds as the board burns up.

So, pay attention and do this carefully.
5  Topics / Home Automation and Networked Objects / Re: Smart Thermostat Project: Looking for 24 VAC to ~9 VDC Power Supply on: July 30, 2014, 09:33:55 pm
I did this exact thing.  I used the 24VAC that comes from my AC unit and rectified it to give me around 37VDC which I filtered and then sent to a 5V regulator to power the thermostat.  I'll never do that again, it was silly.

What I would do now is get a variable buck power supply off ebay that can take at least 40VAC input and regulate it down to what I need, then put a 100uf cap and a couple of small value caps on the output to filter the trash that these little supplies always have and use that.

I have had incredible luck with the one I built a few years ago, but it was expensive and it runs hotter than I like.  I describe the project on my blog if you want to see how I did it.  But, like I said, I'd do it differently if I was doing it now.
6  Topics / Home Automation and Networked Objects / Re: Gps module returning erroneous and same data on: July 30, 2014, 07:07:41 pm
 That looks like you have the wrong baud rate.  I suggest that you put together a small program that just reads from the GPS pin and prints what it gets.  The sentences should make sense, and yours don't.

Just cut the code down to do a read a character from the GPS and then print it.  You should see the sentences come out with the data in it.  When you do this, attach the GPS to the sofware serial port, and use the regular serial port with the arduino IDE, don't try to use the serial port in a split mode where you have one pin hooked to the gps and expect the other one to talk to the IDE.

So, move the GPS tx pin to the software serial input pin, and try to just read from the GPS  and output it through the regular serial port.  Remember to set the baud rate of the software serial port.  You don't have that in the first code you posted, but do in the second.  Something like this:
Code:
void setup()
{
  ss.begin(4800); // your GPS should be hooked here
  Serial.begin(4800); // this is only to talk to the IDE serial monitor
                                          // you can use any baud rate you want here.
}

void loop(){
   while(ss.available()){
      int c = ss.read();
      Serial.print((char)c);
   }
}


and see what you get.  For some problems, you have to go all the way back to the very beginning.
7  Topics / Home Automation and Networked Objects / Re: Gps module returning erroneous and same data on: July 30, 2014, 04:45:28 pm
There's several things wrong with what you're trying to do, and listing them would probably cause you a lot of confusion.  So, I'm going to suggest you get the example from the author's site and use it as a starting point.

There's several reasons for this, but there are two notable that you should pay close attention to.  First, he uses SoftwareSerial so that the console port is available for you to use for debugging and testing.  Second, he doesn't have any delay() calls in there that will make you miss characters since the cpu is in a hard loop and ignoring everything else.  You can't do that kind of thing with something that is sending characters all the time.

The example is at: http://arduiniana.org/libraries/tinygps/

Now, before you tell me that you used that example and that's where you got the code from, take a closer look at what he's doing and reproduce it.  Get the darn delay() out and use SoftwareSerial.

There are other examples where people used the same library out there as well.
8  Topics / Home Automation and Networked Objects / Re: Heat Pump for Pool on: July 23, 2014, 10:00:17 am
My peak draw on startup of two A/C units is fairly high and SSRs stand up to it just fine, but it would be good if you find a better source than me on this.  I recommend that you find one of the hardware engineering forums and ask about this exact thing.  Some of those folk have designed the devices and can give you definitive answers.

Then, of course, come back here and post your results .  smiley

9  Topics / Home Automation and Networked Objects / Re: Heat Pump for Pool on: July 21, 2014, 11:05:07 am
I use a few of the ready made relay cards; relays work great in lots of applications.  It's the high current applications that I have been replacing the contactors with SSRs.  They're noisy and the arcing on the contacts causes them to fail too often in my climate.  So, water heater, A/C units, outdoor motors, that kind of thing.  I reserve relays for small items.
10  Topics / Home Automation and Networked Objects / Re: Heat Pump for Pool on: July 21, 2014, 02:15:41 am
The way some of these defrost is to run the fan across the coils until the coil temperature sensor goes to whatever the ambient temperature is. This means you have to pay attention to what the actual temperature is and shut the whole thing down if it's too cold to do any good.  The tiny number of them I've seen don't allow operation under 40F, so you might use that as a starting point.   The only strategy I've seen on compressor operation is to run it at least 10 minutes, and let it set idle for 10 minutes after running.  The idea is to keep those short cycles at a minimum to reduce the wear of start-stop cycling.

They're actually pretty simple devices so you should be able to get it working to your satisfaction.  One thing I do recommend is to make your new controller as self sufficient as you can.  Sure, it's great to incorporate it into the house controls, and you should do that, but allow it to operate on its own if necessary.  My experience has been less than stellar using centralized control with ethernet and devices that depend on a datum from somewhere else often don't get it.  I try to make every new device capable of working to some degree without the need for a solid connection.

While you're at it, take a look at replacing the contactors for the motor and fan with solid state relays.  The biggest problem with these devices is those darn big relays that wear out and get contact burns.  I'm replacing all of mine over time; basically when they fail, they get replaced with an SSR.  Haven't had an SSR fail or get dirty contacts.
11  Topics / Home Automation and Networked Objects / Re: Zigbee communication synchronization on: July 12, 2014, 10:58:43 pm
Yep, to guarantee that the data gets there intact, you'll have to use API mode.  The second data byte will get there eventually, but not when you want it to; transparent (AT) mode is buffered and only sent periodically or after a timeout.
12  Topics / Home Automation and Networked Objects / Re: HTML/Arduino coding for single ON/OFF button on: July 12, 2014, 10:53:37 pm
You defined them inside the routine setup(), but used them outside that routine.  Variables defined inside a routine only exists inside it.  If you want to use them in other places, move the definition outside all routines.

Take a look at 'c++ scope of variables'.  It's useful, but can drive you a bit nuts sometimes.
13  Topics / Home Automation and Networked Objects / Re: HTML/Arduino coding for single ON/OFF button on: July 11, 2014, 11:12:48 pm
Quote
3) I'm not sure if there are any commands in to "switch out from the IDE terminal emulator"? I'm quite used to messing around with Raspberry Pi's and SSH'ing into these with Putty - I assume you are suggesting the same here but sending the "?14" instruction over Putty? If so, can I not just log into the Arduino at the appropriate IP/port with Putty and then type this instruction into the command line to activate the switch? In that case, I'm not sure if I need to include anything more in the sketch to facilitate this?

I wasn't clear enough.  In the terminal, in the IDE (which is what you use to compile it), you can type something in and send it to the board through the serial port.  This is where you want to put commands to make things happen.

So, put it together, compile it, fix the compile errors, and shove it out to a board and start trying things.  Then a whole lot of what folk have suggested will make more sense to you.

Oh,, and don't even think this is like a raspberry pi, this little guy has a lot of I/O possibilities that you just can't get on the Pi.  The Pi's a nice board, I have several, but the arduino is a really great little controller for lots of jobs around my house.
14  Topics / Home Automation and Networked Objects / Re: HTML/Arduino coding for single ON/OFF button on: July 11, 2014, 03:04:31 pm
Regarding your ideas:

Nicely done, but you will get killed by details when you start compiling and trying this.  First, you don't need to hold the current state of the switch, simply read the I/O pin to find out what it really is whenever you want.  Keeping states of things like this always leads me to screwing up and not updating it somewhere, so just read the pin to see what it's doing.

Enable the ethernet board before ethernet.begin.  Why are you using an SD card?  If you don't need it, just leave it turned off; it'll make the code easier to understand when you're trying to debug it. 

Put in some commands to try the switch out from the IDE terminal emulator.  You have no idea how useful it is to be able to manipulate various controls from the command line when you're trying to make it work.  Put in a lot of print statements to tell you what is going on.  You'll need them when the light stays on despite the web page being decoded properly.  You don't have to get fancy with it, just looking for a 't' for toggle will save you a ton of time debugging.

An interesting way to toggle the pin for a relay is to  use the input from the pin as a guide for setting the pin as in:

digitalWrite( digitalRead(thePin) ^ 1);

This will toggle the pin from one state to another and you can then digitalRead(thePin) anywhere in the code to see what state it's in if you need to.  However with your setup and wanting only to flip the state, you may not need to.

You don't want to get fancy with HTML on an arduino.  Remember, you have to decode the incoming all by yourself with no fancy language or huge libraries to help you.  When you parse the incoming, you want it to be as simple as possible.  Consider something like:

href="http://xxx.xxx.xxx.xxx/14"

Then in the arduino code, just look for the 14.  The ? to show arguments and & between arguments with named pairs is something for python, php, javascript, etc; not for a little arduino.  If you want to get fancy with POST vs GET discussions, you'll run out of memory or patience.  Just stick with a GET, and let the spot where the file goes (14 in the example above) can be whatever you want.  Suppose you sent:

href="http://xxx.xxx.xxx.xxx/toggle14"

Then parse for "toggle" and grab the two numbers after it for which one.  There's about a jillion ways  to do this, so make it simple at first.  Once you get it running, you can expand it to be as versatile as you have time for.
15  Topics / Home Automation and Networked Objects / Re: HTML/Arduino coding for single ON/OFF button on: July 11, 2014, 02:19:39 pm
Regarding two and three way switching. 

I had a heck of a time finding an example of a UK two way switch setup.  Here is the one I found:

http://www.lightwiring.co.uk/tag/2-way-switch-wiring-diagram/

I'm sure there are others.  If you have a two way in the room, then a SPDT relay will work fine, however, if you have a three way or higher (I've seen them go up to six), then you will need to either: 1) find the spot where the circuit begins or ends and use a SPDT, or 2) use a DPDT somewhere in the middle.  Look at the middle one on this page:

http://www.lightwiring.co.uk/3-way-light-switch-using-a-two-wire-control/

The way they go to more than three way is to simply add switches like the one in the middle wherever they need them.   You see this in hallways sometimes where several bedrooms have exits.  That way each bedroom can turn on the hall lights.

So, it all depends on your wiring.  The way you get a DPDT relay when you can only find SPDT, is to just use two of them side by side.  Clever right?  Notice I didn't say cheap.  Heck, you can even use solid state relays that way if you want silent operation.  Clever arrangement of SSRs can emulate any kind of relay you want, but you'll pay a bunch of money for the experience.

One thing you can do if you want to consider it is to use the flash memory on the arduino to save the state each time it changes, then on boot, before you do anything else, read the state from the flash and set the relay(s) accordingly.  I do this with my thermostats.  I save the various settings in flash, then when the power comes back on after a failure, i read the flash and set temp, mode (cooling, heating), and fan setting based on the last time they were changed.  Sure this will wear the flash memory out over time, so in 2075 or so you might have to think about it a bit.  That way you can get away without using latching relays.  Besides, it'll be fun to do.

Pages: [1] 2 3 ... 64