Show Posts
Pages: 1 ... 36 37 [38] 39 40 ... 44
556  Using Arduino / Motors, Mechanics, and Power / Re: max current for v5 pin on: February 25, 2011, 05:17:41 pm
I dunno, this 7812 gets really hot when my solenoid turns on. It's dropping the voltage from a 12 volt wall wart down to 12 volts, so I didn't think I'd even need a heat sink.  The solenoid is 550 mA.  I think I'll just use a 9 volt wall wart.  (the solenoid turns on if I hook it up to a 9 volt battery). And a 9 volt wall wart will probably end up being closer to 12 volt any way.  then I also won't have to worry about the 12 volt wart putting 16 volts into my Uno, when the solenoid is not running.
557  Using Arduino / Sensors / Re: Sensor Test -- something simple must be wrong here? on: February 25, 2011, 03:58:06 pm
Thanks!  I was about to pull my hair out!
558  Using Arduino / Displays / Re: shiftreg alternate IC on: February 25, 2011, 03:50:10 pm
2 wire
559  Using Arduino / Sensors / Sensor Test -- something simple must be wrong here? on: February 25, 2011, 02:29:41 pm
Testing out a flow sensor (http://www.seeedstudio.com/depot/datasheet/water%20flow%20sensor%20datasheet.pdf)
This blinks the LED normal (2 times, at 1 second each) as the loop shows, but when I blow through the flow sensor, it shows the increasing pulses on the serial monitor, but when it reaches the limit, it flashes the LED 3 times, but so fast I can hardly tell.  If I change the line to
Code:
blink(ledPin, 3, 30000);
then it flashes at about one per second!
What is wrong here!?


Code:
const int ledPin = 13;  //LED pin
volatile int FlowSensorCount;  //the counter for the flow sensor

void setup() {
//Setup Pins
pinMode(ledPin, OUTPUT);     
attachInterrupt(0, CountPulse, RISING);  //turn on interrupt for flow sensor on pin 2
Serial.begin(9600);
}

void loop()

Serial.println(FlowSensorCount);

noInterrupts();
      if (FlowSensorCount > 30)
      {
        blink(ledPin, 3, 3000);
        delay(5000);
        FlowSensorCount = 0;
      }
interrupts();



blink ( ledPin, 2, 1000);
delay(2000);
  }


void blink(int whatPin, int howManyTimes, int milliSecs) { 
    int i = 0;
    for ( i = 0; i < howManyTimes; i++) {
      digitalWrite(whatPin, HIGH);
      delay(milliSecs/2);
      digitalWrite(whatPin, LOW);
      delay(milliSecs/2);
    }
}


 
void CountPulse()
{
   FlowSensorCount++;  //increases the count from the interupt pin 2
}
560  Using Arduino / Motors, Mechanics, and Power / Re: max current for v5 pin on: February 25, 2011, 10:57:35 am
I need 12 v to run something else- a solenoid.
I'll just through a 7812 on my shield as well to power the Uno Vin pin.  With my solenoid and motor power coming directly off my shield, my Uno won't really be drawing a whole lot of current, I don't think, just telling things when to turn on/off, and powering an LCD.
I don't need any control over my motor speed, just forward/reverse, and I don't have any extra pins to regulate it's voltage.
561  Using Arduino / Motors, Mechanics, and Power / Re: max current for v5 pin on: February 25, 2011, 10:21:04 am
Thanks!  I think I will remove the DC Jack from the board, and put a DC Jack on my shield.  Then I won't have to send any current through the Uno.  I'll use a 7805 regulator for my motor.  It will be powered from a 12 volt 1 amp wall wart.  They run about 16 volts with no load, that should be fine to feed directly from the DC Jack on my shield into the Vin PIN on the Uno to power it, right?
562  Using Arduino / Motors, Mechanics, and Power / max current for v5 pin on: February 25, 2011, 09:18:31 am
How much current can the Uno supply on the 5 volt pin, I can't find this info in the specs.
I'm wondering if it enough to run my motor circuit (SparkFun's 1:100 Mini gearmotor @ 90 mA).  I'm using the H bridge as decribed here: http://itp.nyu.edu/physcomp/Labs/DCMotorControl

It'll just be used for about 2 seconds at any one time.  It does have a high stall current, though my setup will not be able to stall the high torque gear ratio.
563  Using Arduino / Displays / Re: shiftreg alternate IC on: February 24, 2011, 04:46:49 pm
I'm going to today,
with this tutorial:
http://code.google.com/p/arduinoshiftreglcd/
it looks like a great tutorial.
564  Using Arduino / Displays / Re: LCD Backlight current on: February 24, 2011, 10:13:06 am
I just ordered this from SparkFun.
http://www.sparkfun.com/products/709
white on black LCD...
the spec sheet says
typical LED voltage 4.2
typical LED current 120ma

so, on the 5volt pin, (5.0 - 4.2)volts/ .120 = 5 ohms?

565  Using Arduino / General Electronics / Re: tx & rx pins on: February 24, 2011, 01:44:03 am
Yes it's important for code to be clear to a human as well as correct for the computer. And just to show that I don't practice what I preach, here's a line from the app I'm writing now.

Code:
Serial.print (isprint(((*(start + i)) & 0xFF)) ? (*(start + i)& 0xFF) : '.', BYTE);

Quick, you have 5 seconds to tell me what this does smiley

______
Rob

...errrr, ummmm...
566  Using Arduino / General Electronics / Re: tx & rx pins on: February 24, 2011, 01:26:31 am
Quote
Code:
do
    {
      key = keypad.getKey();  //check for key event
      if (key = '0') return;       //action canceled
      if (key = '1')
      {
        for (int i=0; i < 5; i++){
          MySettings.mySensVals[i] = 0;  //reset sensor values
        }
        EEPROM_writeAnything(0, MySettings);  //save the settings
        srlcd.print("Completed!");
        delay(4000);  //wait for user to read message
        return;
      }
    }
  while (1);

I like it.  I can read it.  I looked at the conglomeration of NOTs, ORs, AND's, and WHILEs, and still couldn't get it.
I can follow this!
567  Using Arduino / General Electronics / Re: tx & rx pins on: February 24, 2011, 12:42:08 am
Thanks!  I'm trying to take in everything you said, I got most of it.
What about the Confirm_Pour() function, I will need the while statement or some kind of loop statement, won't I.  It's to give the user the option to cancel, after they enter a number.
How does this look:
Code:
void Confirm_Pour()
{
  srlcd.clear(); // Clear display, set cursor position to zero
  srlcd.print(key);  //LCD display the number they selected
  srlcd.print(" cups"); //plus cups
  srlcd.setCursor(0, 1); // Sets cursor position to the 2nd line
  srlcd.print("Press '*' to start or # to cancel"); //This needs to scroll across the 2nd line somehow so it can all be read
  do
  {
    key = keypad.getKey();
    if (key == '*') PourWater();  //turn on the water
    if (key == '#')
    {
      srlcd.clear();
      srlcd.print("Action canceled");
      delay (5000); //wait for user to read message
      return;  //go back to the main loop routine
    }
  }
  while(key == NO_KEY);   
}

Quote
while(key = NO_KEY); 
fixed

Quote
PourWater =>  PourWater()

fixed

Quote
Code:
   while (key != NO_KEY)
    {
      key = keypad.getKey();
      //just waiting for a key press here to start water flow...
    }
Shouldn't these be "key == NO_KEY"?
yes, fixed


Quote
Code:
void CountPulse()
{
   FlowSensorCount++;  //increases the count from the interupt pin 2
}
Is the interrupt signal debounced?
I reckon it doesn't need to be, does it?  It's an interrupt signal on pin 2 coming from this flow sensor (hall effect):
http://www.seeedstudio.com/depot/datasheet/water%20flow%20sensor%20datasheet.pdf


Quote
while (key != '1' || key != '0'); =>  while (key != '1' && key != '0');
Are you sure?  That's actually what I had first, but then I thought, key will NEVER be 1 and 0 at the same time so the while statement will never end...  I'll go back and re-reason through it.

Quote
I'll keep browsing.
THANKS!
568  Using Arduino / Motors, Mechanics, and Power / Re: current rating for this plug on: February 24, 2011, 12:34:22 am
I think I'm going to go with 2 RJ45 plugs.  I need 5 wires going to my gearmotor and opti-detector, and then 5 wires going to a 575 mA solenoid and water flow sensor.  The gearmotor only draws 90 mA, but could stall at 800mA. 
Different specs I see show the RJ45 plugs to be rated at 1.5 A.  I like Cat 5 wire, too, as it's a heavier guage than a lot of these serial cables I've cut apart to interrogate.  Most of them are 28 gauge.
I can get RJ45 pcb mountable, and put them on my protoshield, so they line up with the Arduino's USB and DC jack.  It'll all come out the back of the enclosure.
Does RJ45's sound like they'd work?
569  Using Arduino / General Electronics / Can someone critique this please on: February 23, 2011, 03:52:07 pm
My first attempt was pretty bad, so I deleted it.  This seems a lot more concise.  It even compiles!
Could someone please look it over and tell me if it will work? 
My Uno will be here tomorrow.
570  Using Arduino / Displays / LCD Backlight current on: February 23, 2011, 12:55:30 pm
I can't find any info on this.
What's a typical resistor to use for the back light on a generic 16x2 LCD display with Blue backlight?
I'll connect it to the 5 volt pin.
thanks
Pages: 1 ... 36 37 [38] 39 40 ... 44