teensy 3.1 5V output?

Status
Not open for further replies.

zalterman

Well-known member
It seems as though the teensy cannot output 5v - I am correct about this or is there a work around?
I was planning on using my teensy to power/receive data from a PIC16F873 microcontroller about 6 feet away - anyone know if this will still work with 3.3V?

Thanks
~Z
 
When connected via USB, there's 5V available from that source, ahead of the 3.3V regulator. Six ft. of wire to run a PIC is OK.
There are some PICs that run on 3.3v, and/or maybe the one you cite is OK with 3.3 or would be at a reduced clock rate.

Wonder why the need for the PIC? That PIC16F873 is "not recommended for new designs" meaning at/near end of life, production halt soon.


An Atmel AVR could take a .hex produced in the Arudino environment - commonality with Teensy 3. Maybe you have some compelling to use the PIC.
 
Last edited:
Thanks for the reply - yeah I figured there is 5V somewhere on the teensy - I just cant figure out if there is actually a pin out for it. The pin diagrams indicate it doesnt exist.

Ha good question about the PIC - I'm mostly using it because a very nice friend offered to help me put it together and code it - and that's the medium he is working with. It's been nice to see where I'm coming from historically and learn to use the PIC basic pro language, but this probably last time I use it.
 
First, to directly answer your question, the USB 5 volts connects to the VUSB and VIN pads. Here's the schematic.

http://www.pjrc.com/teensy/schematic.html

Regarding 6 feet of cable, that's a pretty long distance to send signals. The pins on Teensy and also on a PIC are meant to drive relatively short wires, pretty much on the same circuit board or to close-by parts.

At least 2 types of problems come up when sending signals over long distances.

#1: Ground differences between the 2 locations can cause big problems. The pins on a Teensy or PIC are not meant to handle negative voltages, which can happen if the grounds differ slightly. Teensy 3.1 is 5V tolerant, so it can handle a 3.3V signal that's up to 1.7V too high.

#2: Long wires tend to have signal reflections that can cause stress or damage to the parts, not to mention simply causing unreliable results.

Usually "long" wires are driven by special transceiver chips. These chips give you 3 things. They're able to handle a wider "common mode range", or signals that are slightly below ground or above the power, due to the 2 sides not having exactly the same ground. They typically have some sort of slew rate control, which limits signal reflections and helps prevent radio frequency emissions. They also often have some sort of design for impedance matching (often you supply a resistor) to the cable, which *really* helps give excellent signal quality. Some chips, like the RS-485 ones, transmit the signal on a pair of wires and receive it as a difference, which gives you incredible resilience to noise and interference. Some others, like RS-232, use a wider voltage range.

But adding transceiver chips means more parts, more work, more cost and more complexity. For 6 feet on a non-critical project, you can probably "get away" with just connecting the pins to a cable. I would recommend at least connecting 100 ohm resistors between the pins and the wires. That will give you a little better impedance matching, and if things go horribly wrong (like accidentally shorting wires to stuff), some impedance might limit the current into the chip and lessen the odds of destroying it.
 
It's possible to get cheap optical fiber without connectors. Photodiodes and LEDs are also very cheap. Maybe a DIY optical signalling system would be an interesting way to connect your PIC and your Teensy?

Depending on the environment, you might even dispense with the optical fiber altogether and simply use IR, like a TV remote.
 
Hey Paul -thanks for your detailed response. I will connect the Vin of my PIC to the VUSB of the teensy to get the 5v. Will ground differences still be a problem if I connect the ground of my PIC to the ground of the teensy?

When you say "get away with just connecting the pins to a cable" do you mean just doing what I was planning on? I was going to use a stereo audio cable to transmit the 5V line, ground line, and serial line from the TX of the PIC to the RX of the teensy(which is connected to computer via USB). Or do you mean instead of using PIC, just going 6 feet from each sensor (there are 21 of them, 16 digital 5 analog) directly into 21 input pins on the teensy? This is what I was doing before, but the 25 pin cable I was using was much too thick and breaking it out on the other end seemed like a waste of space - hence the PIC at the sensor end (with pullups, led for confirmation that its on, and crystal oscillator) to send a single serial data stream.

The reason I am not just using the teensy at the sensor end and using a long USB cable to go to my computer from there, is that I have 3 'sensor modules' simultaneously being used, and was going to use the teensy as the 'hub' for it all (taking in 3 rx streams, unpacking them, and translating it to MIDI outputs to my computer).
 
pictographer - I need imperceivable latency with the data (it is for music controllers that need to be rhythmically precise). Doesn't IR usually have at least a .25 second lag? I know my TV remotes I always have to have pointed perfectly and press a few times to register.

DIY optical signaling system sounds awesome but probably beyond my capabilities haha - I have zero knowledge about any optical data transmission and imagine its not too easy...
 
DIY optical signaling system sounds awesome but probably beyond my capabilities haha - I have zero knowledge about any optical data transmission and imagine its not too easy...
At low data rates, infrared (optical) for short line of sight range, like 50 ft., is simple. Add-n hardware is about $4.
I can detail if you wish.
 
When you say "get away with just connecting the pins to a cable" do you mean just doing what I was planning on? I was going to use a stereo audio cable to transmit the 5V line, ground line, and serial line from the TX of the PIC to the RX of the teensy(which is connected to computer via USB).

Yes, this.

Connect a 4.7K resistor between each Teensy RX pin and the 6 foot wire going to the PIC's TX pin. If things go very wrong, the resistor might save Teensy.

At the PIC end, put a 100 ohm resistor beween the wire and PIC.

The reason I am not just using the teensy at the sensor end and using a long USB cable to go to my computer from there, is that I have 3 'sensor modules' simultaneously being used, and was going to use the teensy as the 'hub' for it all (taking in 3 rx streams, unpacking them, and translating it to MIDI outputs to my computer).

I hope you'll post some photos, or even better put this on a blog somewhere if you're willing to share the design. I know a lot of people want to build large-scale MIDI controllers, especially for DJ applications, so I'm sure this would get a lot of interest.
 
Suggest not using PIC Basic Pro if this project could proliferate to many users. One reason is that the license for that software is about $120 to $270 depending on which PIC chip and what features you need.
 
At low data rates, infrared (optical) for short line of sight range, like 50 ft., is simple. Add-n hardware is about $4.
I can detail if you wish.

this will probably not work, as the circuitry is embedded within a drum kit with a lot of physical motion - my legs will often go through the line of sight of infared, and the board with sensors/data output itself will be moving around as im hitting the drums. I know its nothing knew, but it still blows my mind that infared data transfer is possible!
 
Yes, this.

Connect a 4.7K resistor between each Teensy RX pin and the 6 foot wire going to the PIC's TX pin. If things go very wrong, the resistor might save Teensy.

At the PIC end, put a 100 ohm resistor beween the wire and PIC.

won't the resistors create a voltage drop and conflict with the voltage expecations of the teensy RX pins?
 
here is a picture of a prototype of the drum mount

this is with a 25pin connector going 6 feet to a breakout board - breadboard with pulldowns and some capacitors, into arduino, into computer.
version 2 will have a PIC onboard the mount with a simple stereo audio jack to plug a cable into

tomdrumBirdieMount.jpg
 
Status
Not open for further replies.
Back
Top