555 T-Shirt: http://www.zazzle.com.au/classic_555_timer_chip_schematic_circuit_t_shirt-235193027808469926
Hacking the Mantis Elite microscope to control the LED brightness with a 555 PWM circuit.
Forum Topic: http://www.eevblog.com/forum/blog-specific/eevblog-392-555-led-pwm-hack/'>http://www.eevblog.com/forum/blog-specific/eevblog-392-555-led-pwm-hack/
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
Hacking the Mantis Elite microscope to control the LED brightness with a 555 PWM circuit.
Forum Topic: http://www.eevblog.com/forum/blog-specific/eevblog-392-555-led-pwm-hack/'>http://www.eevblog.com/forum/blog-specific/eevblog-392-555-led-pwm-hack/
EEVblog Main Web Site:
http://www.eevblog.com
EEVblog Amazon Store:
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/
Hi. In a previous video, I reviewed this mantis 3D microscope and I complained that the LED brightness wasn't adjustable on it and for the price, well, it damn well should be. Um, so I wanted to, uh, actually take a look at that and uh, see if it can be modified if it has any internal regulation circuitry or anything like that. So um, as it turns out, it's pretty easy to uh, take this sucker apart I'll switch it off here and uh, it this uh top cover here just pops off and then we've got a little diffuser thing for the LED and let zoom in a bit more and on this we've got.
this whole assembly just comes apart here. Nice, nicely screwed in with metal uh, threaded inserts and everything. And bingo there's the PCB Um, there'll be one on each uh side here and check this out. it's just got a little DC jack on there.
you can just pull that off. Very nice, nicely engineered, and there's the all the metal threaded inserts. It's really quite a nice design and as you can see, the LEDs are around. They're in a circular fashion angled at a you know they' engine it at a very specific angle.
so the uh diffuser plate sits in there like that and it's all angled like that and it's very beautiful. I like it. but look at this, there's no circuitry on there at all. it's just dropper resistors.
That's it. So uh, I'll uh measure the rest of it uh to make sure it just comes through from the but I think it's just uh directly from the 9volt plug pack, straight through a drop. a resistor for each? LED So too easy to modify this thing. Um, to use Um, Pwm? uh to get uh, the brightness adjustment or you don't even need Pwm? you can just use an LM 317 linear regulator or something and it looks like those little plastic Clips There, They're like sort of those molded in type, so I don't really want to break the board out there.
So I'll just measure these resistors and can do that just fine. Bang 82 Ohms, there you go. So all they do, all they're doing is uh, just driving this directly from the 9V Source I think Okay, so what I'm going to do is I'm going to measure the Uh to see if there's any internal circuitry in here or whether or not the 9volt Jack just passes uh, straight through. So going to get I've got this plugged in here I've got the ground here and no, no, it doesn't.
Hey, all right now I think there's the uh interet DC jack uh, switch on there. So you've actually got to plug the thing in so that cuz I can't believe the ground's not connected. So it must be. Yep, there you go.
So that ground is connected straight through to there. Now all we need to do is check the center Jack on that and the center pin here and what do we get? Aha Well, there's something 6 Meg lets I suspect Is there a diode in there? perhaps? let's whip that around and have a look There we go that looks like a diode drop, but it seems to be in the wrong direction. so I'm not sure what's going on there. There is definitely something in there though and I cracked it open and yeah, look what we have here. We have an LM 31 s in here and also you can see the uh spring as well going all the way up that uh shaft up there. That's how it gets. its nice, uh retention, uh system. very nice spring.
I like it and uh, it's attached to there. it's um, insulated. It's got a Uh Little Seal pad washer on there. so uh, but they're using that as a heat sink and um, LM 317.
So I'm curious to know if that's a um, just like a voltage regulator or a constant current or set up as a constant current Source Well, of course it's uh, got to be a constant current Source because there's only two wires coming in and out of this in the positive Supply there. so it goes through the switch into it and then out to the Uh LEDs So they've got this thing set up as a constant current source and then there you have it folks. Now we could have uh uh, you know, discovered all this without um, taking off that heat shrink but that would have been no fun. But there you go.
it's an Lm317 constant current Source They got total of 2.5 ohms. so 1.25 volts divided by the Uh, which is the reference voltage of the Lm317. Uh, divided by the 2.5 Ohms is around about 500 milliamps constant current. So we've got 24 leads in this thing.
So um, assuming that they're evenly spread across all the Uh LEDs we should be looking at about 20.8 milliamps per lead. Let's measure that and see if we get it. Now, we've already established that these resistors are 82 ohms each. So assuming the current is shared across all of them equally, it'll be roughly something like that.
Then for 20.8 uh, milliamps per lead, where expecting times 882 ohms, we should get about 1.7 volts across each resistor. So let's have a look. Tada There you go, There you go. 1.7 So it looks like the current is pretty evenly shared across all these.
Not entirely spoton, but fairly well shared across all these Led. There you go. So these things are operating at about 20.8 milliamps per lead. So how do we go about dimming this thing? Well, obviously cuz we have access to the uh circuitry in here Now we can add our own uh stuff in there.
but I mean that's that's quite nice. But anyone who wants to, uh, mod this thing themselves it? it's not that great. They have to actually crack this thing open so it's probably better to put something in series with this lead here so you don't have to modify anything on your Mantis at all. So anyone should be able to do this and add the mod in or remove it as they need to.
so that's a better way to do it. But this is a constant current output. so it's given us half an amp constant current. So we need a Uh circuit in here to dim these leads and uh, well, we can do that with Pwm.
So let's lash up a quick little circuit and see what we can do. and there's plenty of ways to do this. but well, why not use the classic triple 5 timer? You can get a triple 5 timer to do a 0 to 100% Pwm fairly easily. So what we got here is I'm going to use a triple 5 timer here in the Pwm configuration. this is my Dave CAD drawing Pwm Lead Dimmer. It's a classic uh triple 5 circuit and there's not much to it at all. We've got our input over here and our output here and now because this is a constant. usually you don't do this with a constant current Source um on the input here, but it should still work I think so you know normally this is just a voltage source and you um and then you would uh just pwm the output.
Then you choose the dropper resistor based on and we could do that. If we ripped out the Uh circuitry, we could just have the 9vt source and then we could calculate. Well, we could actually uh, put a a voltage regulator in there, calculate what voltage is required to give the same maximum current of 20.8 milliamps per lead that we had before or 500 milliamps and ah, you know it's all too hard so we want to leave in that constant current source. So I Think this circuit will still work even though it's constant current because we're just switching the constant current off and on, off and on instead of the voltage.
Now, this is the classic Tri 5 Pwm configuration. We've got an adjustment pot here which adjusts our Um pulse width modulation Uh value from roughly 0 to 100% It's not going to go over the entire range, but it's going to be pretty close. and we've got two Uh steering diodes here and the Uh and you know it's quite a basic configuration. Now, how this circuit works is pretty simple.
Uh, when you first power it on, this capacitor is going to be a short circuit. so the trigger pin is going to set this output High here and the output PMP transistor will be switched off. Because we got a high Here, we got a high here. This transistor only switches on when this output pin goes low, so the output goes high.
So the Um LED is starting switched off and then we're going to charge up this capacitor through this 1K resistor here, through this diode and through the and through the pot here. So the pot is going to set our Um frequency as well as our Uh Pwm cycle and then once it reaches the threshold Bingo we're going to switch the other direction and then our discharge pin is going to discharge that capacitor through the other diode there. Easy, because if you remember our Triple 5 circuit configuration, I Got my Triple 5 timer t-shirt which you can get from my Zazzle store. By the way, I Handrew this.
It's how the Trip 5 operates and you can see that the Uh output here when the output switches it is a flip-flop So the Notq output turns on the discharge transistor here and that's exactly what we have in the circuit configuration and this will uh come important later. I Think for a variation on this circuit. so I've got my circuit buildup on the breadboard here matches this precisely except for one thing. Um, Lab's a bit of a mess and for the life of me I couldn't find a 1 4148 diode to go in there, a 1 in 914 or whatever signal diet you want to use, So um I had some leads handy just sitting here on the bench. So I used two LEDs instead of the two Uh signal diodes there, it's going to work exactly uh, the same or it should. Um, and except, uh, it's going to change. It's going to alter the Uh frequency, but we don't really care. Um, we just want to get this thing working.
so that's the breadboard build up. I've got the Um BD 136. Uh, PMP output power transistor here because we're talking about half an amp. So you've got to choose a transistor here which has an adequate continuous collector current in it and this is like a 1 and 1/2 amp uh, transistor, so it should handle that fairly decently.
A 470 ohm uh. base resistor here should give us enough current to drive that output at a half amp. Well, there only one way to try it. Let's give it a go and here we go using those values I had here.
I Going to turn my pot here. Got a 10K pot and well, it starts down here and you'll notice we're getting a duty cycle of a maximum 8.8% Now this is the output on pin three of the triple 5 timer and you'll notice that it changes Pwm all the way up to 99.6% duty cycle. So that's not bad at all. now now.
Uh, unfortunately. um, because we're using the PMP output transistor configuration here, this is actually going to be inverted. so this will be our on period. So um, really, we, we're not getting close.
Well, we're going to be uh 8 or 9% down from our 100% on period. So it's going to be on for only, you know, 91% of the time or something like that. So we're not going to get absolute maximum brightness out of this thing. but that's okay, not a problem.
and I've got my I'm just pairing this from the bench Supply By the way, this is not uh, coming from the um, uh, constant current uh source of the Mantis that's the next step I'm powering it from about 6 volts at the moment I can drop it down with 2 volts per division there. and as you can see I mean the frequency is going to change. We were what 300 htz before I get down to to you know 5V power supply 5V Supply there and we're looking at 40 htz or something like that. go up to 6 vs.
and it changes. The you know is this thing is not stable in terms of uh frequency. but for our purposes it doesn't matter and we can go up like if we go up to 10 volts, 12 volts something like that, we're still going to operate over. so 99.7% to 99.2% So our minimum or our Max maximum cuz we're inverted drops there at 12 V So anyway, we're this thing is going to be working at uh, less than 9 Vol so it should work over that range quite nicely.
So let's hook this up to our constant current source and see if it still works and we can dim our leads. All right. First of all, let's take a baseline here. So I've got my Uh mantis plugged into the existing 500 milliamp. Source I've got my light M here and I've turned off my uh main LED lights above me just so it's You know, the ambient doesn't uh, interfer it with it that much, but we just want to get a ballpark. We want to see if this circuit gives out um, pretty much uh, close to the maximum and then dim. so our Benchmark there is about 1630. LX So uh, let's plug this circuit in series with that and see what we get.
And here we go. I've got it. uh, bodged into to it there. so I've got it in line and uh, we're getting.
We're not quite getting the maximum there as we expected because the uh Pwm isn't uh, going to 100% but maybe we have to tweak our base resistor there so that's maximum on the pot. So if I adjust the uh, adjust the pot, look at that. There we go that dims quite nicely. fairly linear with the uh turning of the pot.
So let me I'll show you the show you the pot here. So and then it switches right off at the bottom there 177 lucks turn it on. That's pretty nice I like that I think we have a winner. It doesn't quite go to the maximum Lux we'll getting before.
so I'm going to uh Drop That Base resistor a bit I've got uh four 70. Let's get a uh, here we go a 220. Let's give that a go. So let's go from 470 to 220.
Ohms and see if we can hello 16 So we're getting it's a little bit better. Bumped something here so we're getting 1500 Lux out of that thing. Let's plug the original mantis back in. Yeah, 1,600 so we're only losing 100 Lux there.
Not a big deal. So with our values in this circuit, we're operating from 733 Hertz It jumps up a bit, jumps all over the place as your adjusted duty cycle down to a low of 310 Hertz So 300 Herz to 700 HZ or thereabouts. Um, with our constant current Source Not a problem. I Mean we don't particularly care about the frequency that's uh, uh, much higher than um, any, you know, flicker, that's going to be a problem.
so no drama. And if you're wondering what the current output waveform looks like, the output waveform is Channel One here, the yellow one, and uh, the green Channel 2 Signal here is the out is the Uh pin 3 output the kill output of triple 5 timer flip-flop. So let me adjust the uh so let me adjust the pulse width there and uh, As you can see as I said before, it's actually uh, inverted because we're using a PNP transistor there. So we're going from, you know, like, down under a percent there to right up to well, you know, close to 98% So that's pretty good.
I'm pretty happy with that, and if you're curious to see how. Charging Discharge Charge Waveform: I.E Uh, Pins 2 and six. It's the bottom waveform there and the top one is our pin 3 Q output. So you can clearly see that uh, 0.1 microfarad cap charging up there until it hits the Uh threshold value.
and then the Uh discharge pin kicks in. uh, shorts to ground and that, then shorts out the cap and bang. It goes back back like that and it oscillates. That's how the Triple 5 works. now. we can't just leave it at that. I Think this thing has got too many components and I think we can get rid of one. so I've got another circuit here optimized and you'll notice that the differences between them aren't Well, there's only basically Spot the Difference We've removed this 1K resistor up here, but we've swapped pins three and seven like that.
So now the discharge pin of the Triple 5 timer here is uh, turning on our P&P output transistor here and then our Uh Q output of our triple 5 timer is doing the uh charge and discharge because we don't need that pullup resistor anymore in there because um, the uh, cuz we did need it before because the discharge pin is an open collector uh output so it doesn't have it's not a totem pole output so it doesn't have anything to pull it up. so we need the 1K to pull it up. But the uh pin three of the triple 5 timer. the Q output is not an open collector output so we can do away with that pull-up resistor.
So we've just optimized the circuit there and we've got gotten rid of one resistor. Let's try it. So this is circuit number two. We'll leave it here.
so let's just, uh, modify that so we'll there's our pin 7even pullup so we'll get rid of that and wheel. Uh, this base resistor here has to change. That's got to go over to Pin. Hang on.
this is going. This is going to get messy, but so we want our LED on pin three. Let's just switch this thing off, shall we? for a second. And so we want that through the pin three and other diode through to pin three.
It's working well with these LEDs Not a problem and we want our base resistor, the transistor to go up to pin seven up there. So we've gotten rid of our one resistor, we've optimized that out. Let's hook this thing back up and give it a go. Heyy, it is still still working.
Our Lux meter is Switched Off Our Lux meter is still reading. Oh, it's reading. what's it reading? There we go. We're up to, 1600 Lux and we're going all the way down to there you go.
Not a problem. so let's take a look at those waveforms again and see what. Duty Cycles We get that should be near identical. All right, let's have a look at the output.
We're measuring the duty cycle of the uh of uh input two now, which is our top waveform which is is our Pin 7 discharge pin. and if we adjust our Pwm value, we're going down to 0.3% Brilliant. Smoothly. Once again, the frequency does change, but whoop-de-doo all the way up to 99.2% Lost our trigger there a little bit, but there you go.
just get a more accurate value of the maximum. There you go, it's close to 99% Ah, this works really quite well. I like it 3% to 99 greater than 99% Terrific. So just why were we able to swap pins three and seven? Well, here's the discharge pin here, and as you can see, it's the Q. It's the not Q output of this RS flipflop and the regular output is just a buffered version of the Q output. So really, these are just going to be complimentary outputs, so there's no in this Uh particular circuit configuration. There's no problem with swapping these two pins, and by virtue of doing that, we managed to save a resistor Beauty So there's our final circuit uh, the base resistor there around about 220 ohms I'm using a 10K pot, I'm using LEDs in there, but we can just use regular uh, signal diodes if you want, it's still going to work just DET treat Um, 100n. uh.
timing cap here I'm just putting on a 10n compensation cap there. you don't necessarily. uh, have to do that. It might still work.
Um, and of course, there's a bypass cap across the Uh rail there. but that's all there is to it. And the BD 136 has plenty of grunt to drive. Uh, the 500 milliamp constant current leads in this thing.
and no, it doesn't really get wared or so. There's no power dissipation issue use there, and the whole thing works. A treat over the whole Uh duty cycle range. Very smooth, very linear.
really. Um, in terms of the pot, I'm using a linear pot. by the way. I'm not using a logarithmic one.
Um, and it works just fine. So all that's uh, left to do is build this thing up and put it in series as a permanent fix. and I'm actually using the Seos version of the triple 5 the LMC Tri 5 here. But yes, it is a Gen.
you're a national semiconductor. And yes, just to add a little bit of authenticity, it is greater than 20 years old. 52nd week 91 Nice. Now let's have a look at what it's like when it's completely assembled again.
I've got both LEDs lighting down uh, nice and evenly. and we're getting basically 4,500 Lux or thereabouts cuz that's a Time 10 range. So oh, you know, 4,000 Yeah, let's say 4,500 Lux Got my board built up here ready to go. It's not uh, uh, heat, shrunk or anything or any case or anything yet.
so let's plug it in and bingo, we're getting 4300 Lux is that maximum? that's adjust the pot here. There we go. look at that from 5 500 lucks. And now for the big test.
Does it actually work through the viewfinder? That's maximum there. I've got uh, constant exposure on my camera and I'm turning the wick down, turning it down and it's a little bit little bit touchy at the bottom end there. but uh, certainly. we have a very nice adjustable range now.
I Like it. Let's put our board on a 45 angle there and uh, adjust our light all the way down to pretty darn low. I like it. I mean it's actually brighter than that in through the viewfinder? That's just my uh, the constant exposure mode I've got on the camera there.
I mean if I turn constant exposure off, there we go where? uh, I've turned all the way down and the camera is still going to compensate so turned all the way up constant exposure again and turn it all the way down. Beautiful. It's a nice smooth linear range. there's no flicker on the camera. Ah, perfect. What a win! So that was just a quick, uh, simple hack there on some Vera board. Not a problem. There's the uh, output connector, which, uh, it helps to if it's a a right angle one like that going in.
and there's the uh input socket and the adjust pot. now. I can mount this in some sort of case or I'll probably put some large heat shrink over it or something like that. and I don't know.
um, maybe cable tied up in or up in place? I don't know. There's a few options for uh, mounting the thing in line, but you want to sort of keep it as short as possible I think and just have it dangling there. Really? I mean you know it's not often that you have to, um, adjust this thing, so really, if it just hangs there, that's fine. So yeah, I will just heat shrink that? There we go.
No problems at all, that'll give it a nice reasonable protection. and maybe I can cable tie the thing in place or something like that, perhaps. and I'll do a second heat shrink pass on this thing so that it, uh, seals in the pot and the pot just sort of mounts on the side there like that and that'll hold it in place nicely. I think so uh, you know it'll just angle there.
it's I can put a knob on it, but uh, you know Frills who cares? and it could be mount in a nice box or something like that, but there nothing wrong with just a bit of heat shrink like this and maybe some hot snot as well some hot milk glue in various places. but there you go. I Think that is, uh, quite a nice little solution. I Like it.
and there's the finished mod I've just got it. uh, cable tied up in there and it just sits there. Really quite nice. It's all hidden out of view.
I Can just reach around and adjust the brightness as required. That works an absolute treat. I'm pretty darn happy with that simple hack. Yeah, could have been done better, but don't mind that at all.
So there you go. If you've got a mantis, it's well worth doing this mod to get variable brightness on your LED It's really quite neat and you don't have to hack the circuitry inside, it's just using the constant current Source straight in Beauty If you want to discuss it, jump on over to the Eev blog. Forum If you like the hack, please give it a big thumbs up. Catch you next time.
that diode placement makes no sense to me
Any ideas to use a 0 to 5v potentiometer to dim RGB without messing up the color mix?
I am expirimenting with a PWM fan controller for testing, but if I'm thinking right for the final install I may be able to use the Pam signal from the factory computer that is controlled by the dimmer knob.
Modify it to boost converter with led Driver and constant current source
You can always save this pull-up resistor in 555 timer astable multivibrators by using its output pin to control charging and discharging of the capacitor. You can also save the base resistor by use of a p-channel MOSFET for switching of the LEDs also from the output pin.
How can you make a VOLTAGE-controlled PWM ?
THANKS MUH
What would be the best way to control the pulse width using a microcontroller? Would the pot have to be a digital pot in order to work properly or can a microcontroller DAC simply output a voltage to this circuit somehow?
lol u said give the camera a reach around.. :p sry.. idk where tf that came from lol :p im certainly not prude but i usually try to keep it respectable
i noticed the transistor had casing molded around the back of it, does that ever interfere with the grounding? like do u ever have to sand them to get a more reliable connection? or am i totally wrong about that even.. does it Not also ground thru the back? i know, random ass question.. im just curious
the plugs inside a device that shouldnt ever normally come apart seem kind of strange
Dreat educational project and demo of making a PWM circuit from 555. Many thanks.
Doesn't that 9% minimum duty come from 1k resistor in series with charging diode? 1k/(10+1k) is exactly 9%
LEDs should be driven with constant current. PWM is an abomination and an assault on the senses. Shame.
Very good. I like coming of pin 7 . Used that pin in a simple 555 time base circuit on a very simple scope and a 0.1 out from the transistor.
.
After 8 years,
Youtube:watch this boy….😁
Nice, simple solution. A fancier solution might use a logarithmic pot, since the human perception of brightness is more or less logarithmic.
Hi Dave, why don't you use a mosfet instead of the PNP transistor?
You should connect a 1k resistor between those two diodes opposite to trimmer. I built the circuit on breadboard and it works fine but when i made it on pcb as a prototype, my smd 555 chips worked good for several minutes and then stopped working. I blew 2 chips and then i searched some formulas, and came to know that the capacitor on pin 6 is getting charged through the resistor, diode and potentiometer and discharging through the diode only directly to ground through an inbuilt transistor on pin 6. Due to very low resistance on the discharge path, when the duty cycle is at maximum, the capacitor is discharging in a very short time and a lot of current is flowing through inbuilt transistor which will eventually blow the chip making it unusable. I dont know how long the dip version of chip lasts with this circuit but the smd chip will blow instantly. So add a 1k resistor in the discharge path!!!
I think Mantis did 317 on purpose to supply stable current. remember old microscopes having bulbs? being relativly slow those can be PWMed without light flux pulsing. Don't get me wrong, pulsed leds are great for torch lights, but in my opinion they are bad for microscope backlight.
Can we make buck or boost circuit with feedback using two 555 ic. Please reply
Hello Dave
I love your videos! Great work!
I have a question. I’d like to build a circuit that lets me turn on a 12V 20W light bulb immediately to 100% duty cycle. When turning it off, I’d like it to slowly dim down from 100 to 0% duty cycle over a time of about 30 minutes. So to say a soft stop. Would you have an example of such a circuit? Thanks much in advance
Hi. I have a question
how can i use the LM555 too get a square Wave on the output with a music sound input and adjustable speed. Thank you 👍
Does it work with 50V output?
555 is such a versatile chip
Can this chip NE555 use to drive a mosfet for the backlight circuit in a led tv? If your circuit can be used, what would be the output to connect to the gate of the mosfet and what value gate resistor?
I think I should say it’s a Chinese tv but the PWM chip is defective so I just want to direct drive the mosfet for the backlight.
12V peak to peak 145Hz and 50-99% ?
Super dave….no doubt
$3,370. One has to be making money with that to justify the cost. Nice unit.