pretty sure i let out the smoke

Most optocouplers are too slow for WS2812 / WS2815 data. If you're going to go that route, you probably want a higher speed RF-based isolator, like ISO6420 or CMT8020N0 or similar. These isolators can also serve to convert logic levels.

But the (presumed) problem remains that accidentally touching 12V power to the signal will destroy the isolator rather than Teensy. If that's an acceptable result, then go for it. If not, you still need some sort of protection so you don't destroy the isolator.

If the isolator is used properly, truly isolated power on both sides, it should be very effective at preventing problems with 12V (or even significantly higher) from reaching Teensy.



that's a whole new can of worms...

how many of those would i have to have to handle all the circuits?
 
I'm looking at your schematic.

Fuses are not a good choice. By the time the fuse takes to "blow" (or increase in resistance for PTC self resetting type), the damage to Teensy will be long since done. Fuses are mainly used to prevent extreme overheating which can cause a fire.

You really want to have resistors where the schematic shows fuses.

The schottky diodes should connect between the Teensy pin and 3.3V. In other words, connect them to the other other side of those 450 ohm resistors.
 
To try to give you a useful example, I pulled out my draw of random zener diodes and a solderless breadboard.

For a first attempt I found a 1N4728A zener (rated 3.3V) and a 1N5819 schottky, and two 330 ohm resistors. As a first test, I ran basic LED blink with the delays increase, so my multimeter shows the same long enough to shoot a photo.

As you can see, the 1N4728A zener will not work! It's rated for 3.3V, but that's at some higher test current. It starts conducting with much less than 3.3V - so much that Teensy's 3.3V signal becomes only 2.041 volts.

Remember earlier how I mentioned zeners are imprecise and you would need a higher voltage spec than you actually want. Here's a quick test to demonstrate why a 3.3V zener diode will not work.

protect1.jpg
 
Last edited:
To demonstrate this 2.04 volt problem really is due to the zener diode starting to conduct way below its 3.3V rated voltage, here's the exact same test when I pull the zener diode. The output is 3.24.

protect2.jpg
 
Next I tried putting in a 1N4732A diode, rated at 4.7 volts.

This zener diode has almost no interference with the signal. The output while logic high is 3.23 volts.

protect3.jpg
 
Now for a test to see how this protects from 12 volts, first I removed the wire between Teensy and this circuit. Then I set my power supply to 12 volts and connected it to the output.

protect4.jpg


Here's the voltage measured at the zener diode, which is after the first stage of protection. 4.77 volts looks like what the zener is rated to do... which makes me wonder if something was wrong with that other zener diode.

protect5.jpg


And here's the voltage measured at the schottky diode, after the second stage and what will actually get onto the Teensy pin. It's 3.49 volts, which is probably ok.

protect6.jpg
 
Now for the moment of truth... I put the wire back in, so the circuit with 12 volts at the output is now connected to Teensy pin 13.

I'm happy to report the Teensy 4.0 in this test is still working fine and running the LED blink program. When driving high, the voltage is 3.312.

protect7.jpg


When driving low, the voltage is 0.215. It is having to work harder to make a low output, because current is coming in from the 12 volt power supply. Most of it gets diverted by the zener diode, but the rest that flows into the pin and make it harder for Teensy to drive the pin fully low.

protect8.jpg
 
Now for another test, do LEDs actually work. I'm sad to say, first result was no. The circuit seems to interfere with the signal too much. Probably the zener diode has too much capacitance and forms a low pass filter together with the first resistor.

protect9a.jpg
 
I tried a few more resistors between Teensy and the zener diode. First 100 ohms, then 56 ohms, and finally only 22 ohms, which lets the LEDs work.

Remember earlier how I said there were 4 ways to choose the parts. Hopefully all these photos can really show how useful a solderless breadboard is for rapidly experimenting.

protect9.jpg
 
Now the question is what happens if the circuit has a much lower resistor. It will protect less, but how much.

Here's a quick repeat of the prior tests without Teensy connected.

At the zener diode, now 4.082 volts. In other words, the zener is probably not doing much work here.

protect10.jpg


And and the schottky diode, now at 3.547 volts. Still ok, but more than we had with 660 ohms total. But this is probably dumping nearly all the incoming current onto the 3.3V power line. Remember the prior comments about care needed to make sure total power usage is always more than the injected current from the fault.

protect11.jpg
 
So for one final test, I reconnected to wire to Teensy 4.0 to see if it survives abuse with this circuit having only 330 + 22 ohms. I'm happy to report Teensy is working fine.

The voltage while high is 3.409, not too bad.

protect12.jpg



But you see Teensy isn't able to bring the pin lower than 0.56 volts when this higher level of current is incoming from the 12 volt power. Still, it does survive.

protect13.jpg


That's all the time I have this morning. Hopefully this helps, maybe just to give you something to copy (probably choose a zener diode rated for lower power so it has less capacitance), but ideally to show how easily this sort of experimentation can be done with a solderless breadboard.

Solderless breadboard usage actually goes quite a bit faster if you're not fiddling with a camera to shoot photos of every test and then write a forum message about each one...
 
thanks for you efforts @PaulStoffregen.
you have far more resources than i do.

this whole thing started because my kid wanted to learn how to program lights and i bought an Uno kit about two years ago. the regulated power supply on your bench is far beyond what i have access to.

so keeping in mind that the motorcycle charging system and the secondary LiFePO4 battery are "12V nominal" rather than a regulated 12V, how would that effect what you have done?

because i''ve put in a secondary battery and a charge controller, i'm expecting a pretty consistent 13.5V from the battery.
 
so here's where i'm at.


points of note:
  • existing -
    the entire system functions off of an auxiliary 8AH LiFePO4 battery stuffed into the Windjammer V fairing: all grounds go back to that battery. it has a charge controller and is connected to the motorcycle's charging system and battery when the ignition is on. this pack also runs a dash cam.
  • existing -
    i opted to supply power from one USB cable through an ESP32 board to ease connections and reduce cable management; this has been tested already and works well. the ESP32 is a communication relay to other boards being worn -- it's cosplay: one board wakes/shutdown the bike lighting and dictates colors to match the rider, the other board just does the wake/shutdown and also takes colors from the rider; both are done in proximity.

  • in build stage -
    i haven't specified the data protection circuit yet; i'll get an assortment of diodes and resistors, then experiment after i build the regulator circuit.
  • in build stage -
    the regulator circuit is a thought i came up with in the past four or so hours.
  • in build stage -
    i intend to use a PCB mounted relay, but the relays for the brake/turn/ignition signal inputs aren't specified yet and aren't in place. i did the programming because the installed location is a pain to get into.

is this clearer?

Schematic.v.1.jpg
 
Last edited:
alright.
i think i've got it all figured out.

thanks for the help and the attempts to educate me.
it would have been easier if i had stayed in it when i was playing with the HAM guys 35ish years ago (yes, i'm an old dog learning new tricks).

Scheme-it-export-New-Project-2026-04-21-16-23.png
 
If you want to protect the 74HCT245 chip from the output wires accidentally touching +12V, you should add a schottky diode between each of the chip's pins and +5V.

While my tests all had the zener diode too, that 2nd round showed the zener wasn't doing much, so just a 330 ohm resistor and a schottky diode is (probably) pretty effective.
 
If you want to protect the 74HCT245 chip from the output wires accidentally touching +12V, you should add a schottky diode between each of the chip's pins and +5V.

While my tests all had the zener diode too, that 2nd round showed the zener wasn't doing much, so just a 330 ohm resistor and a schottky diode is (probably) pretty effective.


i think i have that 12V circuit well isolated under the air gap concepts, but that's a good idea to keep in mind.
 
Relays will isolate Teensy 4.1 pins 38, 39, 40, 41.

But you still have a non-isolated path from 12 volts though the LEDs and into the 74HCT245 chip. Just adding 6 schottky diodes would give you much more tolerance to mistakes or unexpected hardware failures. Not isolation, and a 330 ohm resistor is a lot better than just a direct wire, but a resistor + schottky diode protects a lot more than just a resistor and whatever is inside that 74HCT245 chip.
 
yes.
i did ask the AI about that and the point it made was that the chip is ~$1 and does both the the bump in signal voltage and acts as a sacrificial part. i'm just ordering spares.
 
Why am I not surprised that AI came up with a poor solution... out of all the buffer chips it could have chosen, it picked one that is bidirectional.
At the very least it should be connected so that DIR and OE use the same level, so that if the direction is somehow reversed the output is also disabled.
 
Why am I not surprised that AI came up with a poor solution... out of all the buffer chips it could have chosen, it picked one that is bidirectional.
At the very least it should be connected so that DIR and OE use the same level, so that if the direction is somehow reversed the output is also disabled.


the AI looked at the entirety of my problem statements (blowing the teensy and flickering) and the thoughts i had created with my schematic and pointed out that my schematic was going to produce a lot of heat without a good way to dissipate it.

i haven't ordered the parts yet; is there a better chip you'd suggest?

DIR is 5V and OE goes to ground. i believe that setup is supposed to kill the chip if 12V comes down the data line.
the resistors are there to reduce any reflected data signal.
 
Back
Top