Maker Pro
Maker Pro

Brain storming layout for safety lighting circuit. Help.

Hello,
I am as new as they come and need some suggestions or recommendations. I have a machine which I would like to install a 12-30vdc @ 1730ma led bar to. I need to control the light bar based on 2, 28vdc inputs supplied by the machine itself. The light bar (pre manufactured) has red LEDs and white LEDs which can be lit independently. It has a 3 wire setup, 1 neutral and 1 power line for each color. Anyways there are a few combinations of the supplied inputs that I want to use to determine how and when the lights come on. I would like to use a microcontroller to do this not just simple relays. I plan on using some type of avr chip (for fun of programming). So my first thing I need to figure out is what is the best way to take a 30v 1800ma input and drop it down to something a microcontroller can handle like 3v or so. Could this be accomplished with a solid state relay over a traditional mechanical relay? If does anyone have a suitable part model?
 
Hello
A voltage regulator would be needed to drop the voltage down to say 3.3 Volts to power the micro. You could then use a logic level MOSFET to switch on the LED bars.
Thanks
Adam
 
Sledgehammer and walnut eh.... lol.

If you can be more specific about the switching arrangement we may be able to suggest a simpler solution but if this is an exercise to develop programming skills then, hell yeah.... why not?

As above - it's fairly straightforward to drop the supply to the required 3.3V but I'd do it in two stages to minimise the power dissipation in the regulators - say a 12V regulator followed by a 3.3V (or 5V, depends on the system used).

If you build the 'system' as a black box with a power feed input and a few 'open connection' (i.e. isolated) outputs you can connect whatever you desire and modify the black box operation to your hearts content. The outputs can be standard relay contacts or solid-state versions but interface units for the Arduino, consisting of a set of controllable relays, are very readily available.

The use of the Arduino and 'standard' i/o modules also means you will have access to the various control 'libraries' (software) to make interfacing easier.
 
Thanks for the suggestions. I guess I'll be looking through some data sheets to figure out which regulators to use. When I create my circuit diagram I'll post it here to see if I've made any mistakes or if it could be done better. This is sort of a attempt to develop some programming skills but also it is a system to provide safety lighting within a complex machine. One last question though, for the outputs from my microcontroller I'll need them to be around 24v at 1800mA so I'm assuming no microcontroller will be able to do that. Could that be done with say a step up transformer or is there a better component? I haven't figured out which microcontroller I plan on using yet so I'm not sure of what the capabilities will be. Thanks again.
 
Arouse1973,
If the logic level mosfet will be able to give me the output I desire disregard my last question. I'm going to do some research on those to see for myself. Thanks again.
 
Sledgehammer and walnut eh.... lol.

If you can be more specific about the switching arrangement we may be able to suggest a simpler solution but if this is an exercise to develop programming skills then, hell yeah.... why not?

As above - it's fairly straightforward to drop the supply to the required 3.3V but I'd do it in two stages to minimise the power dissipation in the regulators - say a 12V regulator followed by a 3.3V (or 5V, depends on the system used).

If you build the 'system' as a black box with a power feed input and a few 'open connection' (i.e. isolated) outputs you can connect whatever you desire and modify the black box operation to your hearts content. The outputs can be standard relay contacts or solid-state versions but interface units for the Arduino, consisting of a set of controllable relays, are very readily available.

The use of the Arduino and 'standard' i/o modules also means you will have access to the various control 'libraries' (software) to make interfacing easier.

What exactly do you mean by black box with power feed input? I've taken your suggestion and have gone out and acquired some regulators to step the voltage down in 2 stages and I'm able to power a simple attiny45 (not enough I/o pins for my final setup though) with a basic program loaded onto it which is great. But I realize that in the end the controller will be receiving or reading 3 separate inputs which will be coming in at 28vdc or 0v. And the outputs will be 3 separate outputs supplying 24v or 0v. I'm not to worried about the outputs because I've scavenged some small relays that can handle the load I'll be putting on them and pull in at about 3vdc which will work fine. So my question is will I need to use separated regulator setups for each input and for the circuits power? Or is there a way of filtering everything with one set of regulators?
 
Input signals can be derived from simple voltage divider resistors so long as you design it so the input falls within the micro minimum/maximum on/off levels.
 
So what is the benefit of using regulators over voltage dividers with resistors or vice versa? One must disapate heat better or be more efficient then the other, no? I know there are always multiple options but what would be better if enclosed in a small plastic box?
 
Besides I kind of need to use regulators. I was looking at the input voltage sources today and they vary from 22v to as high as 28v. I can't find any information on YouTube about what I'm looking for so I guess individual regulators is what I'm going to have to do. Thanks anyways.
 
Use a series resistor and a zener diode (rated at 3.3V or 5V depending on the logic level you need) at each input.

The zener will clamp the input voltage to the chosen level regardless of the input voltage and be capable of handling anything up to 100's volts if that should occur.
 
Thanks for the suggestion. I'll have to test that out. My only concern is that the circuit I'm creating will need to be duplicated and installed on about 9 separate machines and the input voltages vary for 22-28v so I'm thinking this might not be the best option as my resistor values will need to vary in order to get the voltages down to an acceptable range for the zener diodes. I don't yet know anything about zener diodes so I'll have to research whether the input to them needs to be exact or if they can handle the potential 6v swing they might encounter....nevermind I just re-read the last post and see it's saying the zener can handle the varying voltages. So I'll just have to do a little research and test it out. Thanks again.
 
the input voltages vary for 22-28v so I'm thinking this might not be the best option as my resistor values will need to vary in order to get the voltages down to an acceptable range for the zener diodes.
no you won't.

Given that the input port of the micro has an almost negligible current requirement all you need concern yourself with is having sufficient current flowing in the zener to maintain regulation (5mA??) and changing the input from 20V to 30V means dropping 15-25V (for a 5V output) at 5mA which equates to around 3k to 5k. Use the lower value, rounded down to the nearest E12 series (2k7) and the max dissipation in the zener will never exceed the 500mW of most small package versions.
 
I have an assortment of zener diodes coming to me this week so I'll be able to test this out. I am still just trying to figure out all the components I plan on using and how they work so I haven't developed a full circuit or schematic for it yet. Also trying to figure out how to program the microcontroller. From what I can tell so far I'll be using an atmel tiny84 to control everything. I've been able to get some simple programs loaded onto one and now I'm working out my own code. Once I have a better idea of how I plan on putting it all together I'll post the schematic and ask for some feedback about it. This forum has been really useful so far, I'm glad I found it.
 

hevans1944

Hop - AC8NS
@Mig192: You appear to have three separate, but not necessarily unrelated, problems: (1) provide power to a microcontroller; (2) provide capability of sensing, using bit-input ports on the microcontroller, signals from external equipment, said signals being either off (0 V DC) or on (22 V to 28 V DC); and (3) provide a means, using bit-output ports on the microcontroller, to control the two LED light bars that you specified to require 12 V to 30 V DC at 1730 mA.

It appears from some replies to your original question, that those responses assume you will power the microcontroller from a 22 V to 28 V DC supply, perhaps to be derived from the external equipment the LED lamps will service. This is almost never a good idea. The real world is hostile to microcontrollers, and hostile to digital logic in general. Microcontrollers and associated logic should be powered separately from the equipment to which it is interfaced, and the interfaces should be galvanically isolated from the microcontroller and any "glue logic" you may need. You should choose a microcontroller FIRST, determine what power it requires, and only then finally plan to provide that power independently from whatever microcontroller interfaces are required.

Most microcontrollers will happily operate from a 5 V DC supply, typically obtained from a "wall-wart" fixed-voltage power supply. Almost any "wall-wart" will do. If it provides more than 5 V DC, use a three-terminal regulator to bring its output down to 5 V or 3.3 V or whatever voltage the microcontroller needs. As suggested in post #3 by @kellys_eye, you can cascade two of these to drop from a higher voltage down to an intermediate voltage and then finally to the microprocessor operating voltage. You would do this, if necessary, only to remain within the input-to-output voltage limitations of a particular three-terminal regulator. Cascading regulators distributes the power dissipation but does not decrease the power that must be dissipated (thrown away) to bring a too-high supply voltage down to the desired level. I prefer to purchase, or design, a power supply for the microcontroller I will use and set that up first. This allows me to proceed with programming without necessarily having all the peripheral components that will eventually be interfaced to the microcontroller.

You can even use a "wall-wart" that provides only an AC output (usually through a step-down transformer) with only a little more effort: just add a full-wave bridge rectifier and a "smoothing" capacitor to its AC output, ahead of the three-terminal regulator. Whichever method you choose to power the microcontroller, it's power supply remains independent from the equipment interfaced to the microcontroller. There are several very good reasons for doing it this way, the most important being that it helps protect the microcontroller from the real world, which can get really nasty if someone accidentally faults an input signal line to a 220 VAC power distribution line. Stupid happens, but you should try to anticipate it and prevent further damage with conservative design.

All this then leads right into problems (2) and (3), or how to interface the microcontroller to the real world.

Typical microcontroller bit-input ports require binary (on/off) signals that vary between zero volts and perhaps three to five volts maximum, depending on the microcontroller, but as @kellys_eye noted in post #14, the inputs are relatively high impedance and do not require much current to assert a valid logic-level input. Although a series resistor and a shunt zener diode attached to each input will work, I think it is overkill and it does not provide any galvanic isolation of the input to the microcontroller. Unless you require the ability to sense very rapid cycling of the input states, more rapidly than several hundred thousand times per second, it is a good idea to optically isolate each bit-input with an optocoupler. These consist of an LED illuminating a photo-transistor, all sealed together in one plastic package, typically a 4-pin or 6-pin DIP. Two external components, a resistor to limit input current to the internal LED and a shunt diode to prevent reverse-biasing of that LED, or to allow operation with AC inputs, are all that is necessary to accommodate any voltage, AC or DC, you care to provide for bit inputs. Sometimes you may need a "pull-up" resistor on the photo-transistor collector to provide a well-defined logic-one level for input to a bit-input port on the microcontroller, although many microcontrollers provide this resistance internally connected to Vcc as a "feature". Check the datasheet of the microcontroller.

Typical microcontroller bit-output ports provide binary (on/off) signals with limited current and voltage capability. These outputs should also be isolated from the real world, but here the choices are many. As you suggested in post #6, a small sensitive electro-mechanical relay will suffice, but this severely limits the rate at which you can cycle the output on and off. It is also prone to "wearing out" since it is a mechanical device. I would suggest using each output bit to drive the optically isolated input of a commercial off-the-shelf (COTS) solid-state switch. You can build-your-own as a DIY project, but this does require more design and construction effort, for which you can find help here if needed. Low voltage microcontrollers may require a "boost" in their output voltage to reliably actuate a COTS solid-state switch. You can easily do this with a small-signal NPN transistor "driver" such as a 2N3904.

The same optoisolators used for galvanic isolation of the input signals can also be used for galvanic isolation of the output signals. For that application, you drive the optoisolator LED with the bit-output of the microcontroller and use the photo-transistor to control a relay, or to drive a power transistor.

Some of your questions indicate a lack of understanding of basic electricity and/or electronics. You can certainly learn a lot of things NOT to do by trial-and-error, but that is a pretty expensive way to learn. A better approach might be to develop some schematics of what you are really trying to DO and post them here for comment and/or advice. Better yet, find a mentor to help you. I have found that a hands-on approach, combined with adequate knowledge of theory, is an excellent way to learn. Your mileage (or kilometers) may differ.
 
Hevans1944,
Yes I do lack an understanding of electronics and only have an working knowledge of electricity from situations that I deal with at work. It would be great to find a mentor but with my schedule my location and life in general I probably won't be able to. I'm starting an associate's program for EET in December and I'm sure that I'll unf@#$ myself then. Until then I'm going to keep learning...the expensive way. Every time I post something I get a couple of different suggestions which are all good I suppose. I think maybe you're right though, I should probably try to lay out a circuit and show exactly what I'm attempting to do. I can understand your recommendation to keep the controller isolated from the equipment it's controlling I definitely fear a mistake being made and burning my circuit up. I am limited to what I can do though, the circuit will need to be mounted inside of an electrical enclosure on an injection molding machine. I have alot of power coming into it but I wanted to use the 24v power supply that powers the IPCs I/O cards. My only other option really is a small transformer which has a tap that could provide 110vac but I don't want to mess with that transformer because of it's location in the enclosure being extremely close to very large (700vac) disconnects and in case of trouble shooting or tracing wires later on. I'll do my best to create a schematic for what I'm trying to do and post it in the next couple of days. Thanks for your input you've given me alot of knowledge.
 
Last edited:
Top