Show Posts
Pages: 1 ... 386 387 [388] 389 390 ... 695
5806  Using Arduino / Sensors / Re: ABS wheel speed sensor - measuring vehicle speed on: October 08, 2012, 06:48:49 am
You need some signal-conditioning.  Firstly a low-pass filter is needed to remove all the spikes and noise - this filter should have a roll-off about 3 or 4 times higher than the max frequency of pulses I guess.

Secondly the amplitude is very small (I wonder why - normally such a signal would be logic level).  Given that there might be offset voltages that change I'd suggest using a high-pass filter at or below 1Hz to remove any DC bias, then low-pass filter to remove the noise, then put the output into a comparator.  Something like:

The initial 10k/15nF gives a 1kHz low pass, the 3u3/100k a 0.5Hz high-pass (dc-blocking).  The diodes protect against grossly overvoltage inputs.  C is any open-collector 5V-compatible comparator, such as 1/4 of LM339

The only issue with my circuit is that it could generate random noise when there are no pulses coming in.
5807  Using Arduino / General Electronics / Re: Newbie Question: LM35 & Negative voltage on input pin on: October 08, 2012, 06:27:27 am
And then, I'd analogwrite  5v to output pin D9 and 1v to D10 (thus giving an difference in potential of 5-1=4v) so that when LM35 outputs a negative value (let's say, -1v) I would read it in A0 as 0v. Does that make sense or I'm way off course?

Way off course I'm afraid, analogWrite () doesn't output analog values.  It generates pulse-width modulation, despite the name.

Since the device takes less than 60uA current you could, at a pinch, provide the 1V rail for the gnd terminal of the LM35 from a resistor divider - use 1k and 3k9, so you'll get about 1V at the gnd terminal - you then measure that as well as the output voltage using two analog inputs and take the difference.  Don't forget the load resistor on the output in this mode (which should be about 20k).
5808  Using Arduino / General Electronics / Re: Eight analog voltages as simple (fewest parts) as possible? on: October 08, 2012, 06:18:06 am
No, 7 resistors and 0V and Vcc _are_ among the valid 8 voltages. Fig 1-3 in datasheet.

Yes they are, but the allowed range for the first/last rows in the table is bigger.

Think though: With 7 resistors the first voltage in your chain would be 1/7 VDD.

At VDD=5.5 that's 0.7857V - nowhere near any of the target voltages in figure 1.3 (column V2).

Ah yes, that's odd, I'd have thought they would choose the on-chip resistors appropriate to allow equal external resistors (chip designers usually think carefully about the parts count on external circuit).  So you need the two end resistors to be 3/2 the size of the other 5.   Or use 9, make the end ones 1/2 the value of the others, and ignore the first and last taps.

Still with 1% resistors 7 equal value ones would actually work I think, on-chip resistors have very good matching.
5809  Using Arduino / Programming Questions / Re: Assembler error, SoftwareSerial, add even parity bit on: October 08, 2012, 05:59:19 am
Well recv() has a workaround for certain versions of avr-gcc (saving some registers on the stack in assembler) - there is a compiler issue under OSX with some versions of avr-gcc - perhaps this is hitting you too?
5810  Using Arduino / Programming Questions / Re: Error compiling Bootloader? on: October 07, 2012, 08:16:40 pm
You appear to be compiling with main() for sketches, bootloader shouldn't pull that in, has its own main I think.
5811  Using Arduino / General Electronics / Re: Components designated "SK"? on: October 07, 2012, 08:10:33 pm
Intriguing - could be a socket (you'd need to the other side of the board).
5812  Using Arduino / General Electronics / Re: Eight analog voltages as simple (fewest parts) as possible? on: October 07, 2012, 08:04:27 pm
Nine equal resistors would work.  Each tap would be a different voltage. Note that 0V and Vcc are not among the 8 voltages you can choose from.  That's why you use 9 resistors.

No, 7 resistors and 0V and Vcc _are_ among the valid 8 voltages. Fig 1-3 in datasheet. Unless you want to run more than one IO expander just wire ADDR pin to ground.
5813  Using Arduino / General Electronics / Re: Tension on shutted down gpio on: October 07, 2012, 07:02:55 am
Many things can be protected with a large resistor - so long as no appreciable current flow is needed.  A digital input in normal operation takes < 1uA so even a 1M resistor would allow it to function (but much slower than normal - 10k is more reasonable a compromise).
5814  Using Arduino / Programming Questions / Re: Understanding "arduino.h" and "arduino.cpp" on: October 07, 2012, 06:40:34 am
Well thinking a little more, what would be useful (and less fragile) would be docs explaining where in the source tree each hardware interface in the MPU is setup and how it is used...  This is much more consistent across different versions, less likely to go out-of-date and would be a useful aid to self-instruction in itself.
5815  Using Arduino / Programming Questions / Re: Understanding "arduino.h" and "arduino.cpp" on: October 07, 2012, 06:19:06 am
Since different versions for different processors are different, the code itself is the place to look - its open-source, this is one of the reasons that's a good thing.  Just grep the relevant register name in <dist>/hardware/arduino/cores/arduino/*
5816  Using Arduino / Programming Questions / Re: endsWith Not working for me. on: October 07, 2012, 04:57:26 am
The argument to endsWith() is a "const String reference".  I think it tries to take the argument, in this case a constant 0, and construct a String out of it. In theory the constant should be treated as an 'int' and should thus be converted to a decimal String "0".  I think that the constant 0 may be taken as a 'char'.  In that case the a two-byte buffer would be constructed with the character (null) and a null terminator. The resulting string would be empty.  I suspect that is what is happening and why the "endsWith(0)" always return false.

Perhaps (int)0 would work.

In C and C++ anywhere a pointer or reference is accepted the null pointer is also accepted.  The null pointer is notated as 0.
5817  Using Arduino / General Electronics / Re: Tension on shutted down gpio on: October 06, 2012, 09:05:00 pm
The protection diodes are rated at 0.5V max forward bias - that's rather less that 20mA I think - or have I missed the right part of the specs?

Actually specifying the voltage is a rather poor way of doing this as forward voltage varies significantly across the operating temperature range.
5818  Using Arduino / Microcontrollers / Re: Have I destroyed my Mini Pro and FTDI basic breakout boards? on: October 05, 2012, 04:36:37 pm
You might have to press reset when uploading.  Just as the message about how many bytes compiled pops up.
5819  Using Arduino / Motors, Mechanics, and Power / Re: best way to power arduino on: October 05, 2012, 04:31:21 pm
It will run hot at 12V, but this should work if you don't pull much extra current from the 5V rail.

It is nice to isolate the Arduino from fluctuations on the motor supply though, the extra 9V regulator (if it has a generous decoupling capacitor on the output, say 470uF) provides this.

Using a DC-DC converter to take 12V to 5V is another option - frequently these devices have a wide input voltage range so will cope with 12V fluctations - they are also more efficient than a linear regulator.
5820  Using Arduino / Microcontrollers / Re: Giant Arduino! on: October 05, 2012, 04:16:42 pm
Maybe some lego figures at the controls would be cool?
Pages: 1 ... 386 387 [388] 389 390 ... 695