Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Sensors / Sparkfun Weather Instruments and Noise on: February 09, 2013, 07:03:18 pm
Hi all,

I've got the Sparkfun wind and rain guage sensors. The wind part seemed to be fine, but all the time I've had issues with false readings from the rain guage. I've determined it doesn't seem to be moving, but it may be that wind occasionally makes the bucket tip falsely.

In the thread from Sparkfun's listing of the item I found this circuit: http://spassbremse.de/wordpress/wp-content/uploads/2012/04/windfahne_Schaltplan.png which adds an RC circuit for low pass filtering. Since adding this in the way shown, I now get no readings at all from either instrument the wind speed or rain guage instruments. I did however discover that I got false readings when switching my soldering iron on or off.

Since then I've added a .22mF capacitor between the power and ground rail, but still got one false trigger on the rain guage when switching my iron on or off. Any suggestions for making this thing workable? I'm running it in a USB powered way. Thanks,

David
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Monitoring Serial Port in Perl without using 100% CPU on: February 06, 2013, 07:31:08 am
Thanks, sleeping fixed it up. Seemed silly that such simple code would chew so much. Thanks,

David
3  Using Arduino / Interfacing w/ Software on the Computer / Monitoring Serial Port in Perl without using 100% CPU on: February 05, 2013, 07:16:04 am
Hi,

I've implemented a Perl script using this page as a template: http://playground.arduino.cc/interfacing/PERL

The while(1) loop uses 100% of the CPU power available. Is there a way to do this without using so much processor load? In my case the Arduino spits out a line of telemetry once per second. The perl script reads this and inserts it into a db. Any suggestions about better ways to do this? Thanks,

David
4  Using Arduino / General Electronics / Re: Rotary Encoder Tutorial port to Arduino Uno on: January 26, 2012, 11:31:24 pm
Yeah it's a mechanical encoder, specifically this one: http://www.sparkfun.com/products/10596

I guess I'm a bit unclear on the idea of pullup and pulldown resistors and the need for them. I don't quite get why I/O lines float, or why it's suggested to use 220k resistors for such purpose in some of the tutorials. Some tutorials don't even seem to use them. Can you point me to a good reference or what I should be looking up? Thanks,

David
5  Using Arduino / General Electronics / Re: Rotary Encoder Tutorial port to Arduino Uno on: January 25, 2012, 10:23:08 pm
Thanks. I've still got dramas though. I've decided to go with A0 and A1. At the moment though I can only ever get the encoder to change values if I'm touching the metal housing with my hand. I'm tried it with 5V common and swapping A and B to see if I've got them right.

Should there be pullup resistors in the circuit(I saw them mentioned in the tutorial, but no details). Also should the common be 5V or GND? Thanks,

David
6  Using Arduino / General Electronics / Rotary Encoder Tutorial port to Arduino Uno on: January 25, 2012, 04:43:45 am
I'm using this tutorial to try to program my Arduino Uno to read a rotary encoder: http://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino

The difference is he is on a Atmega168 platform where the Uno is Atmega328. I have the A side of my encoder in A5 and the B side in A4, but have tried them reversed too. I've adjusted the code thusly:

#define ENC_A A5
#define ENC_B A4
#define ENC_PORT PINC

I haven't made any changes in the read_encoder function though. I suspect the hex values should be different?

At this poing I get the following output:

Starting
Counter value: 0
Counter value: 1

Then nothing else, no matter how I turn the knob. Any suggestions? Thanks,

David


7  Using Arduino / LEDs and Multiplexing / Re: Low range in IR Transmitter on: January 14, 2012, 09:55:27 pm
The one I'm using says it has a 1.5VDC forward voltage and 50mA max forward current. I was thinking about adding a transistor though, so will look into that. Thanks,

David
8  Using Arduino / LEDs and Multiplexing / Low range in IR Transmitter on: January 14, 2012, 09:37:58 pm
Hi, I'm using the circuit and code described here: http://controlyourcamera.blogspot.com/2010/01/infrared-controlled-timelapse.html

I'm finding though that it's a bit unreliable. I have to have the camera very close up to make it work. I've tried swapping a ordinary red LED for the IR one, and even when turned on continuously it seems rather dim. Should I try a different resistor value to the 100 ohm? Thanks,

David
9  Using Arduino / Networking, Protocols, and Devices / Re: Telnet Style TCP Network Interface on: December 28, 2011, 08:41:30 pm
I've now implemented this method:

Code:
void telnetServer() {

  EthernetClient client = server.available();
 
  if (client) {
 
    String outputString = (String)freq1 + ", " + (String)freq2 + ", " + (String)tsl_sens + ", ";   
   
    client.print(outputString);
    client.println(w);

  }
 
}

This is just called in my main sensor reading loop after each time a sample is taken.

How can I add some code to make it look for a "start" command to start sending data and a "stop" command to make it stop sending data and drop the connection? At the moment it just starts spitting the data out after i send a line to it. Thanks,

David
10  Using Arduino / Networking, Protocols, and Devices / Telnet Style TCP Network Interface on: December 14, 2011, 10:59:38 pm
Hi, I've been using web interfaces for sensor devices on Arduinos so far, but am wondering if a telnet type session would be more appropriate. Has anyone else done a network interface in their sketch where you can just go like "telnet arduino 1337" and have it echo out sensor readings and accept input that way? Any disadvantages from this technique? Thanks,

David
11  Using Arduino / Networking, Protocols, and Devices / Re: Unreliable HTTP Server on: December 08, 2011, 02:48:48 am
I've been thinking about that. Perhaps it could be due to the electronics I've got on my protoshield. I might remove that and see what happens. Barring that I've been thinking I might get a standard Ethernet shield for my Aruduino Uno and see if that performs differently. Thanks,

David
12  Using Arduino / Networking, Protocols, and Devices / Re: Unreliable HTTP Server on: December 07, 2011, 08:31:28 pm
I tried that modification on the w5100.h file. It's in a slightly different location, but same code. After recompiling I'm getting the same error. After about reload 80 on Zoomkat's sketch it's corrupted again and by 89 it seems to be all locked up. Thanks,

David
13  Using Arduino / Networking, Protocols, and Devices / Re: Unreliable HTTP Server on: December 07, 2011, 06:31:06 am
Thanks. Tried that sketch, just modified IP address to suit my network and changed Server and Client to EthernetServer and EthernetClient respectively for Arduino 1.0. On refresh 96 I got corrupted output, and continued on 97 and 98.

Code:
Zoomkat's meta-refresh test
t's meta-refresh test
Zoomkat's meta-refresh test
page refresh number 97

Zoomkat's arduino analog input valuesHTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
HTTP/1.1 200 OK Content-Type: text/html HTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
page refresh number 103

Zoomkat's arduino analog input values:

analog input 0 is 651
analog input 1 is 447
analog input 2 is 347
analog input 3 is 257
analog input 4 is 1023
analog input 5 is 1023
analog input 0 is 658
analog input 1 is 454
analog input 2 is 353 Zoomkat's meta-refresh test
page refresh number 107

Zoomkat's arduino analog input values:

analog input 0 is 648
analog input 1 is 444
analog input 2 is 344
analog input 3 is 254
analog input 4 is 1023
analog input 5 is 1023
E />Zoomkat's meta-refresh test Zoomkat's meta-refresh test
page refresh number 105

Zoomkat's arduino analog input values:

analog input 0 is 650
analog iHTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
t's meta-refresh test
Zoomkat's meta-refresh test
page refresh number 97

Zoomkat's arduino analog input valuesHTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
HTTP/1.1 200 OK Content-Type: text/html HTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
page refresh number 103

Zoomkat's arduino analog input values:

analog input 0 is 651
analog input 1 is 447
analog input 2 is 347
analog input 3 is 257
analog input 4 is 1023
analog input 5 is 1023
analog input 0 is 658
analog input 1 is 454
analog input 2 is 353 Zoomkat's meta-refresh test
page refresh number 107

Zoomkat's arduino analog input values:

analog input 0 is 648
analog input 1 is 444
analog input 2 is 344
analog input 3 is 254
analog input 4 is 1023
analog input 5 is 1023
E />Zoomkat's meta-refresh test Zoomkat's meta-refresh test
page refresh number 105

Zoomkat's arduino analog input values:

analog input 0 is 650
analog iHTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
t's meta-refresh test
Zoomkat's meta-refresh test
page refresh number 97

Zoomkat's arduino analog input valuesHTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
HTTP/1.1 200 OK Content-Type: text/html HTTP/1.1 200 OK Content-Type: text/html Zoomkat's meta-refresh test
page refresh number 103

Zoomkat's arduino analog input values:

analog input 0 is 651
analog input 1 is 447
analog input 2 is 347
analog input 3 is 257
analog input 4 is 1023
analog input 5 is 1023
analog input 0 is 658
analog input 1 is 454
analog input 2 is 353 Zoomkat's meta-refresh test
page refresh number 107

Zoomkat's arduino analog input values:

analog input 0 is 648
analog input 1 is 444
analog input 2 is 344
analog input 3 is 254
analog input 4 is 1023
analog input 5 is 1023
E />Zoomkat's meta-refresh test Zoomkat's meta-refresh test
page refresh number 105

Zoomkat's arduino analog input values:

analog input 0 is 650

It goes on like this for some length, that's a truncated version of the full output. The first corrupted refresh it was only the length of the normal page when it worked. After this page I've posted here it basically locked up. Thanks,

David
14  Using Arduino / Networking, Protocols, and Devices / Re: Unreliable HTTP Server on: December 07, 2011, 05:38:31 am
The whole sketch is quite large, but here is the webserver portion:

Code:
void webServer() {
 
  char clientline[BUFSIZ];
  int index = 0;
 
  EthernetClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean current_line_is_blank = true;
   
    // reset the input buffer
    index = 0;
   
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
       
        // If it isn't a new line, add the character to the buffer
        if (c != '\n' && c != '\r') {
          clientline[index] = c;
          index++;
          // are we too big for the buffer? start tossing out data
          if (index >= BUFSIZ)
            index = BUFSIZ -1;
         
          // continue to read more data!
          continue;
        }
       
        // got a \n or \r new line, which means the string is done
        clientline[index] = 0;
       
        // Look for substring such as a request to get the root file
        if (strstr(clientline, "GET / ") != 0) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/plain");
          client.println();
         
//          String dateString = (String)year() + "-" + (String)month() + "-" + (String)day() + " " + (String)hour() + ":" + (String)minute() + ":" + (String)second();
         
//          client.println(dateString);
          client.println(mW);
//          client.println(jouleCounter);
//          client.println(avFreq);
//          client.println(tsl_sens);

        }
        break;
      }
    }
    // give the web browser time to receive the data
    delay(1);
    client.stop();
  }
 
}
Basically a lift from the WebServer example sketch. But as I say I saw the WebServer example sketch do the exact same thing. Is there something I should be doing to ensure the buffers on the w5100 don't get full or do other untoward things? Thanks,

David
15  Using Arduino / Networking, Protocols, and Devices / Unreliable HTTP Server on: December 07, 2011, 02:27:38 am
Hi, I've been plagued with problems with running a HTTP server off a Freetronics Etherten which is an Arduino Uno with ethernet shield built in. I get corruptions in the data sent back from the HTTP server. I was previously using Arduino 22 but now have started using 1.0.

I've still got the same corruptions. It seems to happen after the program has ran for a little while. Suggestions were that it was caused by running out of memory, but FreeMemory.h's routine placed in all different locations in the program never showed any less than 1000 bytes free. I've tried other things with buffers as well.

Finally in frustration I loaded the example WebServer sketch that comes with the Arduino download, and set up a perl script to query the server once every second. After about 30 seconds I got the same corrupt reply.

The corrupt reply usually contains random binary data interspersed with old strings from the program, sometimes from previous versions of the sketch that had been replaced with newer versions, as if somewhere in memory strings were staying around.

Does anyone have any other tips or suggestions of where I could start to look? I'm beginning to think it's a waste of time to do use anything other than USB Serial with Arduinos. Thanks,

David
Pages: [1] 2 3 4