How do I provide 5v from Teensy 3.2?

Status
Not open for further replies.

jidagraphy

Active member
I'm not too familiar with circuitry so please excuse my lack of knowledge :(

So I've got a USB Host Board mini from this site http://www.hobbytronics.co.uk/midi-player-tutorial
and following the guide to connect the usb host board to teensy, except that I am not using the
audio adaptor anymore.

But where it says "We need to supply the USB Host board with 5V and GND from the Teensy board"
really confuses me. As far as how I understand, teensy 3.2 only provides v3.3, no?

So I use my best guess to connect the 3.3v out from teensy to a pin named 3v3 on the usb Host Board. It works.
I try connecting 3.3v from teensy to 5v on the USB Host Board. Oddly it works. I'd would have guessed that it wouldnt.
I try connecting Vin from teensy to 5v on the USB Host board. It works. I thought Vin only takes in power from batteries
or any external power supply........?

(btw im using usb connection to supply power to the teensy)

I could have stopped where it works, but the USB Host Board introduces a constant hum when connected to a device.
And I'm on my way to deduce where this is coming from so I'm trying to understand how power supplies work.

Thanks in advance !
 
A good portion of 5V circuits will work just fine on 3.3V nowadays. Not familiar with that host board, but it can work just fine on 3.3V with one exception: the PWR pin in the USB connector will probably have only 3.3V on it, and I would think that would be insufficient for many USB devices. Never tried running any USB device on 3.3V, but 3.3V is way outside the USB spec.

The easiest way to provide 5V to to the host board is to use a 5V power supply. Just hook up a power jack for a barrel connector, and use any regulated 5V power supply, or some other source such as a USB port on a PC. (there are USB male-A to power plug adapters in all popular sizes)
 
As noted - the Teensy only makes 3.3V from supplied voltage. If the supplied voltage is 5V you can use that from the Vin pin. The total current on that will be limited by its supplier, ~500 mA if from USB.
 
Thanks. It does seem safer to use 5v.

An additional question - I need the device to run on usb and batteries. Not planning to have a barrel connector option. 4 AA or AAA batteries would provide 6v ~ 4.8v depending on time (am i right?). Do you reckon I need to use some DC-DC converter inside the circuit somewhere to regulate the voltage to 5v?

If the supplied voltage is 5V you can use that from the Vin pin.

If i supply 5V to the board, presumingly connected to its Vin, how would I use the already-taken Vin??
 
What you want to have is a 5V distribution, and one or more 3.3V distributions. Having power suppllies connected to each other is generally not a good idea though the smaller linear regulators
https://en.wikipedia.org/wiki/Linear_regulator
on the host board and the Teensy can probably cope with being connected without much fuss but generally not a good idea unless you have spent some time reading the data sheets for the relevant parts. You can probably get away with 4 AA batteries, but it is risky since you will be operating outside spec (Alkalines are ~1.7ea fresh so 6.8V). Among other things will probably mean you are feeding 6.7V to your USB device. Which may be OK, may not, depends how well designed it is and only way to find out will be to see if it goes bang.

Best solution is a 5v boost supply designed for your battery chemistry of choice.

Another question is what happens when you plug the teensy USB lead in, since you do not want the USB trying to charge the batteries when flat, nor the >6V fresh voltage going into your PC. Normal solution is to cut the track on the board that normally connects VUSB to Vin on the Teensy, but if you need to run without batteries then something more complex involving diodes will be needed.
 
Thank you for the detailed reply! This really helps me.
I guess I can imagine these two components :
https://www.adafruit.com/product/2164
https://www.adafruit.com/product/2165
- parallelly connected to the battery power supply which is then fed into the teensy and USB board.

You mentioned that having power supplies connected to each other is not a good idea but I need the device (including the usb board) to run interchangably on both batteries and usb power.
So i guess I could use a regulated 5V (from battery or usb) going into teensy and fed back to the USB board.
To be honest most of my understandings are just educated guesses I might be talking unicorns. But still thanks for the topics I should research on.

For your last concern, I'm believing https://www.pjrc.com/teensy/external_power.html option 3 will magically sort it out.
 
re the regulators, for the 5V one see
This regulator has a ~2V linear drop-out. That means you must give it at least 7V to get a clean 5V out. There is a constant 'quiescent' current draw of 6mA.
If you want 5V out from four 1.5V you need a low drop out regulator, but even they need a bit of head room so you will still have a fair bit of wasted battery capacity - and even worse if you use 1.2V rechargeables.

basic linear regulators are cheap, but not very efficient, which may or may not matter in what you are trying to do.

It is probably better to use 2 AA or C cells and a 5V boost converter, just as long as it can drive enough current for what you want to run out of almost flat cells (boost converters have to work harder from lower input voltages).

Doing the diodes as shown works, just remember they will add a 0.5V drop so 5V USB will be 4.5V to the things you are powering from it. Teensy and USB host will work fine turning 4.5 into 3.3V but will mean USB host 5V out will be low (but probably OK) and anything else part of this will need to be OK with that.

One possible choice to bypass much of this is to power from a USB power bank, which will do all the 5V regulation for you and mean your isolation happens because there is only one USB plug.

Random thought, does your code have any 'while (!Serial.begin()); lines in setup? Often trips up projects moving to battery power.

Edit - you shouldn't need to add a 3.3V regulator since both the host shield and the Teensy come with one, so unless you need more than 250mA for something just use one or both of them.
 
Status
Not open for further replies.
Back
Top