Show Posts
Pages: [1] 2 3 ... 695
1  Using Arduino / Programming Questions / Re: Getting a 4-digit number from a keypad on: Today at 06:37:35 am
After recognising a key press you must wait until no keys are pressed
before sensing a new one - your current code will simply loop 4 times in
a few microseconds on the first keypress.
2  Using Arduino / Motors, Mechanics, and Power / Re: What does it mean when a Solenoid reads a high resistance when off? on: April 11, 2014, 07:06:48 am
Overrange indicates higher resistance than the meter goes up to - the 18M is
probably the resistance of your fingers.

Yes, its burnt out since most solenoids are in the 10 to 1000 ohm range.
3  Using Arduino / Motors, Mechanics, and Power / Re: Servo Help! on: April 11, 2014, 05:40:52 am
1) Power the servo from 6V+, not 5V, if possible - some are fussy about this, but you get
better performance anyway.  Nearly every servo is designed for 6 to 7.2V

2) Ensure the supply can supply enough current for the peaks, which are typically 1 to 2A
for most small/medium servos.  High torque servos may need more.  No Arduino board
has a built-in regulator rated high enough to be reliable.  90% of issues with servos
reported here are due to inadequate power supply.  There is also a small but real risk
of trashing your Arduino if the servo puts inductive spikes back onto the 5V supply - cheap
servos are cheap for a reason, you have been warned.  Note that as a servo ages its brushes
can wear out (more sparking), and electrolytic caps dry out (no decoupling).

3) Common your grounds...
4  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Micro - driving relays for seat warmer on: April 11, 2014, 05:31:38 am
Bad arrangement - the relays are pulling too much current for the tiny regulator
on the Micro.

You must use a separate 7805 regulator on a heatsink (or DC-DC converter) to provide
DC power for the relay windings.

Your real problem is failing to get a 12V operated relay in the first place - then it could
be driven from the car's 12V directly, simple.

What current do the heater(s) take?  Can a logic-level MOSFET be used instead (even
simpler if you choose a big enough one).
5  Using Arduino / Motors, Mechanics, and Power / Re: Motor controlling on: April 11, 2014, 05:25:58 am
This motor appears to be a brushed motor - be sure to check this and get an ESC that
is meant for the correct type of motor, they are not interchangable.

Woeful lack of information on that page, such as motor constant and max current...
Consider choosing a motor with known characteristics rather than marketing BS
like "20 turn motor"...
6  Using Arduino / Programming Questions / Re: How do i find an average value from an array? on: April 11, 2014, 05:21:12 am
float average (int * array, int len)  // assuming array is int.
  long sum = 0L ;  // sum will be larger than an item, long for safety.
  for (int i = 0 ; i < len ; i++)
    sum += array [i] ;
  return  ((float) sum) / len ;  // average will be fractional, so float may be appropriate.
7  Using Arduino / Programming Questions / Re: Timer2 is slightly less accurate on: April 11, 2014, 05:17:10 am
How to turn off Timer0?Should I do that explicitly? I suppose this is the timer which arduino uses for delay functions.

  TIMSK0 = 0x00 ;
8  Using Arduino / General Electronics / Re: Why won't Eagle route this airwire? on: April 11, 2014, 05:13:33 am
You probably got a "polygons may have fallen apart" message when
autorouting.  Try adding a groundplane on top of board too...
9  Using Arduino / Programming Questions / Re: Can you put a loop inside a loop? on: April 10, 2014, 03:07:33 pm
You can theoretically nest anything arbitrarily deep, although humans and compilers
each tend to have their cognitive limits.  Good style suggests re-factoring code that's
too long or too deeply nested into more, smaller, functions.

Nesting depth of two is just dandy though.
10  Using Arduino / General Electronics / Re: Transistor + Arduino (Extream sleep mode of 0mA) on: April 10, 2014, 03:04:51 pm
Yes, that circuit should do fine.  (source and drain are mis-drawn though)
11  Using Arduino / General Electronics / Re: The good mosfet on: April 10, 2014, 03:02:51 pm
IRL540 are popular/easy to get....

an on-resistance of 0.015 ohms or less is desireable

... but Rds of IRL540 won't be anywhere near that (datasheet says 0.077 Ohms @ 5V).

0.015 Ohms seems very low to me. Something like an HUF76137 will do it but they're not so easy to find.

0.002 ohms is very low.  0.01 ohms isn't exceptional these days.
12  Using Arduino / Programming Questions / Re: Parsing large strings on: April 10, 2014, 11:28:41 am
You can also wrap long lines in C using backslash.

The IDE code that was falling over was simply trying to parse the code to colourize it
I think.
13  Using Arduino / Programming Questions / Re: Timer2 is slighly less accurate on: April 10, 2014, 11:18:07 am
All interrupts have a priority - timer0 interrupts have priority over timer1 which have
priority over timer2 - so if all timers are firing interrupts then timer2 ISR may be delayed
by the total time it takes to handle timer0 and timer1 ISRs, whereas timer0 ISR will always
run immediately with predictable timing I believe.

[ actually its a little more subtle than that, timer0 cannot interrupt other ISRs but
when timer0 ISR returns any pending interrupts are handled in priority order (ie
timer1 before timer2).   This will also be the case if two timers triggle simultaneously,
the higher priority one will get handled first. ]
14  Using Arduino / Programming Questions / Re: Understanding Interrupts on: April 10, 2014, 11:13:08 am
I need to query sensors while running an algorithm simultaneously. The sensor querying updates an array that is referenced by the algorithm. That is, I need the algorithm to access values in the array and know that they are the most recent values observed. I have a function for querying the sensors attached to an interrupt, which I believe means the sensors will be queried at a consistent time step.

If the individual values take up more than one byte of RAM then you'll need to guard
access to them in your main program using noInterrupts() and interrupts() around the
accesses so you see consistent values.

Also find out about the volatile keyword.
15  Using Arduino / Programming Questions / Re: Bootloader burning problem on new target board on: April 10, 2014, 11:07:02 am
Double check the connections and that the target processor is getting power
on all its Vcc and AVcc pins, and ground on all the ground pins.

Check it has decoupling on each supply pin, and is an ATmega328P (the P is important,
otherwise you'll have to create a new entry in boards.txt).

Always connect the target board after the host has been programmed with the ArduinoISP
sketch - then power both boards up.  You don't want any junk on the ISCP header
before programming.
Pages: [1] 2 3 ... 695