Show Posts
Pages: 1 2 3 [4] 5 6 ... 62
46  Topics / Home Automation and Networked Objects / Re: Standalone Datacollecting Webserver on: March 06, 2013, 05:22:37 pm
You can send the data from a lot of sensors to cosm.  I send several to them.  The provide an easy way to get graphs, one data set at a time.  If you want to graph temperature and humidity, it's easy to send them the data and get graphs for each of them.  If you want both of them on the same graph, it gets harder.  The graph I have is temperature and power usage; that took some javascript code to do.  I just used the google graph api and some javascript code to do mine.

Take an actual look at cosm, they have a ton of articles on how to send the data and get it back to do something with.
47  Topics / Home Automation and Networked Objects / Re: Standalone Datacollecting Webserver on: March 06, 2013, 11:14:53 am
I collect and store data on cosm for my house; have been doing this for a few years now.  I have an arduino 2560 that acts as a collector for the various sensors and controls around the house and I send some of the data up to cosm, emoncms, and thingspeak.  The reason I send it to all three of these is that I wanted to try out as many of the cloud storage services for this kind of thing as I could.  The arduino collector also serves as a web server for control and monitoring of the house.  I can load its web page and it will tell me what's going on and I can change things if I want to.  

I put together some json code and it runs in the user's browser to present a graph of temperature and power usage for a 24 hour period.  I did it this way because I wanted it to be as close to real time as possible and I wanted to be able to expand the graph enough to see what appliances were running (you get to know them intimately over time).  The cool thing about using the user's browser is that the arduino doesn't have to do any work, it just sends code to the browser.  The json code is held on a cloud server as well so that it doesn't take up space on the arduino.

You can see the screen I put up to monitor the house, but remember, it's an arduino with 4 simultaneous connections, so you may have to try a couple of times to actually get in.  Once you get in and the page starts to load, the data for the last 24 hours is gathered and presented on your browser, so it may take 10 seconds or so to collect, and sometimes cosm will time out first.  The timeout doesn't happen very often so it doesn't bother me.  If you hit it with a cell phone, the little browsers on them sometimes don't like the iframe that holds the graphs and gauges, just use a different browser or use a pc.

This is very much a work in progress and probably will be for a long time.  I change it pretty often, mostly because I can, but sometimes I add or change something based on experience. The little arduino is at <link>, but be kind to it, it's only a little arduino, not a bank of servers like google or bing.

Oh, I also write about this setup on my blog, see the signature line for the link.
48  Topics / Home Automation and Networked Objects / Re: Arduino reset when serial buffer overflows? on: March 05, 2013, 01:37:47 pm
Good point.  You may be stuck without an answer until something kicks it into failing again and you have the time to chase the problem.
49  Topics / Home Automation and Networked Objects / Re: Arduino reset when serial buffer overflows? on: March 05, 2013, 01:15:21 pm
The difference between the two is that the XBee will automatically retry the transmission.  This means a longer transmission time if it can't get the message out.  This will use a little more power, but it doesn't sound like enough to kill things.  I'm not familiar with the shield, could it have something floating around the reset pin?  Maybe pull it high as an experiment or something.

I had an arduino close to a permanent magnet motor (a big one) and the reset pin had a wire running to a switch on the side of the enclosure.  The arduino would reset sometimes because the wire picked up enough noise from the motor to actually reset the board.  Totally random event and it was easy to fix by filtering the stupid wire.  Took a while to figure out though since my presence in the noise field would cause it to stop having a problem.  Every time I sat and watched the thing to see what was going on, it quit failing.
50  Topics / Home Automation and Networked Objects / Re: Arduino reset when serial buffer overflows? on: March 05, 2013, 12:57:26 pm
Before you give up on the idea though, take a quick check of the voltage to the power pin on the processor.  It could drop while the VIN is staying stable.  I've never seen this on an arduino, but I have on other devices where the 3.3 volts is derived from 5V regulator instead of the VIN.  I suspect it is staying stable because it didn't die when you moved the antenna.

But, there a lot of arduinos out there that have nothing hooked to the serial pins when they are running, and they're putting debug info out the serial port all the time without any problem.  I have a bunch of those and they never reboot because of buffer overflows.

51  Topics / Home Automation and Networked Objects / Re: Arduino reset when serial buffer overflows? on: March 05, 2013, 12:35:10 pm
No, the arduino doesn't reset when the serial buffer overflows.  I took a look at your code and didn't see anything that would obviously cause it to reboot.  However, it's just slightly possible that your robbing the device of power during transmission.  I say this because I had an arduino that was rebooting (I didn't know, it was hidden away) when it was transmitting.  Seems the XBee was sucking the life out of the power supply and lowering the voltage enough to cause a reboot periodically and unpredictably.  A new power supply fixed this problem.
52  Using Arduino / Project Guidance / Re: Do you need wireless shield for xbees? on: March 03, 2013, 11:43:55 pm
shields are nice and make the combination of devices convenient, but not absolutely necessary.  The serial pins are 5V tolerant and the arduino has a 3V supply.  I recommend choosing a shield that will meet your needs, but if you haven't when the XBees arrive, you can always wire them in direct to start your project.  Also, you don't need a full blown shield, there are breakout boards that can do the job.  Sparkfun and adafruit both have them and there are others out there.  Search around and read their capabilities before choosing, don't just grab the first one you run across.
53  Topics / Home Automation and Networked Objects / Re: server client togheter on: March 03, 2013, 09:55:39 pm
Let me sure I understand.  You want one arduino to be both a client and a server, and you have another arduino that you want to be a server.  So, the PC as a client sends to the first arduino which turns on a light, then that arduino sends to the second one that also turns on a light.

If I got that correct, you can certainly do it.  You'll have to combine the server and client examples in the playground on one of the arduinos which is a little confusing, but I've done it a few times successfully.  The the second arduino is just the client example, or you can duplicate the first arduino and just not use the client code until later when you expand the system.
54  Topics / Home Automation and Networked Objects / Re: Home Power Monitor System, are their plans for one out there? on: March 02, 2013, 08:41:48 pm
Quote
The current clamp methods do work, but are nowhere near as accurate , mainly because they dont measure the voltage, only the current.

Go look at the site above, they measure the voltage.  They also have done a lot of comparisons with various wattmeters and come out pretty darn close.  Using the pulses from the power meter is probably the best way to go, if you have pulses.  A heck of a lot of us don't have pulses to measure.  My setup measures the voltage and the current and compares very, very favorably with the power meter.  I don't accumulate the readings, too many power failures, but I can tell you instantaneous usage on a second by second basis, which the power company won't tell me.
55  Topics / Home Automation and Networked Objects / Re: Automated Reptile Control System(webserver, Data Logging, RTC and much more) on: March 01, 2013, 12:59:08 pm
Go to the playground and look at the Time and TimeAlarms library.  You don't have to actually set the time, but you already have an RTC, so it should be easy to do.  In the Time header file are a lot of macros including days between dates and such.  Also, out on the web are a ton of days between dates routines that you can use.  Most of the samples also have the seconds between date that will work for you as well, although saving the unix time when you start and just subtracting it from the current time will give you seconds pretty easily.
56  Topics / Home Automation and Networked Objects / Re: Home Power Monitor System, are their plans for one out there? on: March 01, 2013, 09:19:38 am
Yep, it's mentioned a few times on the site.  http://openenergymonitor.org/emon/

57  Topics / Home Automation and Networked Objects / Re: Automated Reptile Control System(webserver, Data Logging, RTC and much more) on: February 27, 2013, 01:30:09 pm
You probably need to sprinkle them around more places.  I've had to go so far as to put them before the return of many routines to get a clue what was happening.  Sometimes when you're recursing, the level of recursion can get so deep that you run out of memory.  If it returns, the memory unwinds back to a good level.  This can happen when some routine allocates and then calls something else as well.

You can get lost and not have any idea what the heck happened until you really start to dissect it.

But then, you could also just be running past the end of some buffer somewhere and clobbering yourself.  These problems can be tough to find.  Been there, done that...sigh.
58  Topics / Home Automation and Networked Objects / Re: Automated Reptile Control System(webserver, Data Logging, RTC and much more) on: February 27, 2013, 01:15:34 pm
Check in the playground for memory usage.  There are a couple of routines there that can tell you how much you have left at any given time.  I use them extensively to keep away from running out of memory.  You can put them in temporarily to measure what you have left and isolate a problem area then fix whatever is needed.

In a couple of hard cases, I put them in the loop() and automatically rebooted the board to clean things out when free memory reached a low number.  This was a stop gap measure I used while I tried to figure out what the heck was going on.  These days, I try desperately to avoid using Strings and use the old reliable strcat, strcmp, etc. instead.

Something like:
Code:
#include <avr/pgmspace.h>

void showMem(){
  uint8_t * heapptr, * stackptr;
 
  strcpy_P(Dbuf,PSTR("Mem = "));
  Serial.print(Dbuf);
  stackptr = (uint8_t *)malloc(4);   // use stackptr temporarily
  heapptr = stackptr;                // save value of heap pointer
  free(stackptr);                    // free up the memory again (sets stackptr to 0)
  stackptr =  (uint8_t *)(SP);       // save value of stack pointer
  Serial.println(stackptr - heapptr);
}

// and then sprinkle these around to get a feel for what is going on

    showMem();
Or maybe you would prefer:
Code:
#include <MemoryFree.h>

void showMem(){
  strcpy_P(Dbuf,PSTR("Mem = "));
  Serial.print(Dbuf);
  Serial.println(freeMemory());
}

// and then, as above, I sprinkle these around to see what is happening

showMem();
I use both in different applications.  Don't have a preference either way.
59  Topics / Home Automation and Networked Objects / Re: Newbie project-Solar monitoring system on: February 27, 2013, 09:37:26 am
LOL, many people have exactly the same problem with the language.  Even after you get proficient enough with the words, you'll have problems with the jargon.  Each sub-field has a specific language they speak.  Get volts, amps, resistance, and reluctance under control first then you'll have a much easier time understanding.

With your particular project, you'll be facing wires that are bigger than you expected and hard to bend, hook together, or even purchase due to the content of metal in them.  But, it's a really cool and useful thing to do and well worth the effort.

But people love to help with projects like this, so you won't have too much trouble getting advice and suggestions.
60  Topics / Home Automation and Networked Objects / Re: Runing small program in main loop on: February 27, 2013, 09:17:41 am
Mikee, after you experiment with timers, and get an understanding, come back to the forum and talk with us about temperature sensors and humidity sensors.  You could use both of these in your house.  Also, you can even sense airflow so you'll be sure the exhaust hasn't been plugged by something.

This will be a nice project.
Pages: 1 2 3 [4] 5 6 ... 62