Show Posts
Pages: 1 ... 385 386 [387] 388 389 ... 700
5791  Using Arduino / General Electronics / Re: BJT transistor base current calculation on: October 16, 2012, 01:25:19 pm
The problem with current gain is that its "poorly characterised" - which is gobbledygook for "varies a lot between devices".  So any circuit design that relies on it having a given value is a weak design.  Typically you design for the minimum value of beta in the datasheet (note that it varies with current too...).

Since the variation between devices can be as big a factor as 3 or 4 IIRC, this means your current limiting would also vary greatly.
5792  Using Arduino / Programming Questions / Re: Creating variables at runtime or not? on: October 16, 2012, 07:23:51 am

Does it make a difference (in speed) if a variable ia created at runtime or on top of a sketch? I want to optimize a library foor speed at the moment and was curious what the best and fastest way is smiley

Which?  The best or the fastest? - they are rarely the same.
5793  Using Arduino / Programming Questions / Re: Reading ascii in hexadecimal, need it in decimal. on: October 16, 2012, 07:21:15 am
And there's no hexadecimal anywhere...
5794  Using Arduino / Motors, Mechanics, and Power / Re: Reading a RC Airplane Receiver on: October 16, 2012, 07:16:56 am
Absolutely - if you are trying to power the servos directly from the 5V output from the Arduino it will simply crash, don't power motors or servos from the logic 5V rail ever - you can damage the logic chips as motors can put out horrible voltage spikes (inductive load).

Normally you would power receiver and servos from a 6V or 7.2V battery pack - some receivers output a clean 5V (BEC), some don't, I believe.  Try powering Arduino separately for now - it needs clean power.
5795  Using Arduino / Motors, Mechanics, and Power / Re: Motorizing a valve, which of this two options is better? on: October 16, 2012, 06:55:01 am
You'll need to measure the torque yourself - then allow a heathy safety margin (factor of two or three perhaps?).  Measure the force needed to pull the arm, multiply the force by perp. distance from pivot.  Piece of string and a weights pan might be the simplest.

For motorising the globe valve things will be more complex as the end-stops can only be determined by measuring the torque or stall condition.  You have to avoid over-tightening yet be able to supply a larger torque to reverse from the end-stops (such valves bind when closed, more torque is needed to un-stick them due to static friction).

Offhand I'd say you could use something like a motor with a series resistor.  You normally power via the resistor and monitor the current by measuring voltage across the resistor - this allows you to detect when the motor stalls (endstop).  To then reverse back you briefly bypass the resistor to get more current/torque to start the motion again before going back to current-monitoring mode.  So having an H-bridge supplied via a load resistor with a high-side switch in parallel to the resistor might be one way.

As for the mechanical issue, the motor would need to either be in a frame than can slide up and down with the screw-thread motion, or (perhaps better) done via a reduction gear with the pinion long enough to cope with the along-axis motion.

Another method is to have the motor drive a set of prongs that go into the holes in the hand-wheel - easily removed and allows manual override.

Note that if you have two much reduction-gearage it will be hard to measure / limit the torque to valve, too little and the motor will need be over-powered.
5796  Using Arduino / Motors, Mechanics, and Power / Re: Powering several 12V stepper motors with one source. on: October 16, 2012, 06:39:47 am
Well if you look up details of that motor you'll find datasheet saying its windings are 34 ohm, so each takes 0.35A.

If you use full-wave drive then each motor will have both windings on at once in some phases, so thats 0.7A per motor, otherwise 0.35A per motor.

So you need either 12 * 0.7 (= 8.4A) or 12 * 0.35 (= 4.2A) 12V supply.  In practice allow a bit of spare capacity so either a 10A or 5A supply depending on whether full-wave or not.
5797  Using Arduino / General Electronics / Re: Using transistors as switches.. problems on: October 16, 2012, 06:29:03 am
The Arduino deals in voltages between 0 and +5V, the circuit you are trying to switch is -15V to 0V, so there is no overlap.

This won't work with a transistor unless perhaps you have Arduino gnd connected to -15V (in other words different ground references for the Arduino and keyboard).

But we don't know enough yet - you have measured the voltage at each side of the switch when its open, we need also to know the voltage its contacts are at when closed.  If that voltage is -15V then an NPN transistor and Arduino ground at -15V would work.  If 0V then a PNP transistor with Arduino +5V at keyboard ground would work.

You also need to measure the current between the switch contacts - hopefully this is nice and small (10mA or so) in which case using an opto-isolator would be both feasible and most sensible.

In general having two units with different ground voltages can lead to problems and the opto-isolator route avoids that completely - we also don't really need to know anything about the circuit being switched other than its polarity and how much current.
5798  Using Arduino / General Electronics / Re: Keeping GPS alive on: October 15, 2012, 11:51:31 am
Some modules have a coin-cell to back up the RAM so that re-acquisition times are much shorter (the GPS almanac doesn't have to be downloaded, that takes minutes I think).

If you can keep the whole module powered up it will keep lock, otherwise I doubt you could add a battery to an existing module - but again which module?
5799  Using Arduino / General Electronics / Re: VIn-Pin wrong polarity - Repair?! on: October 15, 2012, 11:48:23 am
This is Harrie and I blew the processor of my Atmega 2560. I removed the controller and replaced it with a new one. It does not work, so I first thought there might not be a bootloader inside, but I checked and also the clock is not running. Can anybody help me out?


Impressive SMT skills!  If you didn't program a bootloader onto the replacement chip it won't have one.  You need to use the ICSP header and some programmer (or another Arduino) to try programming the 2560.

I think the AVR default fuses use the internal clock so you wouldn't expect to see the xtal oscillator running till it was first programmed - but could be wrong, anyone know for definite?
5800  Using Arduino / Motors, Mechanics, and Power / Re: Integrating Uno into existing system on: October 15, 2012, 11:39:19 am
Often motor controllers have a potentiometer failure-detection circuit for safety:

This means that trying to replace the potentiometer with just an anlog output (low-pass-filtered PWM) won't work - you have to also replace the pot with a suitable resistor, and also drive the wiper connection with analog.  Controllers commonly assume that if the pot stops taking a suitable amount of current then the controller should shutdown as something has gone open-circuit or shorted and the wiper voltage is giving an erroneous reading...
5801  Using Arduino / Motors, Mechanics, and Power / Re: 9v Battery Question on: October 15, 2012, 11:34:34 am
Possibly a NiMH rechargable 9V gives more current than alkaline?  Not sure.

Also there are 5V boost circuits available that allow a couple of AA cells to directly provide 5V power.

Some measurement of the current your set-up is taking would be useful data.
5802  Using Arduino / Motors, Mechanics, and Power / Re: Useless machine (delaying a servo) on: October 15, 2012, 11:31:16 am
Then why not something like:
void loop ()
  if (digitalRead(switchpin) == HIGH)  // or whatever value you meant
     while (digitalRead(switchpin) == LOW)        // I rather guessing what your switch input means...
5803  Using Arduino / Sensors / Re: DEI 508D Field Proximity Sensor on: October 15, 2012, 11:26:06 am
Yup, run a 10k resistor or so from the output to +5V and it'll become a nice 5V logic signal.  Open-collector (or open-drain, same thing) outputs are nice and flexible like this (you can wire several of them together to one pull-up resistor to make a hard-wired AND gate too smiley
5804  Using Arduino / Sensors / Re: DEI 508D Field Proximity Sensor on: October 14, 2012, 06:23:38 pm
Hmm, rather unclear that document (and my neck now aches smiley

I think it might mean the outputs are open-collector capable of 200mA sink.  However I'd suggest it would be best to measure.

Measure the output voltages with nothing connected, and then again with 10k resistor from output to 5V.  If only the latter works and gives 0..5 range, then open collector it is.  If both generate an output then take note of the voltages involved.  If 12V you'd need a level shifting circuit such as resistor divider.
5805  Using Arduino / Programming Questions / Re: What is serial.peek for? on: October 14, 2012, 06:16:39 pm
The point is when you are trying to make sense of an input string (this is called parsing).  One function might try to recognise and read a decimal number, say, and another might look for a separator such as ','.

The ability to look at the next char without reading it means each function can see if the input is relevant for it, and if not it hasn't prevented the next function from seeing that input.
Pages: 1 ... 385 386 [387] 388 389 ... 700