Merging Two Circuits - Page 1
Forum section: electronics / beginners

author: bumba000
author_rank: Regular Contributor
timestamp: October 27, 2016, 11:39:38 pm
content: Hello All,So I have another thread called "How to Fet" which covers the first (flasher) circuit shown below. The second circuit shown below is something that I just built to put into a handy little box. It is my selectable dimmer. One LED array is red and the other is white.I would like to join the the flasher circuit and the dimmer circuit, but there's a problem.In the flasher circuit the LED arrays must be joined A+ to B- & A- to B+ . However, the dimmer circuit requires A+ to B+ and then A- to switch and B- to switch.I have not been able to discover way to join them so that the wiring is this way in case 1 and the other way in case 2.I have another toggle not mentioned in either schematic that will let me power either the dimmer or the flasher, but this still doesn't straighten out my wiring issue.I figure a couple of mosfets would do the trick, but then would fail because of the reversing polarity on the flasher circuit. I'm at a loss. Please help.Thank You,John

author: Brumby
author_rank: Unknown
timestamp: October 28, 2016, 12:41:58 am
content: There are a few things that are wrong with what you've posted.For starters, that's the worst way possible to connect multiple LEDs. Current sharing is voltage dependent - and LEDs are well known for having slightly different voltage drops. Your arrangement will guarantee uneven brightness. You also don't have current limiting resistors in place. This will result in the very early demise of you LEDs. Try something like this:Also, you have the 555s wired up in a way that I have never seen before. I can't see how they could work. **** EDIT: Just checked your other thread - and it seems they do work. I must sit down and step through it sometime...The other thing is I'm not very clear on exactly what you want this circuit to do - so before we get into the nitty gritty of circuit design, can you please describe the operation you want to achieve. What is flashing; what frequencies are involved; what the dimming is meant to affect.Understanding what you want to achieve in the end is what we need to know in order for anyone to give you some concrete suggestions.EDIT #2 - The dimming option could be as simple as my following post ... if that's all you are after.

author: Brumby
author_rank: Unknown
timestamp: October 28, 2016, 01:15:51 am
content: Just looking at the brightness control question - if you only want 2 brightness levels controlled by a single switch, you could do something as simple as this....If you have a group of red LEDs and a group of white LEDs, the common dimming resistor I've shown might need to become two resistors (one for each group), switched by a DPST switch.

author: bumba000
author_rank: Regular Contributor
timestamp: October 28, 2016, 02:06:39 pm
content: Hey Brumby,I have the dimming working just fine using a variable resistor and mosfet. I do have resistors in place I just really didn't feel like adding them to my example. So my dimmer can switch from red to white with a toggle then dim and bright with the variable resistor.The other circuit using the two 555's works great as well. I have replaced R2 and R3 with variable resistors to add some flexibility in flash and strobe. It's really pretty cool.Now I want to connect both circuits to the same two LED arrays. The trouble is that the 555 circuit needs the arrays connected one way and the dimmer circuit needs connected to the LED array in another way.I don't know how to better explain. I need a way to alternate power routing.

author: Ian.M
author_rank: Super Contributor
timestamp: October 28, 2016, 03:04:12 pm
content: Scrap your existing dimmer circuit and PWM the L293D enable pin 1.2EN (pin 1)Seehttps://www.eevblog.com/forum/beginners/pwn-dimmer-with-ne555-and-mosfet/for how to generate a PWM with a 555 and for many of the pit-falls.The enable pin would connect in place of the MOSFET gate. The PWM frequency needs to be a lot faster than either of your existing 555 oscillators - somewhere in the 100Hz to 200Hz region is probably a good place to start.

author: bumba000
author_rank: Regular Contributor
timestamp: October 28, 2016, 03:48:04 pm
content: Funny. I'm pretty proud of that there dimmer circuit. Funny again is that my next project was to be PWMing with the 555. Strange how one thing leads to the next. Ok, so I'll be looking into this approach. Now when using the PWM for dimming I would also want to have the ability to select whether to power the white or the red LED array. Will this be possible? I'm not asking you to layout the circuit, just a hint should get me moving in the right direction.Thank You,John

author: Ian.M
author_rank: Super Contributor
timestamp: October 28, 2016, 04:24:56 pm
content: Selecting between the white and red arrays is most simply done by a switch between the L293D and the arrays however if you want full independent control of the red and white brightnesses, read on:The L293D has two separate full bridges in it each with its own enable pin. If you build a second 555 PWM generator you could drive the3,4EN enable (pin 9) with it and connect the red LED array between the 3Y and 4Y pins leaving the white array on 1Y and 2Y. Parallel 4A to 1A and 3A to 2A so they can be driven by your existing 555 flashing circuit.Result: two knobs for red and white brightness respectively, with all other behaviour the same as your existing effect.

author: bumba000
author_rank: Regular Contributor
timestamp: October 28, 2016, 05:06:02 pm
content: Ian, I'm at a loss. I do not mean to insult you by questioning you, but how would a switch between L293 and the LED array's work?Here's the board I made for my flasher/strobe. You can see there are four outputs. Two make a pair and the other two make another pair.For proper function A-LED anode and B-LED cathode are connected to A-Output-1 while A-LED cathode and B-LED anode are connected to A-Output-2. If I added a switch to the output it would enable or disable both arrays. I would need two switches, one for each array.I have the flasher/strobe kicking ass. I like it. My goal was to add the selectable array and dimming ability.

author: Ian.M
author_rank: Super Contributor
timestamp: October 28, 2016, 05:25:11 pm
content: 3 position 2 pole rotary switch wired to select between red, both and white. One pole in series with each colour. If you get a 4 position 3 pole switch, the extra pole and position could be used in the feed to the whole circuit for on/off.Your board already looks to be using all the L293D outputs If you lift pins 1 and 9 of the L293D and hook them to separate PWM generators, pin 1 will control the lower output pair and pin 9 the upper.

author: bumba000
author_rank: Regular Contributor
timestamp: October 28, 2016, 08:35:28 pm
content: If I understand you correctly and I understand the L293D just a bit, I would figure that this will not work for dimming as the L293D is either on or off and nowhere in between. So I can only imagine then that if it does work it's really dimming by tricking the eye ball. By which I mean that the 555 PWM would be turning the L293D on and off at such a rate that the LED's would appear to be dimmer.Correct?Thank you,John

author: Ian.M
author_rank: Super Contributor
timestamp: October 28, 2016, 08:55:49 pm
content: Yep. That's how all PWM LED dimming works, including the commercial stuff.Breadboard the PWM dimmer I linked to without the MOSFET, connect a simple 30mA LED with a series resistor to allow 25mA current between Vcc and the discharge pin and experiment till you have confidence in PWM dimming and know what's the minimum frequency you can live with.

author: bumba000
author_rank: Regular Contributor
timestamp: October 29, 2016, 01:16:11 am
content: Okay. So I see how this will work. I also see a problem. The problem being that if I fire up the L293 that's already in my circuit, the 555's will also fire up as they all get power from the same location and are all traced there. Sorry to keep going over this, but I'm really trying to understand and I think that I'm getting somewhere. I'm thinking that I can use the same L293 that's already there, but would need to add a 555 and two variable resistors. The problem is that I see this turning into a crazy hack job and the first two 555's are going to be turning on when they shouldn't be.I think that if I want a tri-function device I should design it that way from the start. This just happened to be two different projects that in the end sounded like a great idea to join in a small easy to carry box. So I'll go to modifying my original circuit to include the upgrade.For now I've dug up one of my first projects. The sound card oscilloscope and I'm off to play with this PWM business.Thank You Very Much,John

author: Ian.M
author_rank: Super Contributor
timestamp: October 29, 2016, 02:18:19 am
content: I thought you wanted combined flashing and dimming? If so, as I said before, you'd need to lift the Enable pins of the L293D and feed in the PWM signals.Do you have a spare unpopulated PCB? If so, assemble it with twoCMOS555 chips, no timing resistors and no L293D. You'll need to add jumpers on the back of the board to tie the CMOS 555 RST pins high. You can also omit the regulator and tap 5V from your assembled board. You'll also need two pots and four diodes, preferably low leakage Schottky, but ordinary 1N4148 will do at a pinch Take a pot and solder the steering diodes direct to its end tags, with the common leads (one A ,one K) twisted together in mid-air. Wire from the pot wiper and from the common leads of the diodes to the active pads of the timing resistor footprint. Repeat for the other 555. If when you test it you find the brightness increases anticlockwise, swap the wires to the pot.Try 100K pots and 100nF timing caps - that should give you a PWM of around 120Hz.Wire the PWM outputs (Vd and Vg at the unpopulated L293D footprint) to the enable pins you lifted of the L293D on the original board and you should be good to go. Its only 4 wires between the boards + 4 to the off-board pots so it shouldn't be too ugly.If you are good with an Xacto knife you could even isolate pins 1 and 9 without lifting them, reinforcing the remainder of the track past pin 1 with a piece of wire, then drill extra holes next to them for the PWM wires. Lead the PWM wire through the new hole and solder to the pin pad, or better - use press-fit PCB pins, jumper to the LM293D pin pad, solder the wire on top-side and lock the PCB pin in place with a small drop of epoxy applied with a toothpick.If you wanted to add a non-flashing mode, you'd need to override the outputs from the existing 555 chips to the L293D. You could simply ground Reset, to force the output low or Trigger+Threshold to force the output high, but that's a lot of extra wires and switches so it would probably be better to redesign the whole board.You soon reach a point where if you've got any programming skills at all, its better to use a MCU - e.g. an ATmega 328P programmed with an Arduino bootloader, as then you can do stuff like sequential mode selection with a single switch, or making one pot (or better, a panel mount quadrature encoder) adjust several different settings depending on what you selected with the mode switch.

author: bumba000
author_rank: Regular Contributor
timestamp: October 29, 2016, 08:22:51 am
content: Oh yeah I know this could easily be done with with a tiny duino for sure. days ago. done. I'm still polishing up my programming there, but have been coding for years. I just really have been interested in analogs. Mostly what I've learned so far is I've a lot to learn. Like really understanding the 555 for example would help a lot. I'm working on that now.So, what this has turned into is that I want selectable red or white with dimmer. I also want the flashing/strobe.I think I'll take the design I've made and lay it out on a breadboard and then make the modifications you've suggested. Once I have it running I'll layout and etch a new board. Hopefully I don't come up with another feature I'd like to add.I did build up the Dave CAD #2 minus pin 7 and driving LED from 3 as suggested by you. It works great. I did find on my own about switching the diodes at the pot resulting in LED on with the pot turned in opposite directions. I have two 10nF and a 10k pot now. I've change the original 100 to the recommended 10, and then tried several others. 1,2,47.., I've also tried 1k and 1m pots. The best I can get is with OMG I forgot, I'd have to go out and look. I think it's the 10nF's and the 10K I can get about 12kHz max.It's late. 4:30am. I'll have look tomorrow, but 12kHz is the best I got. Dimming the LED works great though!

author: Ian.M
author_rank: Super Contributor
timestamp: October 29, 2016, 08:59:46 am
content: Using too small a pot is hard on the 555. The only limit on the charging/discharging current right at the ends of the track is the residual end resistance + the resistance of the diode+ te output impedance of the 555. Lower resistance pots tend to have lower end resistances and if its under about 100R its getting into the zone that's not so good for the 555. The only thing that saves the day is the very low duty cycle. If your pots have very low end resistances, you should probably stick a resistor in series with the wiper chosen to limit the max current to 50mA. For 5V Vcc that would be 100R.You shouldn't push the frequency too high when there is a significant load on the switching device (whether that's the L293D or a MOSFET). Higher frequencies increase the switching losses. For LED dimming anywhere between a couple of hundred Hz and 1KHz is good.