Show Posts
Pages: 1 ... 435 436 [437] 438 439 ... 600
6541  Using Arduino / Project Guidance / Re: Did I forget anything?- 72 LED Array loop cycle for 6 months. on: February 01, 2012, 09:02:43 am
I think that because the Base/Emitter junction acts a a diode straight to Ground you are supposed to have a resistor between the Arduino pin and Base to limit the current draw.  You don't need much current because the transistor has 'gain' (switches more current than comes in the Base).  A 1K resistor (5 mA current) sounds about right.
6542  Using Arduino / LEDs and Multiplexing / Re: 74HC… are all the same? on: February 01, 2012, 08:55:40 am
4021   8 Stage Static Shift Register

Is what I'm looking for? (a shift register equivalent to the 74HC595?)

The 4021 is a parallel-in/serial-out shift register.  It's useful for extending the number of switch inputs to an Arduino but not for extending the number of outputs.

The 4015 (Dual 4-Stage Static Shift Register) is a parallel-out shift register (closer to what you want).  It has two 4-bit stages which can be chained together to make one 8-bit shift register.
6543  Topics / E-Textiles and Craft / Re: Mounting LEDs in leather? on: February 01, 2012, 08:41:50 am
I was hoping to not sew through the leather.  Is there some kind of fabric glue that works reliably?  Maybe plain old silicone cement?

You want to mount everything on the surface of the leather?  I guess silicone adhesive would work.
6544  Using Arduino / Project Guidance / Re: Did I forget anything?- 72 LED Array loop cycle for 6 months. on: January 31, 2012, 08:02:59 pm
Use a transistor on the output pin if:
  A) The current being switched is more then about 20mA (40mA absolute max)
  B) The voltage being switched is any more than the Arduino supply voltage (5V)

> If some of my LEDs are mismatched do I run them in series or parallel?

If they are mis-matched in current draw you need to run them in parallel because every point in a circuit gets the same current.  It doesn't matter if they are mis-matched in forward voltage drop but that will change the current limiting resistor needed.
6545  Using Arduino / Project Guidance / Re: Did I forget anything?- 72 LED Array loop cycle for 6 months. on: January 31, 2012, 06:15:24 pm
One thing to watch out for is that the Arduino clock isn't very precise so it will gain or lose time over long intervals (minutes per day, possibly a day or two over six months).

You need one current limiting resistor for each set of LED's in series.  You can put as many LED's in series as you want as long as the supply voltage is higher then the combined forward voltage drop.  Say you had LED's with a 2V drop you could string about 5 of them together before you need more than 12V.  If you set them up as three strings of 4 LED's (8V drop) you could use the 12V supply.  The remaining voltage (12-8=4) drops across the resistor.  To get the typical 20mA through the LED's you would need a resistor of  (4V / 0.020A =) 200 ohms.  Each set of 12 lights (three strings of four) will take 60 mA.  All six strings together will need 360 mA.
6546  Using Arduino / Project Guidance / Re: Building a very basic car injection computer. on: January 31, 2012, 05:38:13 pm
This is how I would write code to open an injector for a fixed time when the sensor hits and at intervals to open at the same relative time for the remaining cylinders.

// Constants
const int CYLINDERS = 4;
const int INJECTOR_PIN = 2;
const int SENSOR_PIN = 3;

// Variables
int InjectorOpen_Microseconds = 1000;  // 1 millisecond
volatile unsigned long LastSensorTime = 0;

volatile unsigned long NextInjectorTime;
volatile unsigned long InjectorInterval;
volatile byte InjectorCount;

void setup()
  attachInterrupt(1, sensorPulse, RISING);  // Sensor triggers interrupt

void sensorPulse()
  unsigned long currentTime = micros();
  unsigned long rotationInterval = currentTime - LastSensorTime;
  LastSensorTime = currentTime;
  NextInjectorTime = currentTime;  // Inject immediately
  InjectorCount = 0;
  InjectorInterval = rotationInterval / CYLINDERS;

void loop()
  unsigned long currentTime = micros();
  if (currentTime - NextInjectorTime >= 0 && InjectorCount < (CYLINDERS-1))
    digitalWrite(INJECTOR_PIN, HIGH);
    digitalWrite(INJECTOR_PIN, LOW);
    NextInjectorTime += InjectorInterval;
6547  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Ethernet: How to bridge W5100 INT pin to ATmega328 PD2 pin? on: January 31, 2012, 05:02:15 pm
The ATmega PD2 pin is connected to the third pin on the J3 terminal according to the schematic (granted, that doesn't go anywhere, but at least it has an accessible pinout).  smiley-slim Am I wrong?

Pin 32 (PORTD, pin 2) goes directly to the female header (Arduino pin 2).  I had hoped that there would be a more accessible place to solder to.
6548  Using Arduino / Programming Questions / Re: Keypad / array programming problem on: January 31, 2012, 04:27:04 pm
Two problems:

void checkPIN()
  int count=0;
  for (int n=0; n<7; n++)
    if (attempt[n]==correct[n])
    printArray(attempt, count);   // Since count has just been incremented it will be n+1 and goes off the end of the array when n=6.
  if (count==7)
  for (int p=0; p<7; p++) //wipe attempt
  //  The global index variable 'i' is not reset here so the new key presses get placed off the end of the array.
6549  Using Arduino / Networking, Protocols, and Devices / Re: HMC6352 Suggestions on: January 31, 2012, 04:06:42 pm
am i Saying Right

Excellent!  I'm glad we agree.
6550  Using Arduino / Networking, Protocols, and Devices / Re: HMC6352 Suggestions on: January 31, 2012, 02:18:53 pm
(Note: When he says "Direction can't be judged. It sometime shows 270 and sometime 8 degree using GPRMC.course()" he means 'current heading' and not 'heading to destination".)  The GPS signal can't tell you what direction you are facing.  The 'course' is derived from the difference between your current position and your last position.  If you stop moving it will be based on the small-scale random fluctuations in your reported position.  This will give you a fairly random course.

The fix is to use a compass instead of the GPS for heading information.  The compass will give heading relative to magnetic north.  When the GPS is moving at a reasonably fast pace you can use the course it provides to figure the magnetic deviation in your current area.  You can use this to calculate a true heading based on the magnetic heading.
6551  Topics / E-Textiles and Craft / Re: Mounting LEDs in leather? on: January 31, 2012, 12:33:02 pm
Use an awl to make holes for the leads and then mount the LED's like you would in any other fabric.
6552  Using Arduino / Motors, Mechanics, and Power / Re: Precision/Servo-like DC Motor Control? on: January 31, 2012, 12:30:58 pm
The Arduino can do the PID but you need a suitable feedback mechanism.  Typically this will be a shaft encoder that will allow the Arduino to know what position the motor shaft is in.  This can be an absolute encoder which produces a number that indicates the current position or a simpler quadrature encoder that gives pulses to let the Arduino know that the shaft has turned one step and in which direction.  If you are turning multiple turns then you will need some kind of "home" indicator so the Arduino can determine wen the system is at some known position from which it can measure.
6553  Community / Gigs and Collaborations / Re: Search for Arduino freelance/developper for professional sketche on: January 31, 2012, 12:23:05 pm
"Please join me by PM with your price , I’ll send you a detailed explanation of my need."

If it were me, I'd want to get the detailed explanation BEFORE specifying a price. smiley
6554  Using Arduino / Networking, Protocols, and Devices / Re: Host image with arduino (not embedded with html page) on: January 31, 2012, 12:02:48 pm
I think you need to get the IMG tags out of your file contents.  Try something like this:


          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: image/png");
          client.println("Content-Encoding: base64");
         //PNG starts here!
         //PNG Ends here
6555  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Ethernet: How to bridge W5100 INT pin to ATmega328 PD2 pin? on: January 31, 2012, 11:37:32 am
Bad news.  According to the Eagle schematic, Pin 56 (INT) isn't connected to anything.  The only way to bridge it to D2 is to wire directly to the pin of the W5100.  Likewise the line from the ATmega to the D2 pin doesn't go anywhere else.  smiley-sad
Pages: 1 ... 435 436 [437] 438 439 ... 600