Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

[PICS] Driver with Modes: WITHOUT A Controller!

Joined
Jan 14, 2011
Messages
3,816
Points
63
Hey everyone. I figure that I should have done this sooner rather than now, but I wasn't sure how much interest this would garner.

In my I "C" Red entry, I used a very unique driver design that allows me to have power modes (eight modes total) without the use of a PIC or microcontroller. While this may not seem spectacular, it is if you consider that these modes are controlled only by two momentary-on buttons!

I'd appreciate it if you'd vote for me, but I will use this driver regardless (may just end up having to use it for a standard red though - oh no!). Post here to vote!

So, without further ado, here is a detailed explanation of its operation!

Before I go into the operation, here is the layout.

driver-layout.png

Here is the schematic.

driver-schematic.png

So, an explanation.

We begin by looking at the big block on the upper left hand corner. This is the main current regulator. The way this driver functions is that there is a constant current (50uA) feeding out from the Vfb pin (bottom pin of the regulator). So, having a various currents there will determine the voltage on that pin. For example, if I had a 10k resistor there, we could apply Ohm's Law to find the voltage at that pin.

Vfb = IR = (50uA) * (10k Ohms) = 0.5V.

I will call the resistance at that pin Rset from now on. So,

Vfb = (50uA) * (Rset Ohms).

So, adjusting the resistance here changes the current. We'll get into how I change that resistance later. But, for now, assume that I can change the resistance at that pin.

Why is that pin useful? The regulator takes that exact voltage and applies it to the output pin (the pin on the right of the regulator). Because I have a sense resistor on that output pin, the voltage there is directly proportional to the current. So, we can apply Ohm's Law again and solve for the current at the output.

I = V/R = Vfb / Rsense.

Substituting in the equation we used to find Vfb, we have

Iout = (50uA) * (Rset Ohms) / (Rsense Ohms).

What does this output current have to do with the laser diode current though? The laser diode is on the input, not the output! Well, because this is a LINEAR regulator, the input current is exactly equal to the output current! Because this regulator requires an input control voltage (the left pin) higher than the power input voltage (the top pin), we simply put the laser diode between the input rail and the power input voltage! After all, that is where most of the input current is drawn. So, now we have a power input voltage that is lower than the control voltage (V_pwr-in = Vin - V_fw), and the current being pulled through the power input pin is exactly equal to the current pushed out through the output current. So, finally, we have that

I_diode = (50uA) * (Rset Ohms) / (Rsense Ohms).

If you're observant, you'll notice some circuitry between the battery contacts and the diode. This circuitry is simply an off-momentaryOn switch. The MOSFET is used a switching mechanism so that not much current needs to pass through the switch.

Now comes the question of how do I change the resistance of Rset by pressing two buttons? Usually, you could use a potentiometer to adjust the resistance, but that wasn't the goal of this project. The phaser already had two built in buttons, so I wanted to use those!

That raises the question: how do I select a different number of resistors in the series array for different modes? So, I came up with the idea of using a binary counter.

At its most basic, an up/down binary counter is a simple IC that has a certain number of outputs, one for each bit, a few controlling inputs (input voltage, GND input, etc.), and then two other inputs, one for counting up and one for counting down.

The binary counter I chose was a 4-bit binary counter, because I needed at least three bits to have eight modes (2^3 = 8). Further, the counter I used requires that both the up and down pins have 3-5V on it at all times, and will raise the count by one each time one of those pins goes to 0V and then back up to 3-5V.

So then the question comes up of how I use standard buttons to make this happen. I initially thought I would just have two buttons, each one connected to the pin on one leg and the other connected to GND on the other end. But that didn't work. Using a standard button doesn't work! There is a thing called "bounce" which causes the button to switch on and off really quickly before it settles. This is a standard thing for most buttons. But, it always needs to be fixed. So, what I did was use a Schmitt trigger and a capacitor. When I pressed the button, it dropped the voltage at the pin to zero, and when I released it (or when it released on its own due to bounce), it would charge a capacitor and once the capacitor reached a certain voltage, the Schmitt trigger would activate and send 3-5V to the input pin again. This works to debounce the button because it takes TIME for the capacitor to charge. So, because bounce only occurs for a few miliseconds, if it takes longer for the capacitor to charge than it takes for the switch to stop bouncing, then the capacitor basically filters the bounce out! Sorry that was kind of wordy. Was hard to explain.

The next step is to take those binary outputs (bit 1, 2, and 3) and convert them to selecting outputs. This part was clever, I thought!

There is a type of integrated circuit called an analog switch. Imagine it as a standard, SPDT switch. Then, I have a ladder of these analog switches. Bit 3 controls the top of the ladder, bit 2 controls the next step, and bit 1 controls the final step. Here are some pictures depicting what exactly goes on.

State 0: This is the off state. Here, all the binary counts are low, which means, in decimal, the number it corresponds to is 0*2^2 + 0*2^1 + 0*2^0 = 0.
state0.png


State 1: This is the lowest state, gotten by turning on the least significant bit, bit 3. You'll see a voltage up at the top, and this voltage is the voltage that Vfb sees. You can trace the resistance yourself!
state1.png


State 2: Similar to before, except now bit 2 is on and bit 1 is off. You'll recognize the pattern as 000 -> 001 -> 010 -> and so on.
state2.png


State 3: As before, except now bit 3 and bit 2 are on. You'll notice that the voltage Vfb will see is the sum of the voltage it saw from Bit 3 and Bit 2 being on separately.
state3.png


State 4: Here is the first time that Bit 1 turned on. Again, it's the same process as before.
state4.png


State 5: Now, Bit 1 and Bit 3 are on, yielding a voltage that is the sum of the two separate voltages.
state5.png


State 6: The next state, almost to max power!
state6.png


State 7: The final state! Here, all the bits are on, so the resistance at Vfb is equal to the entire resistance of the series array of resistors.
state7.png

Now, you may wonder, can I cycle through, i.e. go from state 7 to state 0 by going up? Yes, I can! The counter will actually automatically do it for me :D

So, because the resistance changes at each mode, so will the output power! I selected the resistors to be approximately right at the threshold voltage from state 1 onwards, up to around 3.3A.

I hope you guys learned something from this write-up! I thought it was informative :D

If you have any questions, feel free to ask.
 
Last edited:





Joined
Feb 1, 2008
Messages
2,894
Points
0
Hmm.... this is very clever indeed.

So the idea is achieve more discreet steps in current adjustment?

Then scaling up to whatever current you need could be done in 7 steps. Neat!

You don't suppose you could use 2-3 flip flops to represent each of your states? Depending on how you want it, it could be done with 2 or with 3. But from that, you could remove the extra switch, and then just "clock" your counter into changing the state of the FFs enabling different switches in that analog IC.

This is neat.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Yeah, that's the idea!

Initially, I planned on using three flip-flops, actually. In fact, I even have a board laid out for it. But then I started thinking that this sort of thing probably exists in a prepackaged form and would probably be significantly smaller, too. Especially since I needed synchronous switching (which would require some other gates). So, I figured I would just use a 4-bit synchronous timer from TI and then ignore the fourth bit =p
 

BowtieGuy

0
LPF Site Supporter
Joined
Oct 14, 2012
Messages
6,090
Points
113
Hey Wolfman, have you built one of these yet, or is it still in the concept stage?
Either way, it's an impressive job. Technically way over my head, but I can appreciate the work, time, and expertise involved.

BTW - You're right, you should have posted this earlier. I'll bet it could have swayed a few votes your way. :)

+1 Great job,:beer: hope to see it in action!
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Yes, I have built one of these, and it works exactly as expected! There was a bump or two along the ride (wasn't aware about the bounce issue of the switches, so needed another one made that included the Schmitt trigger) and the initial current setting was a bit off, but the version I have right now hooked up to the phaser's buttons and battery contacts works exactly as intended! :D
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Well, a pot can't be controlled by two buttons. And I have zero experience with microcontrollers and I wanted to do something original! Anyway, I don't need to do any programming with this. A few ICs, a few resistors, and two capacitors did the job! Anyway, if I had a microcontroller, I would need a DAC still.
 
Joined
Sep 12, 2007
Messages
9,399
Points
113
You are correct. Pots are not controlled with buttons, they are controlled with fingers :)

You wouldn't use a DAC with a microcontroller, you would use PWM.

It's an interesting solution, and I congratulate you on your efforts. But let's be honest; It is not practical or cost effective to have 10 ICs do the work that one could.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Yes, I could use PWM. But that means its not analog, which everyone knows is better!

Of course it's not practical or cost effective. That's not the point! But I have no knowledge of microcontrollers nor do I have the means to program them (unless I get the USB programmable ones, but then I need a programming board, right?). But, it is a neat proof of concept. Most people don't think about using analog switches as rudimentary DACs, and I wanted something unique. An analog controlled, handheld driver! :D
 
Joined
Sep 12, 2007
Messages
9,399
Points
113
Microcontrollers aren't as difficult to learn about as you might think. Programmers can be purchased for $10, and the rudimentary micros can be $2 or less. Regardless of the status of this project, I would advise you learn about them. Pick up an arduino and play around with it. You'll learn a lot.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
I may have to do that. Maybe over winter break when I get some free time!
 
Joined
Feb 1, 2008
Messages
2,894
Points
0
Hell. If you can use discreet FFs, counters, and DACs, you'll think micros are a godsend.
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Hah. Probably =p Well, contest is over. But doesn't mean this won't get put to good use. Just need to get the funds then to get one of them diodes.
 
Joined
Jun 22, 2011
Messages
2,431
Points
83
Awesome project! I might have voted for you if you had posted this earlier :/

Would you mind sharing the specific components you used, specifically the linear regulator? I'd like to do something like this but using a pot instead.

@Cyparagon: the problem with PWM is that it doesn't make the low power modes eye-safe(r). If there's a way around that please let me know, I'd love to do an Arduino controlled laser!
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
That's the one part I will have to keep a trade secret =p Usually I wouldn't except it's very similar to a part I use for the BlitzLinear, and that I do want to keep secret.
 
Joined
Jun 22, 2011
Messages
2,431
Points
83
You (or if you don't like the idea, someone else) should make a commercial variable power driver. It'd have an internal pot to set max current and an external one to vary the power. The host would probably have to be specific to support this, with a hole for the pot handle.
 
Last edited:




Top