The Output Stage
The output stage is fairly simple.
For three wire output, power is always applied to the output via the common wire and the control wires are grounded out when they are triggered. This allows multiple outputs to be safely wired together if needed. In most cases though, simply all three wires will be wired from the output to the switch. The resistors R21 & R24 used by two wire switches are optional, but can safely be installed if the circuit might be used both ways.
For two wire output, the output resistors R21 & R24 are required and also help limit how much power is available in two wire mode. The two switched lines are used to connect to the switch, the common is not used. Power is left applied via the resistors and depending on which side is grounded will run the switch as needed. Negative voltage is never actually applied, but voltage reversal is achieved by switching moving the ground.
Hight Current vs. Low Current
The circuit is designed to use either high current TO-220 MOSFET's or Transistors, or low current TO-92 MOSFET's or Transistors. On my circuit design, holes for both are available, but you only populate one of them. The high current parts are required for running relays but can handle the low current switches as well. The low current parts should only be used if only low current is required and you need to save money. If you have both parts sitting around, or the board might be used for different purposes, it's recommended only the high current parts are installed.
Care needs to be taken when installing the MOSFET's and even Transisyots. Some devices are Reversed for the pinout versus the case. Because of this, I did take the time in my design to mark the Gate/Drain/Source on the TO-92 pins since those are the ones most likely to be reversed.
For really high current or constant output usage, space had been provided for some small heatsinks on the TO-220 cases. I designed the circuit board layout for 6A continuous current and 10A surge. If higher current requirements are needed, you need to reinforce the power and ground runs from the power connector(s) to the the high current MOSFET's and optionally the outputs. The heatsinks and air flow over them will start becoming important at this time.
Under normal usage with switches, even high current 12V ones, heatsinks will not be required, even if running in a hump switch yard. Tests have been run with this circuit switching a heavy duty ConCor style switch a full cycle every 7 seconds for 10 minuts and the relay gets hotter then the 20A MOSFETS. The same test burns out an Atlas Snap Switch within several minutes.
MOSFET's vs. Transistors
While the circuit is designed for with, it is recommended that MOSFET's be used for high current systems and either can be used for low current. In my tests, I was very satisfied with using 20A or greater MOSFET's for high current, they ran cooler and no heatsink were required even under high usage. You're more likely to to damage the relays before they they will have problems.
If transistors are used with relay type switches D1 & D3 are required. With MOSFET's they are used only if really large coils are involved or if high usage is, they are optional.
Diodes D2 & D4 are required for any relay or coil device to prevent damage. IF you have any doubts, just put them in. The only time you won't need these is only tortoise type switches are being used or it you are running non-coil or motor type loads, like lights.
Output Voltage and Current
By default, my circuit uses the same power to run all sections. It is designed that only two runs need to be cut to isolate the power of the output stage from the rest. That is the only time you need to add the power connector that is part of the output stage unless an extra connector is desired.
Plenty of capacitors can be added. Please make sure that they are rated for more then the voltage applied is. If a relay type switch with a good high current MOSFET or Transistor won't switch, that usually means the the power supply can't handle it. Adding more capacitors helps offset weak power supplies.
During testing a 2A 12VDC supply was used to run 3A relays simply by adding several 1000uF capacitors to help handle the surge required by the relay. Several different hole spacings were even supplied to allow for a variety of capacitors that a hobbyist may have on hand. Just watch the Voltage and Polarity when installing them!
Output schematic
Updated ...
Doing even more testing with additional devices and scoping my circuit, I've decided that when MOSFET's are used for the output stage, the resistor to the gate works better with a value as low as 100 ohms. The original 470 ohm value had been selected because of the transistor option and that value was already used. The 100 ohm value for the MOSFET driver helps get everything moving when you have sub-optimal situations, which can happen easily.
Saturday, June 18, 2011
Wednesday, June 15, 2011
Timing Section
The Timing Section
The timing section is responsible for the pulse widths output as well as protection from both outputs being on that the same time.
The jumpers JP8 & JP10 in the first half are responsible for either treating the controls & outputs individually or as pairs. If they are both in the pins 1-2 RST position, everything is treated as paired inputs and the Reset inputs on the 556 timers are connected to the other input before pulse shaping. That means that zero or one side of the timer can be active at the same time. If the jumpers are both in Pin 2-3 positions, the halfs are isolated from head other and can be operated independently. This is useful if you want to control something else other then relays, such as lights or motors.
The timing is handled by R8+C3 and R15+C12. Usually both sides have the same values. If the pulse-shaper is in use, this controls how long the output will be on. If the shaping has been disabled and output follows input, this controls the switch debouncing to smooth the output. For relay/snap type switches, values of 2M ohm andd 0.10uF work very well to drive the relays for 2/10ths of a second. Changing the capacitors to 10uF makes a handy 20 second timer for tortoise switches to make sure they have made at all the way to the other side even if only a pulse was received on the input. The last thing you want is a switch halfway between positions!
For debounce only, the timing can easily be reduced by changing the resistors to lower values, even going as low as 100k-200k to get 1/100th - 2/100th's of a second debounce to reduce the obvious lag when the switch is turned off.
Capacitors C5 and C13 are optional and simply help make sure the timing stays more consistent. C9 simply helps get rid of power noise and in most cases isn't needed either, but a good practice to put in.
Since U2 is a 556 timer, that is a limiting factor on the lowe voltage power. 16V is it's max rating, which means the input and timing stages should normally be powered by 5V to 15V DC. It it important not to go over 16V! That's why I will repeat myself again later and mention that you can cut two runs to isolation the output power from this section and supply different power to both or install a 7812/7815voltage regulator and diode between the two!
Even when running in output follows input mode, it's recommended to use the 556 timers since even switch bounce. But when in that mode, you can drop the timing to a much smaller value by reducing the resistors. When pulse shaping is being used, you must ensure that the timing will make sure the switch travels to the other side!
Optional, easily bypassed
If timing isn't needed, we can easily bypass this by not installing the 556 timers and pulse shaping components, jumpering around the pule shaper, and then jumpering the 556 input to output. This turns the curcuit into on inverter, meaning that a low signal into the opto-couplers turns on the output stage, but is useful as a voltage or current converter.
I would encourage leaving the timer section in unless the inversion is required just for the sake of gaining the debounce capability of the timer.
Timing Schematic
The timing stage of half the circuit is shown below. A complete schematic will follow at the end as well.
The timing section is responsible for the pulse widths output as well as protection from both outputs being on that the same time.
The jumpers JP8 & JP10 in the first half are responsible for either treating the controls & outputs individually or as pairs. If they are both in the pins 1-2 RST position, everything is treated as paired inputs and the Reset inputs on the 556 timers are connected to the other input before pulse shaping. That means that zero or one side of the timer can be active at the same time. If the jumpers are both in Pin 2-3 positions, the halfs are isolated from head other and can be operated independently. This is useful if you want to control something else other then relays, such as lights or motors.
The timing is handled by R8+C3 and R15+C12. Usually both sides have the same values. If the pulse-shaper is in use, this controls how long the output will be on. If the shaping has been disabled and output follows input, this controls the switch debouncing to smooth the output. For relay/snap type switches, values of 2M ohm andd 0.10uF work very well to drive the relays for 2/10ths of a second. Changing the capacitors to 10uF makes a handy 20 second timer for tortoise switches to make sure they have made at all the way to the other side even if only a pulse was received on the input. The last thing you want is a switch halfway between positions!
For debounce only, the timing can easily be reduced by changing the resistors to lower values, even going as low as 100k-200k to get 1/100th - 2/100th's of a second debounce to reduce the obvious lag when the switch is turned off.
Capacitors C5 and C13 are optional and simply help make sure the timing stays more consistent. C9 simply helps get rid of power noise and in most cases isn't needed either, but a good practice to put in.
Since U2 is a 556 timer, that is a limiting factor on the lowe voltage power. 16V is it's max rating, which means the input and timing stages should normally be powered by 5V to 15V DC. It it important not to go over 16V! That's why I will repeat myself again later and mention that you can cut two runs to isolation the output power from this section and supply different power to both or install a 7812/7815voltage regulator and diode between the two!
Even when running in output follows input mode, it's recommended to use the 556 timers since even switch bounce. But when in that mode, you can drop the timing to a much smaller value by reducing the resistors. When pulse shaping is being used, you must ensure that the timing will make sure the switch travels to the other side!
Optional, easily bypassed
If timing isn't needed, we can easily bypass this by not installing the 556 timers and pulse shaping components, jumpering around the pule shaper, and then jumpering the 556 input to output. This turns the curcuit into on inverter, meaning that a low signal into the opto-couplers turns on the output stage, but is useful as a voltage or current converter.
I would encourage leaving the timer section in unless the inversion is required just for the sake of gaining the debounce capability of the timer.
Timing Schematic
The timing stage of half the circuit is shown below. A complete schematic will follow at the end as well.
Sunday, June 12, 2011
Input Stage
Now to start going over my design in detail that I have been testing ...
Input Stage
The main input control signal is either a two wire or three wire signal accepting 4V-16V by default.
For three wire input, J2 handles one pair with the common between the two signal inputs and JP1 & JP2 are both jumpered 2-3 in order to feed each signal into the optocoupler U1. For two wire input, only pins 1 & 2 are used on J2 and JP1 & JP2 are moved to pins 1-2 to feed the signal to both optocouplers, but reversed in the second on.
By using a DC optocoupler and the jumpers the +/- voltage for a two wire is handled by different circuits without having to add anything else fancy.
The voltage input range is adjusted with the input resistors (R1-R4). The default value of 470 ohms allows enough current to flow for 4V to 16V range easily, and it can safely handle a 24V signal. If digital input over long wires is planned, these resistors can easily be lowered to 300 to 330 ohms. If ONLY digital 5V signals are planned, they can go as low as 220 ohms, but 12V signals should be avoided.
The LTV-847 optocoupler is shown as U1, but multiple LTV-817's or LTV-827's can be used. I do find it's simpler to work with a single chip, but allowing for different parts allows populating from 1 to 4 inputs as needed.
The 'Common' jumper JP3 is used to connect the common lines between the two half's of the circuit so that the second half does not require a common line to be connected. It can even be convenient to use the second common as an output to another board if desired! The reason the jumper is there instead of hard wired is that some two wire circuits reverse the +/- lines instead of using a common and a +/- voltage. If the were hardwired together you could short out the two sets of signals and maybe ruin your power supplies or worse.
One-shot or Constant?
For one signal line, JP6, C4, and R10 decide if a single pulse coming in goes to the timing stage or the actual signal. By shorting out the capacitor that actual length of the signal seen on the input is forwarded on, otherwise the capacitor changes it to a pulse no matter how long the signal is left on. Note that that optocoupler circuit with the pulse-shaper inverts the signal so that the rising edge of the input causes a falling edge into the timer as needed by the 556 timer. If no pulse shaping is ever needed, the parts can be omitted and a simple jumper installed instead.
One last option...
If the input needs to be wired directly to switches and no external voltage applied, the input resistors and U1 and be replaced by jumpers as long as you also jumper it to three wire input mode. Then a ground is applied to the common line and voltage goes out the signal lines. When you throw the switch, the signal line is grounded out and the high-to-low can be seen by the pulse shaper and to the timing stage. When wired this was, the pull-up resistors like R9 can be increased in value safely. The 1K ohm value is there to ensure a nice crisp signal from optocoupler into the pulse-shaper.
The Input Schematic
A cleaned up version of 1/2 of the input stage is show below.
Input Stage
The main input control signal is either a two wire or three wire signal accepting 4V-16V by default.
For three wire input, J2 handles one pair with the common between the two signal inputs and JP1 & JP2 are both jumpered 2-3 in order to feed each signal into the optocoupler U1. For two wire input, only pins 1 & 2 are used on J2 and JP1 & JP2 are moved to pins 1-2 to feed the signal to both optocouplers, but reversed in the second on.
By using a DC optocoupler and the jumpers the +/- voltage for a two wire is handled by different circuits without having to add anything else fancy.
The voltage input range is adjusted with the input resistors (R1-R4). The default value of 470 ohms allows enough current to flow for 4V to 16V range easily, and it can safely handle a 24V signal. If digital input over long wires is planned, these resistors can easily be lowered to 300 to 330 ohms. If ONLY digital 5V signals are planned, they can go as low as 220 ohms, but 12V signals should be avoided.
The LTV-847 optocoupler is shown as U1, but multiple LTV-817's or LTV-827's can be used. I do find it's simpler to work with a single chip, but allowing for different parts allows populating from 1 to 4 inputs as needed.
The 'Common' jumper JP3 is used to connect the common lines between the two half's of the circuit so that the second half does not require a common line to be connected. It can even be convenient to use the second common as an output to another board if desired! The reason the jumper is there instead of hard wired is that some two wire circuits reverse the +/- lines instead of using a common and a +/- voltage. If the were hardwired together you could short out the two sets of signals and maybe ruin your power supplies or worse.
One-shot or Constant?
For one signal line, JP6, C4, and R10 decide if a single pulse coming in goes to the timing stage or the actual signal. By shorting out the capacitor that actual length of the signal seen on the input is forwarded on, otherwise the capacitor changes it to a pulse no matter how long the signal is left on. Note that that optocoupler circuit with the pulse-shaper inverts the signal so that the rising edge of the input causes a falling edge into the timer as needed by the 556 timer. If no pulse shaping is ever needed, the parts can be omitted and a simple jumper installed instead.
One last option...
If the input needs to be wired directly to switches and no external voltage applied, the input resistors and U1 and be replaced by jumpers as long as you also jumper it to three wire input mode. Then a ground is applied to the common line and voltage goes out the signal lines. When you throw the switch, the signal line is grounded out and the high-to-low can be seen by the pulse shaper and to the timing stage. When wired this was, the pull-up resistors like R9 can be increased in value safely. The 1K ohm value is there to ensure a nice crisp signal from optocoupler into the pulse-shaper.
The Input Schematic
A cleaned up version of 1/2 of the input stage is show below.
Friday, June 10, 2011
Parts sources
While it may seem strange to blog about getting your parts, there are some very obvious things that many hobbyists might forget about in their enthusiasm in getting their parts.
How many do you need? Now and in the future? For some common parts, getting more at one time to cover current and future needs buying in bulk can change who your supplier is as well as the price. Different sources can have widely different prices for the same or comparable prices. Since I'm limiting myself to through-hole components and trying to stick to a small number of values for things like resistors and capacitors, I can be willing to buy some extras for future use, lower the cost per item, and be less concerned with wasting a few. Some resistor values for example are so common that I got 1000 at a time from Digikey so they cost less then a penny each. For some IC chips, tube qty's from Avnet can make sense. But, in some cases, I did go straight to eBay . Don't assume your favorite supplier is the best deal, look at quantity discounts, and try to think ahead!
Don't forget about Shipping, Handling, and Minimum Orders! Of course, shipping varies greatly. Some places include shipping in their pricing, which is good only for one off items. Others won't ship via certain methods or will take a long time to be delivered. Take into account when do you really need the items, try to order as much as you can from one source at a time, and watch the weight & shipping costs of your orders. Digikey for example will ship light weight items via USPS if you want, saving you shipping costs on smaller or light weight orders. Others have minimum shipping costs, so if you must get from them adding a few more items to your order adds little to no extra, saving you more money. In general unless shipping is prepaid (as some eBay items are), the more you get from a source in one order, the cheaper the shipping per item becomes. Being a hobbyist, I tend to have my things shipped the cheapest method, so I've worked to bundle my orders from one source together and looked at what else they have to offer that also makes sense. Don't be afraid to deal with the big boys like Avnet, Most of my UPS Ground orders from them only cost me $8 or so for shipping a fairly good sized bunch of parts. So far in the US, they have shipped to me from AZ so it's fairly quick even via ground.
Beware of eBay, and don't be afraid to use eBay! Sounds like I can't make up my mind eh? This isn't a buyer beware comment, but be smart as to how you use it. Some items on eBay may be used, cheap, or substandard, but in most cases this does is NOT a factor for hobbyists. Where you want to pay attention is the shipping costs and can you get it cheaper from a larger distributor in quantity? Plus, many of the parts end up being shipped from Asian inexpensively, taking a lot longer to get here. But, something simple and common can often be found cheaper from local suppliers and be delivered quicker! I've been able to get parts from Avnet and Digikey delivered in a week or less cheaply where my final costs were below eBay pricing before shipping. I'm actually close enough to Digikey that sometimes the USPS packages arrive the next day! But, in some cases eBay was actually cheaper if I was willing to wait the extra time! Shop around and compare! Sometimes I've found one item where in my qty & style I needed eBay was cheaper, then I looked at what else that vendor had and was able to expand my order with other things that wouldn't have made sense from eBay, except I was already ordering and I saved a bit on the shipping. Also, if you bought too many parts but they were cheap, try selling some on eBay to recoup the cost. While you may make little or no money on the part it helps reduce your losses and keeps the costs of your projects down.
Look at specialty sites! While many items may be more expensive from them, sometimes they have gems you don't expect. Other times they make suggestions on what should be used for specific projects or useful links. Spending research time can really prevent headaches while keeping the costs down.
Substitute! Hobbyists do this all the time and need to. Keep you mind open on parts and designs. In my current schematic I even realize that both low current and high current requirements exist and I'm making sure that either can be used and that substitution of parts will be easier (low power MOSFET's and transistors often have different pinouts or spacing from most high current parts, so in this case I actually have both in my schematic to help). Besides, hobbyists often need to use the parts they have on hand, which also affects everything else. In my designs I'm even placing multiple holes on the PCB layouts for some items such as capacitors to allow for easier substition or variance in the parts.
Over-spec the requirements & parts! Hobbyists have very flexible requirements and might use a design in unexpected ways. A few extra cents in savings isn't worth the effort while it might limit what you can do. Also, how well do you really know the full engineering load/design? I encourage everyone to be willing to allow for too much or extended optional uses when it doesn't significantly affect your costs. My current switch design is being tested with 20A MOSFET's when 2-3Amps is typical because the parts didn't cost much more and then they won't be getting as hot either and then I also don't need as much in the way of protection diodes since the MOSFET's integral diode is more then enough. Sometimes saving a few pennies can actually cost you more in effort or other parts. At least in my case I'm also testing with 5A transistors with the required diodes since hobbyists sometimes have to use the parts they have on hand.
Keep a Wish List! When you have an idea or see something interesting while you're searching around, make a note of it including source(s) and cost. That way later on when you are actually going to have to get parts you can make intelligent decisions, check your budget, and you might be able to get some of the optional stuff at the same time to save on shipping.
Budget! Know how much you can and are willing to spend and stick to it! Sometimes you just have to get the more expensive version of the part in a smaller quantity in order to not blow your budget. Don't get too carried away on saving money. If you really want the larger quantity at lower per part cost, take the time to put the money aside and wait until you can get it within your budget.This is supposed to be fun, don't cause yourself unwanted financial headaches.
Share with others! Know someone else that has some of the same interests and requirements? Maybe you can get together on your orders to get better pricing and shipping. My father-in-law for example sometimes needs some parts for his train set that he can't find in the local store, and ordering them online adds shipping. I was able to include some parts he needed that were heavier in an order I was already placing that was also heavier, but that saved him money on the parts and the shipping. In another case with a different supplier, he needed that some other parts and I was able to include some of my items saving me on shipping.
Make sure you don't fall into any ruts on what you are doing. Yes, you can default to how/where you do something, but at least take the time to verify that it's still the best way to get what you need. Bring a hobbyist sometimes means being creative on how you get what you need.
How many do you need? Now and in the future? For some common parts, getting more at one time to cover current and future needs buying in bulk can change who your supplier is as well as the price. Different sources can have widely different prices for the same or comparable prices. Since I'm limiting myself to through-hole components and trying to stick to a small number of values for things like resistors and capacitors, I can be willing to buy some extras for future use, lower the cost per item, and be less concerned with wasting a few. Some resistor values for example are so common that I got 1000 at a time from Digikey so they cost less then a penny each. For some IC chips, tube qty's from Avnet can make sense. But, in some cases, I did go straight to eBay . Don't assume your favorite supplier is the best deal, look at quantity discounts, and try to think ahead!
Don't forget about Shipping, Handling, and Minimum Orders! Of course, shipping varies greatly. Some places include shipping in their pricing, which is good only for one off items. Others won't ship via certain methods or will take a long time to be delivered. Take into account when do you really need the items, try to order as much as you can from one source at a time, and watch the weight & shipping costs of your orders. Digikey for example will ship light weight items via USPS if you want, saving you shipping costs on smaller or light weight orders. Others have minimum shipping costs, so if you must get from them adding a few more items to your order adds little to no extra, saving you more money. In general unless shipping is prepaid (as some eBay items are), the more you get from a source in one order, the cheaper the shipping per item becomes. Being a hobbyist, I tend to have my things shipped the cheapest method, so I've worked to bundle my orders from one source together and looked at what else they have to offer that also makes sense. Don't be afraid to deal with the big boys like Avnet, Most of my UPS Ground orders from them only cost me $8 or so for shipping a fairly good sized bunch of parts. So far in the US, they have shipped to me from AZ so it's fairly quick even via ground.
Beware of eBay, and don't be afraid to use eBay! Sounds like I can't make up my mind eh? This isn't a buyer beware comment, but be smart as to how you use it. Some items on eBay may be used, cheap, or substandard, but in most cases this does is NOT a factor for hobbyists. Where you want to pay attention is the shipping costs and can you get it cheaper from a larger distributor in quantity? Plus, many of the parts end up being shipped from Asian inexpensively, taking a lot longer to get here. But, something simple and common can often be found cheaper from local suppliers and be delivered quicker! I've been able to get parts from Avnet and Digikey delivered in a week or less cheaply where my final costs were below eBay pricing before shipping. I'm actually close enough to Digikey that sometimes the USPS packages arrive the next day! But, in some cases eBay was actually cheaper if I was willing to wait the extra time! Shop around and compare! Sometimes I've found one item where in my qty & style I needed eBay was cheaper, then I looked at what else that vendor had and was able to expand my order with other things that wouldn't have made sense from eBay, except I was already ordering and I saved a bit on the shipping. Also, if you bought too many parts but they were cheap, try selling some on eBay to recoup the cost. While you may make little or no money on the part it helps reduce your losses and keeps the costs of your projects down.
Look at specialty sites! While many items may be more expensive from them, sometimes they have gems you don't expect. Other times they make suggestions on what should be used for specific projects or useful links. Spending research time can really prevent headaches while keeping the costs down.
Substitute! Hobbyists do this all the time and need to. Keep you mind open on parts and designs. In my current schematic I even realize that both low current and high current requirements exist and I'm making sure that either can be used and that substitution of parts will be easier (low power MOSFET's and transistors often have different pinouts or spacing from most high current parts, so in this case I actually have both in my schematic to help). Besides, hobbyists often need to use the parts they have on hand, which also affects everything else. In my designs I'm even placing multiple holes on the PCB layouts for some items such as capacitors to allow for easier substition or variance in the parts.
Over-spec the requirements & parts! Hobbyists have very flexible requirements and might use a design in unexpected ways. A few extra cents in savings isn't worth the effort while it might limit what you can do. Also, how well do you really know the full engineering load/design? I encourage everyone to be willing to allow for too much or extended optional uses when it doesn't significantly affect your costs. My current switch design is being tested with 20A MOSFET's when 2-3Amps is typical because the parts didn't cost much more and then they won't be getting as hot either and then I also don't need as much in the way of protection diodes since the MOSFET's integral diode is more then enough. Sometimes saving a few pennies can actually cost you more in effort or other parts. At least in my case I'm also testing with 5A transistors with the required diodes since hobbyists sometimes have to use the parts they have on hand.
Keep a Wish List! When you have an idea or see something interesting while you're searching around, make a note of it including source(s) and cost. That way later on when you are actually going to have to get parts you can make intelligent decisions, check your budget, and you might be able to get some of the optional stuff at the same time to save on shipping.
Budget! Know how much you can and are willing to spend and stick to it! Sometimes you just have to get the more expensive version of the part in a smaller quantity in order to not blow your budget. Don't get too carried away on saving money. If you really want the larger quantity at lower per part cost, take the time to put the money aside and wait until you can get it within your budget.This is supposed to be fun, don't cause yourself unwanted financial headaches.
Share with others! Know someone else that has some of the same interests and requirements? Maybe you can get together on your orders to get better pricing and shipping. My father-in-law for example sometimes needs some parts for his train set that he can't find in the local store, and ordering them online adds shipping. I was able to include some parts he needed that were heavier in an order I was already placing that was also heavier, but that saved him money on the parts and the shipping. In another case with a different supplier, he needed that some other parts and I was able to include some of my items saving me on shipping.
Make sure you don't fall into any ruts on what you are doing. Yes, you can default to how/where you do something, but at least take the time to verify that it's still the best way to get what you need. Bring a hobbyist sometimes means being creative on how you get what you need.
Subscribe to:
Posts (Atom)