Show Posts
Pages: 1 ... 386 387 [388] 389 390 ... 699
5806  Using Arduino / General Electronics / Re: rc snubber networks/ac filter caps on: October 12, 2012, 04:36:06 pm
You ideally need to know the inductance of the load before choosing RC component values - the idea is that the RLC circuit formed when the contacts open absorbs the stored energy without going too high in voltage, and doesn't conduct significant current at mains frequency (the load is supposed to be off...).  The voltage will still go quite high, but much less rapidly, allowing the contacts to separate before an arc can establish itself.

The resistance of the load is in series with any extra R you provide so that you take the sum of those resistances into the calculations.
5807  Using Arduino / Project Guidance / Re: SICK sensor and AD wobble on: October 12, 2012, 03:57:09 pm
If your requirements are so close to the resolution of the ADC that a variation of one or two is important to you, you probably need to use a more precise ADC.

Under battery power the ADC is pretty well behaved (certainly noise below 1 lsb) - I suspect this is power supply noise - is the PSU a switching one?  Extra decoupling can help.
5808  Using Arduino / Project Guidance / Re: Which Arduino Board(s) is/are right for me? on: October 12, 2012, 03:52:21 pm
Well a lot of those motors are just switched on and off, so remote relays or MOSFET switches would probably be the simplest way to drive those (keeping all the high current switching away from the Arduino).  Signal cable runs should be shielded or twisted pairs or both.

Are the LED strips to be PWM'd or just switched on/off?

You might benefit from extra input/outputs, suggesting a Mega perhaps.

You'll need to be careful to how everything's powered - separate power for Arduino - and how everything is grounded.  Are the motors large?
5809  Using Arduino / Project Guidance / Re: Which boards to use for multy drop sensor network? on: October 12, 2012, 02:56:08 pm
Sounds like you are wanting a lightweight networking protocol, using the physical layer as an ether (in the original sense of ethernet!).  So some sort of collision-detection or retry mechanism is needed.  Just make sure the physical layer can handle collisions without damage.

You might want to look at some of the simple packet schemes used in RF transceiver modules such as the nRF24L01+  - you then have a framework that could be easily switched from wired to wireless.  There are no doubt a handful of relevant open-source networking protocols to look at that could be suitable.  Have a look through the forum archives esp. the networking/protocol/devices forum I guess.
5810  Using Arduino / Programming Questions / Re: Why are Float points not working? Short Servo Example on: October 11, 2012, 07:48:32 pm
If it was working and the code hasn't changed then it must be the hardware.  If the code has changed then look at what was changed.
5811  Using Arduino / General Electronics / Re: 16 Channels of 15V Analog Inputs... Any Suggestions? on: October 11, 2012, 07:44:23 pm
Quote
Where did I explicitly or implicitly suggest that the divider was significant source of noise, or for that matter even address it?  My concern was always about how reducing the voltage range makes the analog signal more susceptible to externally generated noise (e.g. from EMI), not the amount of noise generated internally by the circuit.

But the divider might reduce the impedance by a factor of three - thus 3 times less susceptible to capacitive pickup...

EMI will be picked up externally from long cables and the environment principally - assuming you've got good ground-plane in the multiplexer circuit you've got control of the pickup there, so a divider isn't going to be the place noise enters the system, except of course if the thermal voltage noise becomes an issue (if you were amplifying microvolt AC signals rather than measuring 15V DC then I would be much more worried about noise).

Without know the input and output impedances and noise sources your original paragraph seemed a very specious argument for avoiding a divider circuit - certainly there's no automatic factor of three involved in precision.
5812  Using Arduino / Sensors / Re: Strain Gauge to INA125 Troubles on: October 11, 2012, 07:34:57 pm
No, its just that the zero-point isn't within the output voltage range of the amp - you need to trim the bridge offset to get it within the active range - various trim circuits are out there on the web, might be as simple as one potentiometer.
5813  Using Arduino / Project Guidance / Re: Which boards to use for multy drop sensor network? on: October 11, 2012, 07:31:42 pm
485 is just a physical layer - protocol is up to you - also lots of driver chips available, dual and quad packages too.  Its fairly power hungry though using full-swing differential signals into 100 ohm loads, a LVDS chipset would improve on that markedly.

For low signalling speeds serial is still attractive, but long runs could introduce problems with mismatched grounds.  If you low-pass filter and then schmitt-trigger you can clean up a lot of noise pick up if only needing low baud rates.
5814  Using Arduino / Sensors / Re: Stabilize analogRead? on: October 11, 2012, 01:43:24 pm
Yes, almost certainly you didn't common the grounds - you can't measure anything if there isn't a reference point.
5815  Using Arduino / Sensors / Re: Capacative Pressure Sensor on: October 11, 2012, 01:34:47 pm
Yes, sounds pretty plausible - you could use a capacitive bridge using the sensor and a fixed capacitor of roughly equal value.

join the two capacitors and connect to an analog input.  The other lead of each cap goes to a digital pin via a 150ohm resistor, and you feed the digital pins in anti-phase.  To centre the analog pin connect it to both GND and 5V via two 10M ohm resistors.

The amplitude and phase of the signal on the analog pin depends on the relative capacitance values.  Code something like this might do the job (well I haven't tested this, so a pinch of salt advised):
Code:
void  loop ()
{
  digitalWrite (dpin1, LOW) ;
  digitalWrite (dpin2, HIGH) ;
  int difference = analogRead (apin) ;
  digitalWrite (dpin2, LOW) ;
  digitalWrite (dpin1, HIGH) ;
  difference -= analogRead (apin) ;
  if (difference > threshold)
    digitalWrite (outpin, HIGH) ;
  else
    digitalWrite (outpin, LOW) ;
}
5816  Using Arduino / General Electronics / Re: 16 Channels of 15V Analog Inputs... Any Suggestions? on: October 11, 2012, 01:19:17 pm
That is why they have a thing called a voltage divider.

That's possible of course, but precision is potentially going to take a big hit even before the resolution of the ADC is factored in.  From the perspective of the signal's information content a voltage divider going from 5 to 15 V down to 0 to 5 V means there will be roughly three times less usable information detectable in the output signal.  For some applications that's not a problem, for others it will be.  Instead, I would check to see if there is an affordable ADC chip/module that can handle the orignal input voltage and output serial communication of some sort at 5 VDC.  

I'm afraid you are wrong in nearly every detail in that paragraph!

Firstly information is a logarithmic measure so a loss of a factor of 3 in precision is a loss of 1.6 bits of information.  Given a good ADC can give 20 bits, that would be only a loss of 8% information (18.4 bits / 20 bits).

Secondly a voltage divider doesn't throw away information like that - you need to know the signal/noise ratio and bandwidth of the source and the actual resistance values and their temperature, then you can calculate degradation in signal/noise ratio.  If the source is already noisy the potential divider might have almost no effect.  If the source is clean and low-impedance then a high-resistance voltage divider might be injecting massive amounts of noise compared to the source.

Resistors generate voltage noise proportional to temperature and to the square-root of the resistance value and to the square-root of bandwidth.

Thirdly the ADC might be introducing quantisation noise that's far greater than the signal noise - in which case everything else would be academic.  If you are only using a 8 / 10 / 12 bit ADC its likely to be the dominant source of error.
5817  Using Arduino / General Electronics / Re: 16 Channels of 15V Analog Inputs... Any Suggestions? on: October 11, 2012, 01:05:04 pm
AS to voltage dividers has anyone considered that an op-amp can have less than unity gain, that they make great attenuators as well and handle +/- 15 Vin as well? at ANY input impedance? 10 ohms to a T ohm are readily possible.

Bob



Non-inverting attenuation is easier as buffer followed by voltage divider.  Attentuating op-amp configuration is inverting so has finite input impedance.


5818  Using Arduino / Project Guidance / Re: Which boards to use for multy drop sensor network? on: October 11, 2012, 12:48:07 pm
First find out the cost of cabling required and compare that against the cost of some RF modules like Xbees - that might help decide which route to go down.

For wired comms the physical layer would need to be something like RS485 to get reliable 100m - differential signalling is reassuringly robust - that would suggest using CAT5 cable for cheapness (though its not rated for outdoors I believe).
5819  Using Arduino / Project Guidance / Re: How Do I Put Wireless Radio Transmitting Module, In Sleep Mode on: October 11, 2012, 12:42:19 pm
If you searched for the datasheet and read it you would have seen this:

Quote
* Device in deep sleep mode when Data pin is grounded
5820  Using Arduino / Project Guidance / Re: Square Wave manipulation on: October 11, 2012, 12:40:22 pm
Quote
Max rpm is 10500, and I want a signal that is precise within max 0.5 degree. Is that possible with the arduino? I have no intention in learning assembler for this project.

The math for this(?):
10500 rpm/60 secs = 175 rev/sec
1 sec / 175 rev / 360 degrees / 2 (to have a ½ degree) = 0.0000079 sec. to calculate, count time and set the output pin on the arduino.

That's 8us approx, which should be achievable.  Using interrupts would give you pretty good resolution (1us or so?), but just polling an input ought to be good enough (there will be some jitter from the timer0 interrupts, could be an issue).

You need to keep recalculating the delay as it is a function of the current RPM - there should be enough time between pulses as you have over 5ms.

Quote
Next when the micros resets, I can't have it to fire at the wrong time, is it possible to make it skip the one output when that happens?
So long as you use the correct test roll-over is invisible - you do something like:

Code:
volatile long trigger_timepoint ;
volatile long last_timepoint ;
volatile long current_period ;

void loop ()
{
  while (micros() - trigger_timepoint < 0)
  {} // wait till trigger time

  output_pulse () ;

  while (micros () - trigger_timepoint >= 0)
  {}  // wait till trigger changes
}

void  int_handler ()
{
  this_timepoint = micros () ;
  current_period = this_timepoint - last_timepoint ;
  // current_angle is fixed-point 16.16 representation of the fraction of whole-revolution.
  trigger_timepoint = this_timepoint + (current_angle * current_period) >> 16 ;
  last_timepoint = this_timepoint ;
}

The important point is to subtract one time from another and then look at the sign, don't directly compare them.

I've given a suggestion as to how an interrupt driven variable delay could work - attach the int_handler to the relevant pin, and the main loop polls for changes in the trigger time, waits for that time and sends a pulse.
Pages: 1 ... 386 387 [388] 389 390 ... 699