Show Posts
Pages: 1 2 [3] 4 5 ... 55
31  Using Arduino / Project Guidance / Re: Novice Needs Assistance emulating POT with Arduino on: October 30, 2012, 03:32:21 pm
If there is no booster/buffer in the pedals, then you can't generate the sensor signal; you need to generate a resistance for it to work right.

Here's a I2C digital potentiometer with 10 kOhm range:
It actually has two pots, so you can do both gas and brake with the same device.
And it will work with both 3.3V and 5V Arduinos.
32  Using Arduino / Motors, Mechanics, and Power / Re: Power supply design on: October 30, 2012, 01:24:01 pm
Be careful about this - the new regulators being used are not tolerant of having 5V on their output and nothing on their input.  Datasheet would suggest a diode from output (anode) to input(cathode).

Is this a design flaw in the Uno? That's unfortunate. It *is* intended as an experimentation platform :-(
The more I learn about it, the more I like the idea of the Ruggeduino :-)

Did they put in protection against over-volting inputs on the Due, or will that fry the chip, too?
33  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 30, 2012, 01:21:26 pm
It may be worth putting a current limiting resistors in series with your 5V and ground ICSP pins then.

That's a good idea. I'll put that on the next version of the board I'm making. Also, I'm starting to like TVS-es -- you can get 6 of them in a small 8-SOIC; if I can find the space for one per exposed header/connector, I think that'll be good.
34  Using Arduino / Programming Questions / Re: Timers in Arduino Duemilanove on: October 30, 2012, 01:54:23 am
Check the BlinkWithoutDelay tutorial. The basic idea is to store timestamps, and just check "the time is now X, is there something I need to do?" each time through loop().
35  Using Arduino / Motors, Mechanics, and Power / Re: Power supply design on: October 30, 2012, 01:50:33 am
Battery voltage sags when you draw more current than the battery can generate.
As long as the "sagged" voltage is still over the 5V + dropout value of the Arduino regulator, the Arduino won't see the voltage drop.
It may, however, see voltage spikes, depending on how good the filtering is in the regulator. Adding more capacitors before or after the regulator may help, as may spike/transient suppression diodes.

As everyone else has said, the 9V battery is puny. If you have two motors, they will easily draw 1A if you suddenly reverse direction on both at once. The 9V battery will croak, and the Arduino likely reset. (If you have two batteries with common ground, then the Arduino wouldn't be affected.)

I like to use a bench power supply while developing (saves on batteries :-) and then use LiPo when un-tethered. You can use a UBEC (which is a switching power converter for use on RC planes etc) to get 6V or 5V out of a 7.4V or 11.1V LiPo battery. If you output 5V, you may even pipe that straight into the 5V of the Arduino, instead of taking the losses from the linear regulator. This probably requires additional filtering, though -- both at the motor driver end, and on the output from the UBEC. You could also use a 6V UBEC and put that into the Vin of the Arduino, to reduce losses, and use the 6V to power the motors. Note that motors are very voltage forgiving, as long as you don't run them too hot. If you use PWM to control the motors, then you can use significantly higher voltage than the "rated" voltage for the motor. Same thing if you use a current controlling motor controller, and make sure to not exceed rated current of the motors. You can even use a 7.2V UBEC and a 11.1V LiPo battery for this.

One thing I don't like about the Arduino regulators: They are not ULDO. There exists parts that only need 0.3V over the regulated voltage (LF50ABV for example) as opposed to the 1.2 - 2.0V typically used by "normal" regulators. This translates to lower losses, and better ability to run on lower voltages. The Arduino is marginal on 6.0V in -- it really wants 6.5V in for a stable 5.0V out.

You can use an UBEC like this:
Or a DC DC converter like this:
With that, you can use a rechargeable LiPo battery like this: or like this:

36  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 29, 2012, 11:39:07 am
Thank you, I appreciate your recommendations! Finding all i-s to dot and t-s to cross to make sure this isn't a recurring theme is important to me :-)

The PC is powered by the same bench PSU (a second channel) because it' on-board on the robot that also has the motor controller.

There is some common ground (heh) and then a Y split to H-bridge vs LM350 regulator, after which there's a short cable (6") to the controller board. That Y splitter now has the big capacitor; it didn't before.

I did remove the 5V connector from my arduino-based programmer. I don't think I can do it for the others, because they use presence of 5V as a detector for an inserted cable. (The AVRISPmk2 also detects that RST can be pulled low, and if not, detects a reversed cable.) The USBtinyISP design has current limiting resistors on the programming pins already, but not on the 5V.

37  Using Arduino / General Electronics / Re: help connecting Arduino UNO to n-ch MOSFET via Optocoupler on: October 28, 2012, 10:01:33 pm
Thank you for explanation. The optocoupler has collector and emitter, so it must be the BJT type.

Yeah, I don't know of any MOSFET optocouplers (a MOSFET light transistor?) I thought you meant the data sheet for the transistor you're trying to switch. You have to make sure you don't break that device, too :-)
If the opto-coupler can't take the voltage, a Zener and a resistor can fix that in a pinch.
38  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 28, 2012, 09:58:01 pm
1. In your circuit, what are the MOSI, MISO and SCLK pins connected to, apart from the ICSP header?

They go to another similar header that is connected to a nRF24L01+ 2.4 GHz radio. Although I often disconnect that when programming, because if I start programming right when a packet is on the wire, the radio confuses the programmer.

2. Do you disconnect power to the H-bridge when you have the ICSP programming cable connected?

Nope. Hence, why this is my prime suspect :-) I'd love for a programmer to be robust enough to not need that, though. TVS-es and current limiting resistors on all wires, buffering, etc. Maybe some parallel caps, too, for filtering. The USBtinyISP actually has buffers, but not TVS-es -- if you blow something, it's more likely the buffer than the 2313.

I just want to make sure I'm not overlooking something else.

FWIW: I hadn't noticed how extremely current hungry that pair of motors is (it's two motors on one H-bridge) -- my bench power supply drops from 8.2V to less than 6V when they start, even though I'm using PWM, and the current limit is set to 5A. On battery, I don't have that problem -- yay for high-C LiPo packs :-) And also, yay for MOSFETs that can take > 20 A :-)
39  Using Arduino / General Electronics / Re: help connecting Arduino UNO to n-ch MOSFET via Optocoupler on: October 28, 2012, 03:45:07 pm
If it has emitter and collector, it is not a MOSFET, it's a BJT (a k a "70's transistor.")

BJTs let current through between collector and emitter when there is also a current (the right way) through the base. This means that there will always be current flowing through the base in addition to the switched current when it is on. This make it easy to switch them on and off with a single switch -- current flows, transistor on; current interrupted, transistor off.

MOSFETS let the current through one way ("body diode" direction) always, with some body diode resistance. However, when you charge the gate capacitor (meaning apply a voltage and a short spike of current) they will conduct equally well in both directions. When wired with the controlled voltage against the body diode (normal,) this means they are "off" when the gate voltage is low, and "on" when the gate voltage is high. This actually saves power, because there is no "wasted" current through the gate, other than when switching state.

However, this also makes a MOSFET annoying to switch, because you need to actively pull it UP (charge) when turning on, and DOWN (discharge) when turning off. (This is for N-channel; P-channel is approximately inverse.) Thus, a simple make-or-break switch won't work, unless you replace one of the "pull" directions with a resistor. The output of the Arduino is already switched both ways -- it either ties to VCC, or to ground, so it can drive a gate directly. The output of an optocoupler is not, though, hence this confusion.

For a MOSFET, the allowable voltage from source to gate (what controls the built-in gate capacitor) is different from the allowable voltage from source to drain (the controlled voltage.) A typical low-voltage device might allow 20V from source (0-reference) to gate, and 30 volts from source (0-reference) to drain. (IRLB8721 for example -- popular 30V D/S device with 4.5V recommended gate voltage and 20V max G?S voltage) Here's an example data sheet showing those voltages:

40  Products / Arduino Due / Re: Compatibility with newer shields on: October 28, 2012, 03:31:41 pm
The idea of 3.3V and 5.0V is that you use that for the VCC of your logic on the shield.
The ioref is then used as the Arduino-facing side of a dual-voltage buffer/driver chip -- optocoupler, level converter, that kind of thing.
41  Community / Products and Services / Re: Great PCB House for Prototyping on: October 28, 2012, 03:10:33 pm
I use itead for quantity-10 orders, and it's fine, except for when they go on week-long breaks :-) (new years, fall festival, etc...) They do clearly communicate when this will happen, so it's not a surprise, just an inconvenience.

OSH Park is the productization of "Laen's dorkbot order" and I've used that too. Those boards are super nice -- gold finish, deep purple solder mask, 6 mil precision. A little more expensive for the total order of the bigger boards I make, though. Note that I don't need the 10 boards I get from ITEAD -- 3 is plenty per test design for me, but ITEAD is still a cheaper and faster option even when I toss the extra boards I don't need ;-)

When I order from ITEAD, I pay the extra $28 for DHL shipping, and the boards ship in 2-3 days after they're done, so I often have less than 10 days turn-around. Order monday morning, get next tuesday. The ITEAD people will also include devices in the same shipping if I buy them (nRF24L01+ boards etc.) So, $38 for 10x 4sqin boards -- a little more than laen for the order (less per board,) but faster. $50 for 10x 8sqin boards is cheaper, and the bigger the boards get, the better the price gets. Although if laen could deliver within 10 days, that might still be a nice option. (Last I ordered there, I had a 3 week wait before I got the boards, and I'm an impatient man...)
42  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 28, 2012, 02:57:05 pm
That looks nice, too! It would need a 10-to-6 converter for use with 6-pin headers, though.

I ended up ordering two of the SparkFun programmers (same price as the JYE) so I can keep one in reserve for when the first one blows, and won't be stranded over another week-end :-) That comes with a cable that's 10-pin and 6-pin all-in-one. Until those arrive, I'm limping along with Uno-as-ISP.
43  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 28, 2012, 01:35:16 pm
Something like 1000uF electrolytic

Thank you for the suggestion! That's actually exactly what I just added. Also thanks for the description of flyback diode requirements. This gives me a better understanding of the situation.

Now, whether that is *actually* what blew the programmers is a second question... But what else could it be?
44  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 28, 2012, 12:39:27 am
You can use ArduinoISP to burn the firmware

That ended up being exactly what I did. The problem was that I had no Arduino board left with the serial bootloader installed, so I was catch-22. I had to do a Radio Shack run to pick up a new Uno -- luckily they close late :-)

Also, I now have an additional 1000 uF on the input to the LM350 regulator (the regulator needs to be beefy, because it also runs a servo -- hmm, that's also a motor ...) And a 6.8V 600W TVS across the input to the AVR board. I figure it can't hurt :-)
45  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 28, 2012, 12:36:35 am
Those "body diodes" aren't acceptable as flyback diodes

Thanks for your clarification! I appreciate it.

To make sure I understand your suggestion: The arrangement you suggest is exactly the same arrangement that the body diodes is providing, right? Your suggestion is that the body diodes are poor performance as flyback diodes, and I should double them  up with something better?
Can I use some 1N4001s? Do I need a high-voltage Schottky? Something else?

I have noticed that some motors I've, ahem, "destructively analyzed" in the past have had capacitors across the poles. Is that a good idea? How should I match up the capacitance to the motor and PWM frequency if that's the case? What max voltage is needed? (I have a 250 V 1 uF film capacitor around here somewhere... and a slew of 50V 0.1 uF ceramics for decoupling)

Pages: 1 2 [3] 4 5 ... 55