Show Posts
Pages: 1 ... 232 233 [234] 235 236 ... 813
3496  Using Arduino / Project Guidance / Re: Speed Requirement for fast encoder and sensor ! on: December 24, 2013, 11:49:43 am
Why does the count handler loop over an array at all.

Interrupt routines should do the minimum work possible.  Looping over
26 elements of an array obviously isn't the minimum work possible, and this is slowing
down the handler a lot.

Normally counting a unidirectional encoder would be:
volatile long count ;

void handler ()
  count ++ ;
3497  Using Arduino / Project Guidance / Re: how to generate waveform on: December 24, 2013, 11:45:06 am
2.64V ??  How did that happen?  If the output isn't close to 5V peak-to-peak (for a
5V supply) you are overloading the pin.
3498  Using Arduino / Project Guidance / Re: Trying to build a frequency-sensitive LED milk crate wall in lieu of a drummer. on: December 24, 2013, 11:38:41 am
And this:  - if you
rework the LED array driver then the FFT part could be useful.

For this sort of music visualization FFTs and DCTs aren't great as they
split the spectrum up linearly - you really want to pick out each note or
octave which takes something a bit more sophisticated (probably beyond
an Arduino alone, laptop or RaspPi needed perhaps).

An Arduino could easily drive LED strips via an array of MOSFETs or Darlingtons,
and could for instance be controlled in real time via USB-serial connection.

Simple FFT or DCT can be done on the Uno / Mega, but don't expect 1024 point
resultion or a bandwidth beyond 5kHz...

The Due is more capable and can handle full range audio at 12 bit resolution,
and has a lot more pins for controlling LED channels, but is 3.3V and would
need careful interfacing (voltage too low for most MOSFETs, current low too, but
enough for Darlingtons)
3499  Using Arduino / Motors, Mechanics, and Power / Re: feedback turns off heating element. on: December 23, 2013, 10:02:04 pm
No microcontroller handles high current directly.  You use a switching device such
as BJT, MOSFET, relay, SSR, or opto-triac for that.  Depends on the voltages and currents involved.   If mains is involved then you need to understand how to control it safely.

You also need to choose a temperature probe - a thermocouple seems unnecessary
for just water, they are normally used for high temperature (upto 1000C), many
semiconductor temperature sensors are available that work in the range 0..100C.

A thermocouple would be more robust (say the water boils away!), but you'd need a
thermocouple amplifier shield, the output voltages are far too small to read without one.
3500  Using Arduino / Displays / Re: What distance can LCD be separated from Arduino? on: December 23, 2013, 09:47:04 pm

It all depends on your wire.

If you use 1 AWG wire then the resistance is only 0.0004 ohms per meter. You could go a few km (miles) with that, no problem.

That only applies to DC.  If you are sending a signal down a set of wires you need to
understand how signals propagate, characteristic impedance, cable capacitance, inductance,
the skin effect, noise coupling, RFI, ground-mismatch...

If you have high speed logic signals you can't just assume you can put them down long
cables and have everything work.
3501  Using Arduino / Audio / Re: Need help with PWM DAC audio output using Mega2560 R3 on: December 23, 2013, 09:37:29 pm
You are using interrupt handlers yet you've disabled all interrupts.

Why don't you just turn off timer0 interrupts?
3502  Using Arduino / Programming Questions / Re: LED unable to blink on: December 23, 2013, 09:17:19 pm
You haven't set pin 13 as an OUTPUT, so no it isnt.
3503  Using Arduino / Motors, Mechanics, and Power / Re: Why are brushed motors more popular in robotics? on: December 23, 2013, 09:14:43 pm
Make that read "sensorless brushless motors"...
3504  Using Arduino / Motors, Mechanics, and Power / Re: feedback turns off heating element. on: December 23, 2013, 09:13:49 pm
You might want to consider PID loop control for such a system, but a basic
if statement will do the basic job.  You've already written the English version of
it!  The C would be more like:

void loop ()
  float temp = readTemperature () ;
  if (temp > UPPER_LIMIT)
    fans_on () ;
    fans_off () ;
  if (temp < LOWER_LIMIT)
    heat_on () ;
    heat_off () ;
  delay (DELAY) ;
3505  Using Arduino / General Electronics / Re: oscillator in microcontroller on: December 23, 2013, 09:07:24 pm
On the Uno and similar the timer0 internal timer is set to count at 250kHz (16MHz
divided by 64) and it generates an interrupt each time if overflows (every 1.024ms),
these overflows are counted and the code in micros() and millis() uses it and the
current value of the timer0 TCT0 register to deduce the time in us or ms since last
reset (modulo 2^32).

Does that answer your question?
3506  Using Arduino / General Electronics / Re: Additional Information on Avalanche Noise for entropy gathering on: December 23, 2013, 06:52:05 pm
That's mentioned amongst many other useful things in chapter 9 of "Cryptography Engineering" I believe.  Worth reading (the whole book).  Fergusson/Schneier/??
3507  Topics / Science and Measurement / Re: float and rotary encoder arduino project on: December 23, 2013, 06:48:58 pm
Perhaps you'd be better with:, those
mechanical switch encoders are rough and ready to say the least - meant only for control
knobs, lots of contact bounce.
3508  Using Arduino / Motors, Mechanics, and Power / Re: Running Steppers and Servo from Adafruit motor shield on: December 23, 2013, 06:43:56 pm
1.75 ohm windings from 12V - do the maths, its > 80 watts, this isn't an option.

Chopper driver chips like the A4988 use feedback and PWM to program the winding
current whilst simultaneously acting as buck DC-DC converters.  This means that you
get plenty of voltage left over for overcoming back-EMF once the motor's spinning
so you can get reasonable speeds.  Steppers with higher resistance windings can't
go very fast for this reason, and this is why low-resistance steppers exist.

A stepper designed for 12V non-chopper drive would have winding resistance
more like 50 ohms (and would be unipolar anyway in practice).
3509  Using Arduino / Motors, Mechanics, and Power / Re: Stepper and 5v Arduino output on: December 23, 2013, 06:37:39 pm
12V supply going through the Nano voltage regulator, and then powering a motor with
unknown current draw?  Bad idea, lots of power dumped into the regulator, its going
to thermally cut-out.

Use a separate voltage regulator with a heatsink.
You should find out what voltage the motor is designed for - in particular what is
the winding resistance.  I presume its 4-wire.  If the motor can run from 12V then
use the 12V directly.  If not a 7805 regulator perhaps (but L293's drop a few volts
anyway, a 6 or 8V regulator might be better.
3510  Using Arduino / Motors, Mechanics, and Power / Re: Time based stepper motor control on: December 23, 2013, 06:33:08 pm
I don't know of any specific library for this, but its a common problem and surprisingly
subtle to get right (step exact).  There are two approaches, either use a fixed clock and
generate steps using DDS techniques (just adds), or use variable delays and calculate
each delay on the fly (needs square-roots)

There are two basic cases - either there is enough 'time' to accelerate to full speed, then
constant speed, then decelerate, or else you accelerate to a speed below full speed and
immediate decelerate again in order to stop in time.  There's also a choice of units,
such as steps-per-second-per-second or fractions thereof.
Pages: 1 ... 232 233 [234] 235 236 ... 813