Trinket and TLC59116 project

Greetings all,

I am taking a first stab at designing a basic LED control system using an Arduino Trinket and a TLC59116 LED driver IC. I have two actions I need to happen in this project. First, I need to control 3 different groups of (Common Anode) RGB LED's at the same time by pressing a button to change the color. Secondly, I need to press a different button and turn a laser diode on/off. Setting the coding requirements aside, I have drawn out a circuit that I think will do the job. But having no previous experience with this kind of thing, I was hoping to have someone look it over, give opinions, tell me if I missed anything, or if it just looks like I've been smoking crack.

Here are the corresponding details in the attached schematic:

Vcc=6vdc (4 AAA)
JP1=Trinket left side (USB up)
JP2=Trinket right side
LT=Laser Toggle (SPST button)
CT=Color Toggle (SPST button)
OC1=Optocoupler to isolate higher current requirements for the laser diode.

Thanks!

OC1=Optocoupler to isolate higher current requirements for the laser diode.

As you are using the same Vcc and ground each side of the optocoupler then there is no isolation going on. Also the current output from an optocoupler is quite small.

You also need pull up resistors on the two I2C lines.

The laser diode uses 200 mA at 6V (hence the 30 ohm resistor). According to the specs on the OC I'm using it's within tolerances of the output current, but 200 mA is outside tolerances of the Trinket. That's why I thought the OC was necessary. It there a better way? How many ohms should the pull-ups be on the I2C connections? Also, I discovered that the push button triggers also need a 10k ohm pull-up for each. Do you concur?

With a worst case 50% CTR of an opto, 30mA throught the opto coupler LED could result in only 15mA through the load/laser.
Why the TLC59116. Can't you just switch the laser low-side with a transistor.
Leo..

@musclenerdzllc, do not cross-post. Other thread removed.

Also, I discovered that the push button triggers also need a 10k ohm pull-up for each.

No, if you wire the push button between input and ground and enable the internal pull up resistors then you don’t.

How many ohms should the pull-ups be on the I2C connections?

4.7K

According to the specs on the OC I'm using it's within tolerances of the output current,

Sounds unlikely but as you didn’t post the type number of the device you are using we can’t check.

It there a better way?

Yes like Wawa said use a transistor.

That's for the tips! I'll change the OC to a transistor and add the 4.7K resistors to the mix. Would a simple 2n2222 be good enough in this case?

Would a simple 2n2222 be good enough in this case?

Yes
Don't forget the base resistor.

Here's my revision. I added the 4.7k pull-up resistors to the I2C connections and changed the OC to a 2n2222 transistor. I think I got the base resistor value right (1k), but I wasn't sure. Does this look better?

Does this look better?

No.
You have connected the transistor in an emitter follower mode, this will limit the voltage it can supply and the 30R will limit the current it can supply. Do you need a series resistor with your pointers?

You need the common collector mode, where the emitter connects directly to ground and the laser module is wired from the collector to the supply. ( through a resistor if it is needed ).

Like this?

Transistor revision.JPG

Yes.

musclenerdzllc:
The laser diode uses 200 mA at 6V (hence the 30 ohm resistor).

Confused.
So the laser uses zero volt and the resistor uses 6volt.

Transistor base current should be ~10% of expected collector current for a low saturation voltage.
Leo..

Wawa:
Transistor base current should be ~10% of expected collector current for a low saturation voltage.

So I should make the base resistor something like 220R?

musclenerdzllc:
So I should make the base resistor something like 220R?

If you're expecting to switch 200mA with minimal losses, then yes.

Question about Vf (working voltage) of the 'laser diode' remains.
Leo..

Wawa:
Question about Vf (working voltage) of the 'laser diode' remains.
Leo..

The Laser runs on 6vdc.

So why the 30ohm resistor.
Why not a 6volt supply.
Or does this unspecified 'laser' need current limiting.
Leo..

Wawa:
So why the 30ohm resistor.
Why not a 6volt supply.
Or does this unspecified 'laser' need current limiting.
Leo..

6V = 200mA / 30r

If your asking for specifics on the 'laser' I don't have and other than the small slip of paper it came with stating it runs on 6-9vdc at 200-250mA. It's just a nondescript laser diode I got from an unnamed Chinese seller. I tried various current and voltage levels and 6v-200mA is the best brightness level for my purposes.

6V = 200mA / 30r

No that is not the way you calculate it. You need to know the forward voltage drop of the laser to be able to calculate the current. You then subtract that from your supply voltage to calculate the resistor.
It is simple enough to measure this with a meter.

Thanks for the info! Like I said, I'm still trying to learn the ins and outs of all of this. It seems to work fine with the 30R resistor with only a negligible drop in brightness when going through the transistor. I think I'm good with that.

How does everything else look? I was curious about the capacitors for the battery impedance. Most diagrams I've seen put the first capacitor at 1uF, but I found a couple of posts recommending upping it to 10uF when using batteries and not a power supply. Can you guys give me your take on that?

BTW: I moved the laser part of the circuit to a different board which is why it's not shown here anymore.