Show Posts
Pages: [1] 2 3
1  Using Arduino / Motors, Mechanics, and Power / Arduino motor shield and RC car using up battery quickly on: June 07, 2014, 04:47:09 pm
Hello,

I've got an RC car that i took apart and replaced the receiver board with an Arduino. Atop it i've stacked a motor shield, connector to the front steering and back motor. I've got 1 9V battery powering the arduino, and one powering the motor shield (I cut the vin jumper so they have independent power.) There's an ultrasonic sensor in the front that tells the car how far it is from an object, and if it's less than some distance, the car backs up, turns then continues straight.

This runs fine on any new 9V out of the package. However, after about 15 minutes, the car becomes very slow, and eventually the battery can't power the car anymore. It also becomes very hot. My guess is that the motors are using to much current. Is this correct? If so, how would I fix it?

Thanks!
Mihir
2  Using Arduino / Programming Questions / Re: Loops and Ethernet on: April 15, 2014, 07:30:39 pm
This concept is useful, but it unfortunately isn't working in this case. It works if everything is in a loop, but here, there is no loop in the function fadeBlu(). It needs some way to check if there is a new input waiting from the webpage...any idea on how to do that while the loop is still running? i.e. the LED is still fading on and off?
3  Using Arduino / Programming Questions / Loops and Ethernet on: April 13, 2014, 10:24:58 pm
Hello,
I'm working on an ethernet based rgb light. It's quite simple right now. Basically, there are 3 buttons for turning each color of an RGB led on, and 3 for turning it off. The on buttons are supposed to fade the leds in and out. The problem is that the led's won't keep fading in and out unless they're in a loop. When this loop is in place, the program won't turn off the led because it's still in the loop. How do i get around this?

Code is here:
Code:
/*
 Created by Rui Santos
 Edited by Mihir Trivedi
 Visit: http://randomnerdtutorials.com for more arduino projects

 Arduino with Ethernet Shield
 */

#include <SPI.h>
#include <Ethernet.h>
#include <Servo.h>
int red = 6;
int blu = 5;
int grn = 3;
Servo microservo;
int pos = 0;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };   //physical mac address
byte ip[] = { 192, 168, 1, 178 };                      // ip in lan (that's what you need to use in your browser. ("192.168.1.178")
byte gateway[] = { 192, 168, 1, 1 };                   // internet access via router
byte subnet[] = { 255, 255, 255, 0 };                  //subnet mask
EthernetServer server(80);                             //server port     
String readString;

void setup() {
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  pinMode(red, OUTPUT);
  pinMode(grn, OUTPUT);
  pinMode(blu, OUTPUT);
  microservo.attach(7);
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
  digitalWrite(red, LOW);
  digitalWrite(blu, LOW);
  digitalWrite(grn, LOW);

  //delay(10000);
}


void loop() {
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {   
      if (client.available()) {
        char c = client.read();
     
        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string
          readString += c;
          //Serial.print(c);
         }

         //if HTTP request has ended
         if (c == '\n') {         
           Serial.println(readString); //print to serial monitor for debuging
     
           client.println("HTTP/1.1 200 OK"); //send new page
           client.println("Content-Type: text/html");
           client.println();     
           client.println("<HTML>");
           client.println("<HEAD>");
           client.println("<meta name='apple-mobile-web-app-capable' content='yes' />");
           client.println("<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />");
           client.println("<link rel='stylesheet' type='text/css' href='http://randomnerdtutorials.com/ethernetcss.css' />");
           client.println("<TITLE>Random Nerd Tutorials Project</TITLE>");
           client.println("</HEAD>");
           client.println("<BODY>");
           client.println("<H1>Random Nerd Tutorials Project</H1>");
           client.println("<hr />");
           client.println("<br />"); 
           client.println("<H2>Arduino with Ethernet Shield</H2>");
           client.println("<br />"); 
           client.println("<a href=\"/?button1on\"\">Turn on red fade</a>");
           client.println("<a href=\"/?button1off\"\">Turn Off red fade</a><br />");   
           client.println("<br />");     
           client.println("<br />");
           client.println("<a href=\"/?button2on\"\">Turn on blue fade</a>");
           client.println("<a href=\"/?button2off\"\">Turn off blue fade</a><br />");
           client.println("<br><br>");
           client.println("<a href=\"/?button3on\"\">Turn on green fade</a>");
           client.println("<a href=\"/?button3off\"\">Turn off green fade</a><br />");
           client.println("<br><br><br>");
           client.println("<p>Created by Rui Santos. Visit &nbsp;<a href=http://randomnerdtutorials.com> RandomNerdTutorials </a>  &nbsp;for more projects!</p>"); 
           client.println("<br />");
           client.println("</BODY>");
           client.println("</HTML>");
     
           delay(1);
           //stopping client
           client.stop();
           //controls the Arduino if you press the buttons
           if (readString.indexOf("?button1on") >0){
               //digitalWrite(led, HIGH);
               fadeRed();
               Serial.println("ON Red");
           }
           
           if (readString.indexOf("?button1off") >0)
           {
               digitalWrite(red, LOW);
               Serial.println("OFF");
            }
           
           if (readString.indexOf("?button2on") >0)
           {
              fadeBlu();
               Serial.println("ON Blu");
            }
           
           if (readString.indexOf("?button2off") >0){
                digitalWrite(blu,LOW);
               
           }
           
           if (readString.indexOf("?button3on") >0)
           {
              fadeGrn();
               Serial.println("ON Grn");
            }
           
           if (readString.indexOf("?button3off") >0){
                digitalWrite(grn,LOW);
               
           }
            //clearing string for next read
            readString=""; 
           
         }
       }
    }
}
}

void fadeRed ()
{
  for(int fadeValue = 110 ; fadeValue >= 0; fadeValue -=2)
  {
    analogWrite(red, fadeValue);         
    delay(70);                           
  }
  for (int fadeValue = 0;fadeValue <=110; fadeValue +=2)
  {
    analogWrite(red, fadeValue);
    delay(70);
  }
}

void fadeGrn ()
{
 
  for(int fadeValue = 110 ; fadeValue >= 0; fadeValue -=2)
  {
    analogWrite(grn, fadeValue);         
    delay(70);                           
  }
  for (int fadeValue = 0;fadeValue <=110; fadeValue +=2)
  {
    analogWrite(grn, fadeValue);
    delay(70);
  }
}


void fadeBlu ()
{
 
  for(int fadeValue = 110 ; fadeValue >= 0; fadeValue -=2)
  {
    analogWrite(blu, fadeValue);         
    delay(70);                           
  }
  for (int fadeValue = 0;fadeValue <=110; fadeValue +=2)
  {
    analogWrite(blu, fadeValue);
    delay(70);
  }

 
}

4  Using Arduino / Project Guidance / Re: Can i do this project with the Arduino Uno? on: February 25, 2013, 10:36:32 pm
For the printing w/ thermal printer and arduino, check this out: http://learn.adafruit.com/internet-of-things-printer/assembly
5  Using Arduino / Project Guidance / Re: Small Building Light Control on: February 25, 2013, 12:00:50 am
Yeah...But I need it to turn on/off on only certain days, at different times on those days...
6  Using Arduino / Project Guidance / Re: Can i do this project with the Arduino Uno? on: February 24, 2013, 11:54:45 pm
Just a suggestion...incase you decide to use Arduino, the Mega may be more suitable to your project, considering the Mega can handle more in terms of program size and processing power. Especially if a lot of these "transactions" are going to be happening every second or so.
7  Using Arduino / Project Guidance / Re: Small Building Light Control on: February 24, 2013, 12:14:29 am
Hi Nick, So if I use this with the arduino, and I connect it up, if I sent a "HIGH" to digital pin say, 6, and the relay was connected, would that turn on the lights? As in, would that act as a switch for the 110V?

Thanks!
Mihir
8  Using Arduino / Project Guidance / Re: Small Building Light Control on: February 23, 2013, 11:52:34 pm
Looks neat! Thanks Nick!
9  Using Arduino / Project Guidance / Re: Can i do this project with the Arduino Uno? on: February 23, 2013, 11:46:39 pm
Actually, what I thought was to put an RFID key fob for each of the 16 items on a peg board just above the unit. When the person walked by, they would pick up the corresponding key fob, wave it over the unit, type in the weight, hit the # key so that the printer would pint out the information and then log what was done.  If the Alamode is what I think it is, a bridge that sits on the Raspberry Pi, then I think then the information would then be sent to the Pi where it could be organized and sent via email.  Conceptually this all seems to work....... the programming is what scares me now.....

Hmm..I see... Yeah, that should work out fine. Adafruit has a really nice RFID reader that I use: https://www.adafruit.com/products/364 or https://www.adafruit.com/products/789. Don't be scared of programming! I've learned everything i have from the online world of adafruit learning and sparkfun, as well as arduino and a bunch of other websites
that show you how to program.

Mihir
10  Using Arduino / Project Guidance / Small Building Light Control on: February 23, 2013, 11:42:12 pm
Hello,
I've been tasked with making an automated light on/off control for a local museum's hangar. The lights are just normal tube lights controlled by a switch like this: http://images.wisegeek.com/light-switch.jpg. However, I'm a bit at a loss as to how to turn the power on/off. I'm told that the connection is a 110V standard US power line. Should I use a MOSFET for this? I don't think the "timer" part of it will be that hard, if I use something like this: http://www.adafruit.com/products/264. Does anyone have suggestions on how to turn on/off that power line for the lights?

Any help is greatly appreciated.

Thanks!
Mihir (iluvplanes)
11  Using Arduino / Project Guidance / Re: Can i do this project with the Arduino Uno? on: February 23, 2013, 11:27:32 pm
What if I use an RFID reader to read a fob that is the specific item then just type in the weight? I could have 16 of them and the person would just lift the correct one and start the process. They would just have to type in the weight and print.  I just need to see how to log the info and export it though.

Hi,
Well, I've thought about doing something like that too...However, would you be placing something like a RFID sticker on every item, or would it just have a rfid card that you scan with the item? Because if each item had a card for itself, it might turn out to be a bit expensive...

Mihir
12  Using Arduino / Networking, Protocols, and Devices / Re: Website Loading issue on: February 13, 2013, 09:44:53 pm
P.S. I think that it might be a router issue.
13  Using Arduino / Networking, Protocols, and Devices / Website Loading issue on: February 13, 2013, 12:31:58 am
Hello,

I have a domain (mihirtrivedi.com) that i have stored files on to acces from my arduino through the ethernet shield. I was playing around with it on the weekend to find out how to use the dns feature, and I think I changed the port (as in   if (client.connect(serverName, 80)) { ) a couple of times. Now, I am unable to load the webpage in my network. However, the page loads fine in anyone else's network.

Anyone know what might have happened/how to fix this?

Thanks!
14  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield on: January 21, 2013, 10:32:57 pm
The usual way to provide outside access is to use a dynamic IP service like www.no-ip.com or www.dyndns.com and port foward on your router.

Hi zoomkat,
So how would I connect to that service if I decide to buy a domain?
Thanks
MT
15  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield on: January 21, 2013, 10:28:54 pm
MT
You would need to allow or open a port in you router to steer or "forward" the request to the ip address of you Arduino. Also if your using port 80 your ISP most likely blocks requests to port 80 so if you reassign it to port 8080 that should work. You will need to know your ip address assigned to your router  you could use whatsmyip google it. Then enter http://youripaddress:8080 on your phone and if all is well it work.
Don

Hi Don,
Thanks for your reply. It seems that this still doesn't allow me to access my arduino server from outside my wifi network...
MT
Pages: [1] 2 3