Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 25
106  Using Arduino / General Electronics / Re: Battery life with step-up converter on: June 20, 2013, 03:31:20 pm
No it needs to be 3.3V
107  Using Arduino / Project Guidance / Re: Laser interrupt sensor on: June 20, 2013, 03:28:12 pm
I don't know of many blind people that will see the led, but the touch sensor can be the whole enclosure, there are conductive paints / foils & inks, you're expecting someone who is blind to be in the correct position in order to trigger the led, whereas the touch sensor can be accessed in any direction.
Of course I don't expect blind person to see LED. But I with my eyes closed can find where my alarm clock is located, and getting hand close enough will interrupt beam and clock will announce time, and other information. Plus clock will have large arcade buttons and special cutouts (guides) in the acrylic to locate them. Of course conductive sensor are also good idea, I just want to try several ideas. Thus my question about long lasting laser LEDs...
So I take it nobody knows if such diodes exist?
108  Using Arduino / General Electronics / Re: Battery life with step-up converter on: June 20, 2013, 03:18:16 pm
Or a C or D, lot more capacity there.
No that's too big. Sensor needs to be pretty small so I can fit between window and bug screen smiley
Worst case, 9V battery, but then I have to find very efficient voltage regulator...
Fig 57
Ah, there it is! Thanks! smiley
109  Using Arduino / Project Guidance / Re: Laser interrupt sensor on: June 20, 2013, 03:13:02 pm
You probably need neither laser nor collimation.
smiley-eek
110  Using Arduino / Project Guidance / Re: Laser interrupt sensor on: June 20, 2013, 03:09:16 pm
Why not a touch sensor, which will last waaay longer than the led?
I'm not sure how to embed it in the acrylic enclosure. It'll have to cover some area...
What sort of separation do you need?
Between emitter and sensor?  About 6 inches
111  Using Arduino / Project Guidance / Re: Laser interrupt sensor on: June 20, 2013, 02:57:59 pm
Why does it have to be a laser?
A collimated LED may be more sensible.
Doesn't have to be a laser, but it needs to be small and cheap smiley  I'm no familiar with collimated LED, is it some kind of LED with focusing lens?
112  Using Arduino / Project Guidance / Laser interrupt sensor on: June 20, 2013, 02:53:09 pm
I want to make talking clock for people who can't see. I'm thinking about using laser diode and photo-resistor so when person's hand interrupts beam it will trigger clock to announce time.  Right now I'm having difficult time finding a low power laser diode that's rated to for long constant operation. Are there such diodes that can work for years nonstop?
113  Using Arduino / General Electronics / Re: Battery life with step-up converter on: June 20, 2013, 02:01:33 pm
You also have to figure that powerout = powerin minus some loss.
Spec on the part is

"High Efficiency 85% (Vin = 2.0 V, VOUT = 3.0 V, 70 mA)"

So powerout = 2000mAH * 0.85 = 1700mA roughly.
What's your current draw going to be like?
Thanks!  Draw should be pretty low but I haven't calculated it yet. I'm powering Moteino w/ RFM12B transmitter and DS18B20 temp sensor.  Without putting chip to sleep and sending readings every 30 seconds I my AA lasted  just a little under 1 week.  So I wanted to figure out if step-up converter might be burning much of the juice. My goal is for battery to last at least a year. I plan to try using Watchdog timer and only transmit readings once every 5 minutes. Also I might use 2 AA...
114  Using Arduino / General Electronics / Re: Battery life with step-up converter on: June 20, 2013, 01:45:19 pm
Datasheet gives operating current for each variant, the 3V3 one is 45uA, typical.
2000mAh / 45uA = 5 years.  Your battery will self-discharge much faster than that.
Excellent! Thank you very much! Out of curious where did you find 45uA number?  I don't see it in the Datasheet...
115  Using Arduino / General Electronics / Battery life with step-up converter on: June 20, 2013, 01:33:48 pm
I would like some help figuring out how long a typical single AA battery (2000mAh) will last connected to a 3.3V step up converter without any load.  This is the converter I'm using.  There's datasheet but I'm not entirely sure how to get information that I need to determine battery life.
116  Using Arduino / Programming Questions / Re: Arduino WebServer input on: May 29, 2013, 06:28:26 pm
Some simple web page control code.

Neat! Thanks for sharing!
I also got mine working. It drives Roomba across the room smiley  Although bumper sensors are not working for some strange reason (I enabled Safe mode which suppose to override any movement if Roomba encounters obstacle).  Am attaching the code (very rough, but it works!) in case anyone is interested. It uses Serial1 ports of Arduino Mega, so if you have Uno you'll need to adjust it (use SoftwareSerial instead).
117  Using Arduino / Programming Questions / Re: Arduino WebServer input on: May 29, 2013, 04:18:33 pm
Code:
Referer: http://192.168.1.113/?myDir=FW

There's your problem, the last link you pressed becomse the referrer. How about searching for

 smiley-eek-blue That's it!  smiley-eek
Thank you thank you thank you thank you!!! smiley  Totally works now! smiley
118  Using Arduino / Programming Questions / Re: Arduino WebServer input on: May 29, 2013, 04:12:11 pm
Code:
                    processDir(client);
                    Serial.print(HTTP_req);
                    HTTP_req = "";    // finished with request, empty string
Why not print the GET request first? That way, you'd know what you are parsing.

Why not share that output with us? You are the only one that can see it, so there is only one of us that can actually help you.
Good point. I switched it around. Here's output. I basically first loaded page, then pressed Forward, then Back twice.
Code:
server is at 192.168.1.113
GET / HTTP/1.1
Host: 192.168.1.113
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

GET /?myDir=FW HTTP/1.1
Host: 192.168.1.113
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.113/
Connection: keep-alive

Go Forward!
GET /?myDir=BW HTTP/1.1
Host: 192.168.1.113
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.113/?myDir=FW
Connection: keep-alive

Go Forward!
Go Back!
GET /?myDir=BW HTTP/1.1
Host: 192.168.1.113
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://192.168.1.113/?myDir=BW
Connection: keep-alive

Go Back!
119  Using Arduino / Programming Questions / Re: Arduino WebServer input on: May 29, 2013, 02:29:10 pm
Using Strings (memory leaks) and "indexOf" kind of bothers me, but I'm not sure if there's a better way smiley

There is the standard C string, (array of chars), which in my opinion are easier to use (since I never used the String class). With arrays of chars you use the function strcmp (or maybe better in your case: strncmp) to compare 2 strings. Try it, it will most likely solve your problem smiley-wink

Thank you!
You mean define string as: char myString[X] ?  How would I know that size of array should be?
120  Using Arduino / Programming Questions / Arduino WebServer input on: May 29, 2013, 02:01:21 pm
I'm writing a sketch to control Roomba over internet. However I'm having most problems with processing webpage input in the sketch smiley-sad
Below is the test sketch I use, it just displays page with simple links that pass variables via GET method. It just outputs to serial some text depending on which link is pressed (i.e. Go Forward!).
However for some reason it doesn't work right. For example when I click forward first time, it echoes Go Forward!, but if I now click Backward it echoes "Go Forward! Go Backward!". I have no clue why it does it. It seems to remember last value...
Code:
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1, 113);

EthernetServer server(80);

String HTTP_req;          // stores the HTTP request
boolean LED_status = 0;   // state of LED, off by default
byte LEDPin  = 13;

void setup()
{
    Ethernet.begin(mac, ip);  // initialize Ethernet device
    server.begin();           // start to listen for clients
    Serial.begin(115200);       // for diagnostics
    Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

void loop()
{
    EthernetClient client = server.available();  // try to get client

    if (client) {  // got client?
        boolean currentLineIsBlank = true;
        while (client.connected()) {
            if (client.available()) {   // client data available to read
                char c = client.read(); // read 1 byte (character) from client
                HTTP_req += c;  // save the HTTP request 1 char at a time
                // last line of client request is blank and ends with \n
                // respond to client only after last line received
                if (c == '\n' && currentLineIsBlank) {
                    // send a standard http response header
                    sendHeader(client);
                    // send web page
                    showBody(client);
                    processDir(client);
                    Serial.print(HTTP_req);
                    HTTP_req = "";    // finished with request, empty string
                    break;
                }
                // every line of text received from the client ends with \r\n
                if (c == '\n') {
                    // last character on line of received text
                    // starting new line with next character read
                    currentLineIsBlank = true;
                }
                else if (c != '\r') {
                    // a text character was received from client
                    currentLineIsBlank = false;
                }
            } // end if (client.available())
        } // end while (client.connected())
        delay(1);      // give the web browser time to receive the data
        client.stop(); // close the connection
    } // end if (client)
}

void sendHeader(EthernetClient client){
   client.println("HTTP/1.1 200 OK");
   client.println("Content-Type: text/html");
   client.println("Connection: close");
   client.println();
}

void showBody (EthernetClient client){
 client.println ("<html><head><title></title></head>");
 client.println ("<body><h1>Test Page</h1><p><a href='?myDir=FW'>Forward </a>| <a href='?myDir=BW'>Back </a>| <a href='?myDir=ST'>Stop</a></p></p></body></html>");

}

void processDir (EthernetClient client){
  if (HTTP_req.indexOf("myDir=FW") > -1) Serial.println ("Go Forward!");
  if (HTTP_req.indexOf("myDir=BW") > -1) Serial.println ("Go Back!");
  if (HTTP_req.indexOf("myDir=ST") > -1) Serial.println ("All Stop!");
}

And by all means if you can suggest a better way to process input please do. Using Strings (memory leaks) and "indexOf" kind of bothers me, but I'm not sure if there's a better way smiley
Pages: 1 ... 6 7 [8] 9 10 ... 25