Show Posts
Pages: 1 ... 1006 1007 [1008] 1009 1010 ... 1169
15106  Forum 2005-2010 (read only) / Interfacing / Re: TX3 on Mega board? on: May 13, 2010, 03:21:14 am
 am asking myself why there are TX1-> TX3 and RX1-RX3 on the MEGA board. I thought I can generate software serial ports as many I want to.

Software serial ports and hardware serial ports are two different things. The mega 1280 chip has four internal hardware serial ports. The mega 168/328 has one internal hardware serial port.
If TX3/ RX3 is a dedicated RX/TX how can I access it?

All explained in the Arduino reference documentation:
http://arduino.cc/en/Reference/Serial
 
Lefty
15107  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Nano + external battery on: May 04, 2010, 02:06:46 pm
yes, you can wire 9vdc battery to the Vin pin. You won't get long life for such a battery as they have a pretty low mah rating and are among the most expensive batteries to use Vs the mah provided.


Lefty
15108  Forum 2005-2010 (read only) / Interfacing / Re: PWM Through an AND Gate? on: May 11, 2010, 03:19:19 am
Typical limit switches for motors are often a safety item and it is best that they cut the source voltage to the H-drive directly rather then limit via logic level control. Of course in that case the limit switches would have to have current rating equal or higher then the max motor current drawn.

Just throwing out the idea.

Lefty

15109  Forum 2005-2010 (read only) / Interfacing / Re: Pin 13 w/ led using with pushbutton. on: May 09, 2010, 02:25:07 pm
Quote
pinMode(pin13, OUTPUT); or pinMode(pin13, INPUT); so since the LED is an output and the pushbutton is an input you can't connect both of them to it.

Not exactly. You can program pin 13 to be a input pin, however the signal that will drive it will have to be able to source the led current (when the signal is HIGH) which with it's 1k ohm resistor will be around or under 4ma. I think you would also need to enable the internal pull-up resistor to prevent the pin from floating if you are using a simple switch wired to +5vdc, or use a external 10k pull-down resistor as the led will not be biased on when the pin is a input and might float as I said.

Lefty

15110  Forum 2005-2010 (read only) / Interfacing / Re: High-speed, up/down counter on: May 08, 2010, 08:54:58 pm
Well the Arduino mega does allow for five user interrupt pins I believe, so three of them could service the channel A of each of the three encoders. There would need to be 3 input pins assigned for the three channel B signals from the encoder. From there each of the three ISR functions could maintain an up/down counter just as shown in some of the encoder libraries.

 So the question is, are three asynchronous 17khz interrupts too fast to prevent missing steps? The ISR needs to be written 'lean and mean', but my gut says I think it can be handled. Keep in mind that the ISR triggers have the option on when the interrupt is generated, change, low, etc. So perhaps some playing with the trigger type can help prevent missing steps for a tradeoff of a small amount of timing skew.

Lefty
15111  Forum 2005-2010 (read only) / Interfacing / Re: How to make UART Tx idle state logic LOW on: May 07, 2010, 11:55:26 am
Quote
Would I have to disable the internal pullup and use an external pulldown?  Any ideas or suggestions would be appreciated.  Thanks.

Interesting problem.

Not sure the Arduino serial library uses the internal pullup or not on pin 0. If you are using a standard Arduino USB with a FTDI USB serial converter chip then the solution if possible is a little more complex.

 The HIGH (serial idle condition) on the serial rec pin 0 is coming from the TTL serial output of the FTDI chip through a series 1k resistor. The only way to overcome this I think would be to change pin 0 to an output pin and set it LOW. You would have to then change it back to a input before you did any serial commands.

Lefty
15112  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: May 09, 2010, 09:09:55 am
Quote
What size resistor, if any would be required between the arduino pin and the Mosfet gate?

None is required. However you may wish to have a 10k ohm resistor wired from the gate to the source pins of the mosfet. This will ensure the mosfet turns off if the arduino is ever powered off but the motor still has battery voltage applied.

Lefty
15113  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: May 03, 2010, 12:52:45 pm
Quote
So this guy should be usable?

Yep, good choice.

Lefty
15114  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: April 18, 2010, 11:15:44 am
Quote
and gate threshold of <= 3V, sorted by price

The gate threshold spec is not the spec to go by. One really has to look at the graphs showing source/drain current flow Vs gate voltage when the gate is at the 4.5-5vdc that an Arduino can supply. True logic level MOSFETS will have a gate threshold voltage as low as 1.5vdc or so. Gate threshold spec is the gate voltage where the mosfet just starts to conduct, and not it's fully saturated gate voltage.

Lefty
15115  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: April 17, 2010, 01:33:33 pm
The IRF520 is NOT a logic level MOSFET, an Arduino output pin cannot fully turn it on without additional external components. That's why I stated using a LOGIC LEVEL N-channel mosfet is easier to interface with an Arduino.

OK being in EU. Transformers are sometimes much cheaper if you can find surplus dealers, rather then full retail new stock.

Lefty
15116  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: April 17, 2010, 01:21:20 pm
Quote
Lead-acid cells?
Half-a-dozen should be bang-on 7.2V.

Hows that? Six lead-acid cells (2.1v each) makes up a 12.6V battery, just like in cars.

Lefty
15117  Forum 2005-2010 (read only) / Interfacing / Re: 7.2V Motor - 10Amp - How to power and to control on: April 17, 2010, 01:14:09 pm
Well the motor stall current rating is a worst case condition for a motor, called locked rotor, and shouldn't be a normal situation. Your motors might only draw half that in most normal cases, but it really depends on the mechanical demand placed on the motors. You could use a transformer with a lower current capacity and fuse it at the transformers max current rating.

 The fact you are considering an AC transformer says you don't need portability from AC mains. Batteries (Li-po 2 cell) would have no problem handling 10 amp loads depending on the mah rating of the cells, however their costs plus charging equipment will exceed the cost of a AC transformer/rectifier/filter. So unless you require portability your first plan is more economical.

A N-channel MOSFET is the best switch device for this kind of application. However it's made easier if you use a logic level N-channel MOSFET as the Arduino can only supply +5vdc as a turn on voltage and a normal MOSFET requires 10vdc to fully turn on. Also the MOSFET should be rated at several times the worst case current draw, so 25+ amp ratings would not be overkill.

Here is an example of a nice logic level high current mosfet:

http://www.goldmine-elec-products.com/prodinfo.asp?number=A20225

Here is a transformer that should work worst case:

http://www.allelectronics.com/make-a-store/item/TX-6310/6.3VCT-10A-POWER-TRANSFORMER/1.html

Lefty
15118  Forum 2005-2010 (read only) / Interfacing / Re: Getting 12V OUT of an Ardunio on: May 08, 2010, 11:41:00 pm
An Arduino does not create power, it consumes power. You can power an Arduino with 12vdc by applying it to the external power connector on the board. To control an external device at 12vdc like a door strike, with require a 5vdc coil relay or a transistor so that the internal +5vdc microcontroller can control the power on/off to the 12vdc device. It would much simpler if you had a 12vdc power source so you could power both the Aduino board and your door strike from the same source. Converting 9vdc to 12vdc is possible but somewhat expensive compaired to just using a 12vdc power supply in the first place.

 There are pleanty of examples in the Arduino web site on how to power an Arduino and how an Arduino can control external devices at all voltages. Check them out.

Lefty
15119  Forum 2005-2010 (read only) / Interfacing / Re: Arduino control Full state space Ball and Beam on: May 03, 2010, 11:15:24 pm
Quote
So can u plz help me out in the C code for this??

So what form of help are you looking for:

1. Write the program for you?
2. Show you how to start learning programming?
3. ?

Lefty
15120  Forum 2005-2010 (read only) / Interfacing / Re: Oxygen Sensor Question on: May 05, 2010, 01:45:50 pm
Quote
So Mark and Lefty can one of you explain this to me like I'm a 4 year old.

 Not sure a normal 4 year old would be a good subject to explain all this.  ;D

Anyway if you change to the 1.1 volt internal reference (and do the 'dummy read' to allow the mux to settle) then you have a input scale that reads a 0-1.1vdc as a 0-1023 integer. You would could then utilize the mapping function to scale this integer to the actual measurement range you are using: X= map(rawadreading,0,1023, 0, 1100); This would result in a variable X that is reading the actual millivolts value of the input signal. That should result in the near best A/D resolution that the 10bits A/D can have.

That help?

Lefty




http://arduino.cc/en/Reference/Map
Pages: 1 ... 1006 1007 [1008] 1009 1010 ... 1169