Teensy 4.0, MIDI, LEDs

gelatin

Member
Hello!

I have working setup that uses an Arduino UNO to receive MIDI information and control an array of about ~450 WS2812b LEDs, but I would like to use a Teensy 4.0 instead because Teensy is a far superior computer, and I plan on writing some slick animations for it based on the MIDI input and possibly expanding the number of LEDs late. Also, I am enjoying learning how to build circuits, so I'd rather just do it myself.

I've been able to successfully control the LEDs programmatically using Teensy, with no MIDI input circuit, using the OctoWS2811 adapter, with everything just hooked up to the 5v line from the power supply. However, last night, when I built the MIDI input circuit and hooked everything up together, I fried my Teensy 4.0. My guess is that this is because when MIDI information came through, that 5v line was used to feed the 3.3v hardware serial pin, and the OctoWS28211 adapter doesn't convert INCOMING 5v signals to 3.3v (duh). I've taken a look at the Teensy MIDI Input diagram (I was using the MIDI spec) and I see that it uses 3.3v to power the Teensy as the Teensy 4.0 is not 5v tolerant.

I would really like to be able to just plug the Teensy/MIDI/OctoWS2811 assembly into my current power arrangement, rather than cutting the power wire from the power assembly and using an additional USB cable to power the Teensy because it is simpler that way, Teensy can run faster with 5v power input, and because I would like to have the Arduino as a backup if anything happens to the Teensy (because I know it works already). My question is, what must I do to reliably convert the 5v signal coming from the MIDI circuit to the 3.3v required by the Teensy hardware serial pins? I'm new to electronics, if you couldn't tell, so if I'm way off, I'd appreciate some guidance.

Thanks
Alex
 
what must I do to reliably convert the 5v signal coming from the MIDI circuit to the 3.3v required by the Teensy hardware serial pins?

A hardware serial MIDI in connection is usually protected by an optoisolator that is current based so it will work with 5v or 3.3v provided the resistor values are such that the current is still sufficient to operate the optoisolator.

See Paul's schematic here:
https://www.pjrc.com/teensy/td_libs_MIDI.html
 
Ohh I see what I did wrong. I connected Pin 6 of the optocoupler directly to the 5v rail (like you would with an Arduino) when I should have connected it with a 470ohm resistor to the Teensy 3.3v output, correct?
 
Back
Top