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

Hmm... Multimode DIY Driver?

Joined
Jan 14, 2011
Messages
3,816
Points
63
With the advent of more and more DIYers, people have even started to create their own buck/boost drivers, either by hand-soldering it all together in a bundle, etching their own PCB, or using something like DorkBot to fab the board and then just populating it from their design specs.

Finding the right buck and/or boost ICs isn't that hard, most of the big PM manufacturers like Linear, TI, ON, they all have sections specifically for buck and/or boost ICs.

But... what about multimode drivers? What kinds of ICs are used in those? The trouble I am having is just trying to get a conceptual idea of *how* lightly tapping the power button will give a different input to the IC that makes it switch modes. And how does one program modes?

Anyone? I'd love to have a new idea to toy around with (would also make designing drivers for interesting projects much easier).

So does anyone know of any simple, multi-mode capable ICs? Or at least a way so that you can build separate drivers for different tasks, and have one IC that chooses which driver the input is linked to?
 
Last edited:





Joined
Sep 12, 2007
Messages
9,399
Points
113
I assume a charged capacitor starts draining when power is shut off. If the next time you turn power on, it checks for a charge in the capacitor. If there's still a charge, it switches modes.
 
Joined
Jun 12, 2011
Messages
292
Points
0
Well if you look at our once beloved NJG driver,or any of DX multi-mode drivers the heart of the chip is a Micro controller usualy a PIC from http://www.microchip.com/en_US/family/8bit/index.html

However you could do it with any micro controller, be it a ST, ATmel, PIC, TI MSP series, just so long as its package was the correct size for your design.

NOw onto how it tells modes, this is just a theroy but I'd say its a pretty sound theroy.

Whe nyou turn on the driver and the chips code starts to run it sets a space in EEPROM (Electronicly Erasable Programmable Read Only Memory) to a variable called Mode, then it runs an equation something like Mode = Mode + 1; so now that theres a 1 in that memory location that won't be erased if power is lost, and lets just say the code looks like->

if (Mode == 1){ then
output = low (90mA)
}
this code is pretty close but it typed wrong, I simplified and explained things, eitehr way though if the code reads a value of 1 in the variable Mode it will set the output to 90mA, if it is NOT a value of 1 it will go do something else.

So then lets say you turn it off then back on, guess what it runs that Mode = Mode + 1; again, so now you have a value of 2 in the variable mode, and since the variable Mode no longer equals 1 it skip over the above if code and lets jsut say if comes across this code->

if (Mode == 2){ then
Output = Medium (300mA)
}

this is exactly the same as above but now instead of limiting the current to 90mA it limits to 300mA, then you just keep repeating these if then statements for as many modes as you want or untill you run out of code space, or you're unable to get a difference in settings.

So to give you an idea, in the case of using an arduino as a test bed, your code would look like-> (this is gonna be VERY simplified, since i don't know how to do eeprom stuff yet on arduino)

char eeprom var Mode;

Mode = Mode + 1;

void Loop(){
if (Mode == 1){
Output = low;
}
if (Mode == 2){
Output = Medium;
}
if (Mode == 3){
Output = High;
}
if (Mode == 4){
Output = Strobe;
}
if (Mode ==5){
Mode = 1;
}
}

There would be other stuff from here down but thats a little more complicated, but basicly you'd just use the ADC pins to read the voltage across a current sense resistor, then you'd use some math to adjust and regulate teh output current.
 
Last edited:
Joined
Mar 1, 2011
Messages
610
Points
0
Now I have never even touched one of these or seen one in operation (the computer at work has all those video and picture sites blocked !) but the basic operation seems to be a simple enough concept to me.
Don't think of the "switch" as a typical method of applying the power. Think more like it being a key or touch sensative pad that you use to cycle through pre-programmed steps.
You only provide the impulse to a small computer chip or circuit that actually does all the controlling of the power cycles and such.
The drawback to this type of set-up though, is that the monitoring circuit (the one that detects when you push the button) is always using a small portion of the power available. Even when the unit is "turned off." So there will always be some small current drain from batteries.
Yet another example of the growing number of modern devices that consume power all the time and get the title of "power leech." Even when off, they are on.(only a little but still on.)
But of course I may be completely wrong about it.
Anybody want to give me something for free to learn more with ? :evil:

Dammit ! I hate when somebody else posts while I'm typing in my opinion !
 
Last edited:
Joined
Jun 12, 2011
Messages
292
Points
0
See here's what I'm talking about with a PIC the chip on the right with the M logo

7882-deae6379-614b-4c31-92cd-35b7b5fcb6b7.jpg
 
Joined
Mar 26, 2010
Messages
3,220
Points
0
The way it works in the NJG-18 is the MC is is turning on/off a transistor in the diode current path. What the 'modes' really are are PWM rates, or 'on-off' patterns (sos, etc). Such a method wouldn't work well with a microboost type circuit that can't handle being separated from the load though. This works with the NJG-18 because it's a CV driver and not a CC. Trying this with a CC driver will just lead to dead diodes/drivers.

Though as far as your mode switching, That would be fine, but it would change modes every time you turned it on if you wanted something self contained like the NJG-18. My guess about the way those function is that there's a cap that will run the micro just long enough through a power cycle to run the mode changing code if power is reapplied before it times out (or dies)
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Hmm... so we aren't talking basic, "programmable" ICs anymore, are we? I really need to get into microcontrollers... but I have no theory in my electronics knowledge nor have I taken any classes. Maybe after I buy my 589 I will buy an Arduino Uno so I can get some practice with microcontrollers before I build my own circuits.
 
Joined
May 4, 2009
Messages
5,443
Points
113
Micro chip makes some pretty small units that can be programed to do what ever you want them to do, like control a laser diode driver :D
 
Joined
Jan 14, 2011
Messages
3,816
Points
63
Unfortunately, I don't have access to the Engineering College's courses, at least not until next semester. And even then, I will probably have to take intro to electronic engineering. Will be a while before I learn how to use a MC.
 
Joined
Mar 26, 2010
Messages
3,220
Points
0
Actually, if your doing buck only, a uC controlled driver is fairly straightforward. All you really need is a transistor in the current path to do the regulation, being driven by the uC.. A boost circuit is something else entirely though.
 

3zuli

0
Joined
May 30, 2009
Messages
810
Points
28
as previously said, the modes work by modulating (switching on and off) the current limiting part of the driver. this modulation is usually provided by a microcontroller.
btw, microboost HAS modulation input and can be modded to accept TTL input (try searching "microboost ttl blanking")

how about this code (simplified)?

Code:
int currentmode, prevmode; //stored in eeprom
int mode; //not in eeprom
int main()
{
  prevmode++;
  mode=currentmode;
  switch (currentmode)
     case(1): pwm = low;
     case(2): pwm = mid;
          //etc.   
  currentmode=prevmode;
  delay 2000; //wait 2sec
  currentmode=mode;
  while(1) {}
}

there are several good threads about this @ CPF and BLF
Build a Basic uC 3 Level Led Driver - A Tutorial
How To Build a Flashlight With Perfect Modes (picture heavy) | BudgetLightForum.com
 
Last edited:
Joined
Jun 12, 2011
Messages
292
Points
0
^^^ I suppose that would buy why use 3 variables when you can just use 1 variable, considering the amount of code space and variable / eeprom space on some of the smaller chips using 3 variables seem a bit inefficent plus you have to keep track of 3 instead of 1.
 
Joined
Mar 26, 2010
Messages
3,220
Points
0
Microboost has modulation input, but flexdrives don't. Though I can't remember if flexdrives can tolerate open circuits though.
 

3zuli

0
Joined
May 30, 2009
Messages
810
Points
28
flexdrives can't handle that.
@kmor: that was my try to memorise the mode while the switch is pressed (and power is turned off). I'm not an IC programming expert, but I know that you could use a small capacitor and use ADC or comparator to watch the voltage (like this:)
Code:
int mode; //stored in eeprom, eeprom pre-programmed with value 0
int main()
{
  switch(mode) 
      case(0): pwm=high;
      case(1): pwm=mid;
            //etc.
  while(1)
  {
    if(ADCinterrupt)   //if ADC voltage is below 2.7V
         mode++;      //next mode and store the new value in eeprom
  }
}
feel free to optimalize that :)
 
Last edited:




Top