Breaking News
Comments
Max The Magnificent
User Rank
Blogger
I've been naughty
Max The Magnificent   5/6/2014 4:06:56 PM
NO RATINGS
I don't know what the folks at Arduino and Microchip are going to say when they hear that I've taken a soldering iron to their boards...

Duane Benson
User Rank
Blogger
Re: I've been naughty
Duane Benson   5/6/2014 4:54:42 PM
NO RATINGS
"I don't know what the folks at Arduino and Microchip are going to say when they hear that I've taken a soldering iron to their boards"

I'm not sure it's the soldering iron that anyone will be concerend about. You have both a Atmel and Microchip MCUs in your system. The interaction between the two might stop the spin of the planet,

Max The Magnificent
User Rank
Blogger
Re: I've been naughty
Max The Magnificent   5/6/2014 4:56:20 PM
NO RATINGS
@Duane: You have both a Atmel and Microchip MCUs in your system. The interaction between the two might stop the spin of the planet.

Can't we all just get along? LOL

Duane Benson
User Rank
Blogger
Re: I've been naughty
Duane Benson   5/6/2014 5:13:40 PM
NO RATINGS
Max - "Can't we all just get along? LOL"

One year, at the Embedded Systems Conference, the two companies had rather large booths directly across the aisle from each other.

Throughout the show, I noted several iterations of increasingly... "spirited" signage pointed at the other from across the aisle.

I found humor in it.

Max The Magnificent
User Rank
Blogger
Re: I've been naughty
Max The Magnificent   5/6/2014 5:16:38 PM
NO RATINGS
@Duane: ...the two companies had rather large booths directly across the aisle from each other.

A bit of a glitch in the planning department there :-)

ewertz
User Rank
Manager
BYO5V
ewertz   5/7/2014 5:55:48 PM
NO RATINGS
At least on the Arduinos, you don't have to do any such modifications if you already have regulated 5V available elsewhere.  All that you have to do is to connect your 5V *regulated* PSU to the POWER (the lower left-hand 6/8-pin) header's "5V" pin, and you're done.  This pin is on the 5V power "bus" that is either USB bus power or the output of the linear regulator, depending on which you've got connected.

So, basically, instead of using the 5V power pin as an output (for shields or jumpers to breadboards), you're using it as board power input.

You might look to see if this is also an option on the ChipKit boards.  Unless there's something upstream in the power conversion/switching circuit that's going to get back-powered (to any detrement), this should also work.

BTW, I think that many of the 3V3-native boards *only* generate 5V as an intermediate power rail because there are so many legacy shields/circuits that still really do need 5V to work, so they still make it available as a convenience to the user.  Otherwise, the 3V3 Arduino "compatibles" couldn't care less about the existence of 5V.

 

Don J
User Rank
Rookie
Re: BYO5V
Don J   5/8/2014 8:56:33 AM
NO RATINGS
BY05V, If I understood your description correctly, connecting the external 5V to the 5V header pins would allow you to avoid the modifications to D1 and IC1 and power the Arduino from the external supply. However it does not eliminate Max's concern for having the USB power back-driving the external supply. You would also need to add a jumper from +5V to the resistor divider and add the 5.6K to make sure the USB power is disabled when the external supply is connected. I would also be concerned about the USB power back-driving IC1.

Max The Magnificent
User Rank
Blogger
Re: BYO5V
Max The Magnificent   5/8/2014 10:06:00 AM
NO RATINGS
@ewertz: At least on the Arduinos, you don't have to do any such modifications if you already have regulated 5V available elsewhere.  All that you have to do is to connect your 5V *regulated* PSU to the POWER (the lower left-hand 6/8-pin) header's "5V" pin, and you're done.

Actually, I beg to differ. What you want is that if only the USB cable is plugged in you use that as a power source -- if only an external supply is plugged in you use that as the power source -- and if both the USB and an external supply are plugged in you use the external supply.

The problem with your suggestion -- driving 5V directly into the +5V pin on the header on the Arduino is that the VIN signal is on the input to the regulator -- the resistor divider would generate an outpout of 0V, so the comparator would enable the FET and allow the USB power to come through -- resulting in the USB and your external supply both trying to power the 5V rail.

This wouldn't be a mega issue if they were both at EXACTLY 5V all the time, but there are always going to be tiny differences between them, leaving them fighting with each other.

 

ewertz
User Rank
Manager
Re: BYO5V
ewertz   5/8/2014 1:12:35 PM
NO RATINGS
My premise was exactly the one that you stated -- that you wanted to eliminate all of the cables and rely just on the perfectly good 26A/5V supply.  

Was that not the whole point...?!?!?  I believe that it was, and the stated solution does exactly that.

 

 

Max The Magnificent
User Rank
Blogger
Re: BYO5V
Max The Magnificent   5/8/2014 1:43:51 PM
NO RATINGS
@ewertz: My premise was exactly the one that you stated -- that you wanted to eliminate all of the cables and rely just on the perfectly good 26A/5V supply.  Was that not the whole point...?!?!?

Well yes -- that's true -- when the system is deployed I want all the sub units to run off a single 5V/26A supply.

However -- even when everything is connected up, I might still want to connect a USB cable to one of the microcontroller boards in order to upload a new program (in which case I want the board to use the USB for data and continue using the external supply for power).

It's also conceivable that I might want to remove a microcontroller board from the system and take it to my work bench and power it just using a USB cable -- I think that's where "Don J" is saying a problem may occur.

I can, of course, always ensure that I have an external power supply plugged in -- which would remove any problem -- but now I want to check it out on a 'scope with just USB power to see if it works or not...

ewertz
User Rank
Manager
Re: BYO5V
ewertz   5/8/2014 4:18:14 PM
NO RATINGS
If you want to reprogram the Arduino all that you have to do is to disconnect the regulated 5V power from the POWER:5V pin, plug in the USB and reprogram.  This would also necessitate removing any shields that you have connected, if they're relying on more than the 500mA you can suck from USB (or plug in a wall-wart if you don't-want/can't disconnect easily from the rest of your system).

The only thing that you can't do with the completely unmodified setup that I described is to use serial output back across the USB cable to the PC.  That relies on the USB being connected, so perhaps *that* you can't do in situ for reasons that you cite.  But even that could be worked-around by using a simple USB-TTL converter and just connecting RX, TX and GND that you can get from eBay sub-$10.  These typically use CP2102s, PL2303s or (for $1-2 more) the oft-used FT232RLs.  Of course, if you're fly enough to still have an RS-232 port, it's even cheaper because that's just a MAX232, and a DB-9.

Once again, I'm unsure if this solution carries over the ChipKit boards because I haven't looked into those.  It should have been a requirement since BYO5V is fairly widely used for USB-untethered Arduino projects, so IMO it's a high-want feature.

I believe that some PoE sheilds are essentially BYO5V, as they knock-down 48V through a switching regulator and inject their 5V output through their shield pin down into the Arduino.  Alternatively, they could drop to 7-12V and use POWER:VIN instead, relying on the baseboard's LREG to provide the 5V (similar to the wall-wart case).  I've seen PoE PDE power interfaces that do either (12V PoE output into POWER:VIN or 5V into POWER:5V).

 

Don J
User Rank
Rookie
USB Operation
Don J   5/8/2014 9:26:18 AM
NO RATINGS
Max, I'm concerned about this circuit operating from USB power only. When the USB power is connected it will initially be fed to +5V through T1 since T1's gate will be low because there is no +5V to IC7 to pull it high. Once +5V charges up to near 5V, IC7 pin5 will become higher than pin 6 (3.3V) and T1 will turn off. Then +5V will start discharging (since it has no source of power). I suspect T1 will turn back on when +5V gets to around 4.5V. The circuit will probably oscillate and maintain +5V somewhere around 4.5V. This is enough to power the 3.3V regulator (I assume - I haven't read the datasheet), so the Arduino may run OK, but I would be concerned about anything (like shields) which are powered from +5V.

Have you measured +5V with a DMM or looked at it with an oscilloscope when powered ONLY by the USB power?

Max The Magnificent
User Rank
Blogger
Re: USB Operation
Max The Magnificent   5/8/2014 10:46:52 AM
NO RATINGS
@Don J: Max, I'm concerned about this circuit operating from USB power only...

We did consider this, and we decided that the RC time constants associated with the resistor divider and capacitor C12 ... along with the three capacitors associated with the voltage regulator -- along with the hysteresis assocuiated with IC7 -- would mean that things would work as we wished.

But now you have us wanting to be able to answer you definitively, so I'll bring the Arduino back into the office tomorrow (it's currently at home) and we'll put it on a 4-channel 'scope and capture the waveforms ... watch this space...

Max The Magnificent
User Rank
Blogger
Re: USB Operation
Max The Magnificent   5/9/2014 4:42:26 PM
NO RATINGS
@Don J: Max, I'm concerned about this circuit operating from USB power only...

Arrggghhh! We hang our heads in shame. It turns out you are correct. Things are not as we would wish them to be.

We powered up the Arduino Mega (with our modifications) using only the USB power. Here's an image of the output from the comparator, and here's an image of the +5V supply rail as being supplied by the USB cable with the transistor turning on and off. As you can see, the +5V rail is oscillating between around 4.5V and 4.7V with a frequency of ~2.6KHz (sad face).

The Arduino itself tolerates this -- the default "Blinky LED" sketch works just fine (which is what lulled me into a false sense of security) -- but it's not possible to predict how well any shields would tolerate this.

On the bright side, everything is rock solid when powered by the external 5V supply, which was the main point of this exercise -- also, things work as planned if both the main supply and the USB cable are connected (in which case the main supply is the power source; the USB is used only for data).

So I just have to remember not to connect these boards only to the USB cable. Having said this, Ivan is taking this very personally -- he just went off muttering to himself that he's going to ponder this problem over the weekend, so once again, watch this space LOL

Don J
User Rank
Rookie
Re: USB Operation
Don J   5/9/2014 5:05:58 PM
NO RATINGS
Max, Thanks for the response and the waveforms, they are about what I expected. I have been noodling on this also, but don't have any good answers yet either.

I think you can use this circuit with just the USB connected as long as you are not relying on the 5V supply for anything other than feeding the 3.3V regulator. The 3.3V regulator should tolerate this oscillation and maintain the 3.3V supply within range.

I hope Ivan doesn't lose any sleep this weekend, and I'm sure he'll come up with a clever solution, I just hope I can beat him to it :-)

Don

Max The Magnificent
User Rank
Blogger
Re: USB Operation
Max The Magnificent   5/9/2014 5:30:30 PM
NO RATINGS
@Don J: I just hope I can beat him to it :-)

The race is ON!

Don J
User Rank
Rookie
Re: USB Operation
Don J   5/12/2014 9:52:17 AM
NO RATINGS
The simpleset solution I came up with is to replace IC1 with a Schottky Diode instead of the jumper. This would allow the USB to power +5V at 5V, however the external supply would power +5V at a few tenths below 5V. But at least +5V would not have the ripple.

The better solution would be to replace IC1 with another FET like T1 and drive it's gate with an inverted version of the T1 gate drive. This would require an inverter (which could be a small signal BJT or another FET), and may need a pull-down on VIN... more parts, but a better overall solution. Still need to spec out the parts and packaging (which can be fun... :-)

 

Max The Magnificent
User Rank
Blogger
Re: USB Operation
Max The Magnificent   5/12/2014 10:00:04 AM
NO RATINGS
@Don J: The better solution would be to replace IC1 with another FET like T1 and drive it's gate with an inverted version of the T1 gate drive.

I wish I could get you and Ivan in the same room together -- he was just in my office waving the circuit diagrams around saying almost exactly the same thing -- he suggests replacing IC1 with a depletion mode FET (he suggested IXTH16N10D2) -- plus we no longer need to add the resistor in parallel on the resistor divider, but we do have to cut a couple of traces and add a couple of wires.

Personally, for simplicity, I'm just going to keep our existing solution and say that I will always have the Arduino powered from my external 5V supply -- and occasionally I may also plug in the USB cable for programming purposes, but never to power the board.

Don J
User Rank
Rookie
Re: USB Operation
Don J   5/12/2014 12:56:04 PM
NO RATINGS
An N-channel depletion mode FET is a great idea.

I agree your current implementation is the best answer for your situation. The other solutions require procuring additional parts and additional work with very little (if any) added value.

Have fun with your project, and keep writing the entertaining columns!

Don



Flash Poll
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Rishabh N. Mahajani, High School Senior and Future Engineer

Future Engineers: Don’t 'Trip Up' on Your College Road Trip
Rishabh N. Mahajani, High School Senior and Future Engineer
7 comments
A future engineer shares his impressions of a recent tour of top schools and offers advice on making the most of the time-honored tradition of the college road trip.

Max Maxfield

Juggling a Cornucopia of Projects
Max Maxfield
20 comments
I feel like I'm juggling a lot of hobby projects at the moment. The problem is that I can't juggle. Actually, that's not strictly true -- I can juggle ten fine china dinner plates, but ...

Larry Desjardin

Engineers Should Study Finance: 5 Reasons Why
Larry Desjardin
41 comments
I'm a big proponent of engineers learning financial basics. Why? Because engineers are making decisions all the time, in multiple ways. Having a good financial understanding guides these ...

Karen Field

July Cartoon Caption Contest: Let's Talk Some Trash
Karen Field
151 comments
Steve Jobs allegedly got his start by dumpster diving with the Computer Club at Homestead High in the early 1970s.

Top Comments of the Week
Like Us on Facebook
EE Times on Twitter
EE Times Twitter Feed

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)