Isolating VCC in circuit

Still trying to figure this out. Let's say I have an FTDI, AVR, and a LED driver and LEDs in a circuit. Following the FTDI datasheet, I figured out how to build the circuit so it also powers the AVR. However, here's where I'm stuck. The AVR and LEDs can (and will be) also be powered from an external PSU. So, how can I isolate the VCC lines so that:

a) the external PSU will only provide power to the AVR and LEDs.
b) a USB cable plugged in will only power the FTDI and AVR.

Basically, if ONLY the external PSU is connected, I don't want (or need) the FTDI IC powered up. And if ONLY the USB cable is plugged in, I don't want any of the LEDs to turn on. If BOTH are plugged in, everything turns on and hopefully I don't hear a snap, crackle, pop and see blue smoke rising ...

I think all I need is a diode on the VCC line from the USB connector that will prevent current coming from the PSU to reach the FTDI, and on the VCC line from the PSU, another diode that will prevent USB power to reach the LEDs.

In the simplest of simple forms, I believe the circuit would look something like what I've attached with D1 and D2 taking care of the flow. Ignore the fact that there are many other wires and components missing, I did say "in the simplest of simple".

So, is there something wrong with that? And if it would work that way, can I get some suggestions of what diode to use for this? It's all going to be 5V.

Basically yes that would do it but with two reservations:-

  1. You get a 0.7V droop from a diode so you will be powering your arduino with 4.3V and not 5V.
  2. Why do you want the FTDI not to be powered? It will have inputs connected to arduino through 1K resistors and connecting signals to unpowered chips is never a good idea.

If you have the 328's Tx signal connected the FTDI will be powered through that signal. You have to isolate that as well.


Rob

The Seeeduino line of arduino compatible boards (both 328p and 1280 based) actually do what you wish. They do not power the FTDI chip from the board's +5vdc Vcc bus. The Vcc pin of the FTDI wires only to the USB's +5vdc bus coming from the PC. So if the board is being powered by external power Via external DC power connector and not plugged into the PC's USB then the FTDI remains powered down.

Here is a link to one of their board's schematic where you can verfiy that they power the FTDI only via the USB connector at all times. I've owned a Seeeduino mega board for several years now and it has worked flawlessly in this regard. The two 1k resistors on the send and rec signal lines to the AVR chip isolates the FTDI from the board such that there is no problem running the board with the FTDI powered off.

http://www.seeedstudio.com/wiki/images/7/7b/Seeeduino_v3.0.pdf

Lefty

build a board with the 328 and none of the other stuff you don't want. Nothing very complex about doing that and it can be done on a small protoboard with a socket for the 328.

Looks like you are looking for a specific application for your design, and the Arduino (and other boards) tend to be general purpose boards that have some stuff you may not need.

The Arduino, and other boards, are the development kit, for a specific application put together your own board and have only those resources that you need.

Grumpy_Mike:
Basically yes that would do it but with two reservations:-

  1. You get a 0.7V droop from a diode so you will be powering your arduino with 4.3V and not 5V.
  2. Why do you want the FTDI not to be powered? It will have inputs connected to arduino through 1K resistors and connecting signals to unpowered chips is never a good idea.
  1. Okay, I was aware of that, sure. 4.3V would still be enough to download a sketch. The FTDI chip requires 4V to 5.25V (with internal clock generator), and the AVR will also be happy with that. So technically that shouldn't be a problem, unless I am overlooking something here. Is there even something else that won't cause a voltage drop?

  2. Because I'm trying to not burn an additional 15mA. :slight_smile: So how would I isolate the TX/RX lines as well?

Graynomad:
If you have the 328's Tx signal connected the FTDI will be powered through that signal. You have to isolate that as well.

See #2 above. Can it even be done?

retrolefty:
The Seeeduino line of arduino compatible boards (both 328p and 1280 based) actually do what you wish. They do not power the FTDI chip from the board's +5vdc Vcc bus. The Vcc pin of the FTDI wires only to the USB's +5vdc bus coming from the PC. So if the board is being powered by external power Via external DC power connector and not plugged into the PC's USB then the FTDI remains powered down.

Right, I see that. However, that part I already figured out, it's what comes afterwards. USB needs to also provide power to the AVR, but not what the AVR itself is driving (being the LED drivers and LEDs themselves.) The idea here is that one can program the AVR with the USB connected, REGARDLESS of whether the external PSU is connected or not.

kf2qd:
build a board with the 328 and none of the other stuff you don't want. Nothing very complex about doing that and it can be done on a small protoboard with a socket for the 328.

That's exactly what I'm doing.

I was trying to isolated the FDTI <> ATmega328P, using opto-coupler. Computer power the FDTI and the other PSU power the Atmega chip. I did that experiments and work just fine. Can be use for data transfer using the RX / TX.

Here the tread : http://arduino.cc/forum/index.php/topic,92665.0.html

It a prototype at this time, later I will add a circuit to link : RX --> TX TX --> RX only. A switch to A. Use the FDTI or B. Data link only. A 74LS157 can do this job.

My idea to isolated a power project from the computer - USB. No need for a RS232. It work !!!

Right, I see that. However, that part I already figured out, it's what comes afterwards. USB needs to also provide power to the AVR, but not what the AVR itself is driving (being the LED drivers and LEDs themselves.) The idea here is that one can program the AVR with the USB connected, REGARDLESS of whether the external PSU is connected or not.

Understood. The Seeeduino does this by having a manual slide power switch which determines how the rest of the board is powered. In the external position the Vcc comes from the on-board +5vdc regulator which gets it's power from the external power connector. If placed in the USB position the whole board is powered by the USB +5vdc. This could just as easy be a 3 pin sip jumper clip. So no diode drop concern, no complex auto-voltage circuit required, just a users choice with a on board switch or jumper clip. Elegance and reliability through simplicity.

Lefty

retrolefty:
Understood. The Seeeduino does this by having a manual slide power switch which determines how the rest of the board is powered. In the external position the Vcc comes from the on-board +5vdc regulator which gets it's power from the external power connector. If placed in the USB position the whole board is powered by the USB +5vdc. This could just as easy be a 3 pin sip jumper clip. So no diode drop concern, no complex auto-voltage circuit required, just a users choice with a on board switch or jumper clip. Elegance and reliability through simplicity.

I did consider the switch option which, as you said, would be reliable and simple. I'm not sure how to make that work though because in one configuration (USB), both the FTDI and AVR need to be powered, nothing else on the board. And in the other (PSU) mode, only the AVR and the rest of the board need to be powered. And if BOTH are plugged in, then everything is powered (since the FTDI gets its power from USB anyway). Basically, the AVR is the "overlap" between the two circuits.

And then there's the issue of the TX/RX lines of course.

Maybe I'm just asking for too much then. Maybe I should just forget about saving current consumption and just power the whole dang thing at all times. Gah.

KirAsh4:

retrolefty:
Understood. The Seeeduino does this by having a manual slide power switch which determines how the rest of the board is powered. In the external position the Vcc comes from the on-board +5vdc regulator which gets it's power from the external power connector. If placed in the USB position the whole board is powered by the USB +5vdc. This could just as easy be a 3 pin sip jumper clip. So no diode drop concern, no complex auto-voltage circuit required, just a users choice with a on board switch or jumper clip. Elegance and reliability through simplicity.

I did consider the switch option which, as you said, would be reliable and simple. I'm not sure how to make that work though because in one configuration (USB), both the FTDI and AVR need to be powered, nothing else on the board. And in the other (PSU) mode, only the AVR and the rest of the board need to be powered. And if BOTH are plugged in, then everything is powered (since the FTDI gets its power from USB anyway). Basically, the AVR is the "overlap" between the two circuits.

And then there's the issue of the TX/RX lines of course.

Maybe I'm just asking for too much then. Maybe I should just forget about saving current consumption and just power the whole dang thing at all times. Gah.

Your making it sound more difficult then it really is. The FTDI will be 'hardwired' to the USB's +5vdc and isolated from the AVR send and rec pins with two series 1k ohm resistors, so we can leave the FTDI alone for the rest of this discussion. The FTDI will not draw any power unless the USB cable is plugged into the PC.

Now you have a spdt switch (or a 3 pin SIP male header) and the common terminal of the switch (or center pin of the SIP) wired to the boards +5vdc bus that goes to the AVR's Vcc pin and anything else on the board that requires +5vdc. The normally open switch terminal wires to the USB's +5vdc pin. The normally closed switch terminal wires to your external +5vdc regulators output. It's as simple as that, it has total isolation between the two +5vdc voltage sources, there is no way that both +5vdc sources would ever be connected together accidently. It's a proven design used by Seeeduino and perhaps others.

See any 'holes' in that solution? I don't, but would be happy to listen if I'm wrong.

Lefty

OH! You're talking about doing something like this?

Why double throw? Why not SPST?

The switch you have there is an SPDT, you do need double through.

I guess in theory there would still be a small current drain through the 1k resistors but I could live with just using them to isolate, it's simple.

Another option is to use a schottky diode (K to 328, A to FTDI) and a pullup on the FTDI chip. It would raise the low voltage seen by the 328 but still be within specs I would think.


Rob

Graynomad:
The switch you have there is an SPDT, you do need double through.

Hrm, I just realized that SparkFun's SPDT and DPDT symbols are identical, which made me grab the SPST one ... didn't think I need two contact both ways.

Graynomad:
I guess in theory there would still be a small current drain through the 1k resistors but I could live with just using them to isolate, it's simple.

Would it be better to use 10K instead? Or will that cause problems when I'm actually trying to program something?[/quote]

Ok, what am I missing here? On the left is SFE's SPDT symbol. On the right is their SPST symbol. So, why can't I use the SPST switch? Isn't it just a flip-flop between the two poles? If the AVR is on the left, and the two poles on the right are one to the FTDI's VCC and the other to the PSU VCC?

The SPDT seems to have more poles than I need ...

What am I missing?

SW.png

Well to my mind the left one has two poles, it's a DPDT and the right one is a SPDT.

So I too am confused, that's the terminology I've used for years but that don't mean it's right.

EDIT: I had a look at Wiki

The SFE drawings are wrong and my sanity is restored :slight_smile:


Rob

KirAsh4:
Ok, what am I missing here? On the left is SFE's SPDT symbol. On the right is their SPST symbol. So, why can't I use the SPST switch? Isn't it just a flip-flop between the two poles? If the AVR is on the left, and the two poles on the right are one to the FTDI's VCC and the other to the PSU VCC?

The SPDT seems to have more poles than I need ...

What am I missing?

Your symbol drawing is trash. The one on the left is a DPDT and the one on the right is a SPDT. A SPDT (as drawn on the right symbol) is what will work for power switching on your board. The center terminal will become the board's +5vdc bus. The two other contacts will be wired to the USB's +5vdc and the external +5vdc regulators output.

Lefty

Graynomad:
Well to my mind the left one has two poles, it's a DPDT and the right one is a SPDT.

You're thinking is spot on with mine.

Graynomad:
The SFE drawings are wrong ...

Wouldn't be the first time ...

retrolefty:
Your symbol drawing is trash.

It's SFE's symbol, not mine. :slight_smile:

retrolefty:
The one on the left is a DPDT and the one on the right is a SPDT. A SPDT (as drawn on the right symbol) is what will work for power switching on your board. The center terminal will become the board's +5vdc bus. The two other contacts will be wired to the USB's +5vdc and the external +5vdc regulators output.

Then, what I had in my schematic earlier is correct then.

KirAsh4:

retrolefty:
Your symbol drawing is trash.

It's SFE's symbol, not mine. :slight_smile:

Understood. But SFE means little to me, I just call them like I see them. :wink:

retrolefty:
The one on the left is a DPDT and the one on the right is a SPDT. A SPDT (as drawn on the right symbol) is what will work for power switching on your board. The center terminal will become the board's +5vdc bus. The two other contacts will be wired to the USB's +5vdc and the external +5vdc regulators output.

Then, what I had in my schematic earlier is correct then.

Perhaps, it's a long posting thread, perhaps you could link again and I would be glad to take a look at it.

Lefty

Here ya go.