SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By angelsix
#72178
OK basically what I have is a unit that will run off a 24v trailer battery running at ~28v with engine running and alternator going.

The 28v comes in and steps down to 5v using a 78L05, with 10uF cap for input-gnd, and a .1uF cap on output-gnd for chip. Thats all fine.

Then I have 5 inputs going to the RA pins. These come from 5 28v supply lines again, stepped down using 78L05s. They are only ever used for 10-15 seconds at a time and are just switches that make/break the 28v supply. My question is, to save a lot of space for my board and design etc... do I need the input 10uF caps on these regulators for the switches as they are only stepping down to 5v for a few seconds at a time and are not powering the chip just used as inputs to detect a rise/fall on the input pins?
User avatar
By leon_heller
#72181
Why are you using regulators on each input to the MCU?

Leon
By n1ist
#72186
Resistor dividers with a clamp on the output is probably a better choice to translate 28v logic to 5v logic to feed the micro. Also, depending on the current you draw, a switcher is a better choicce than a linear regulator to drop that much voltage.
/mike
By angelsix
#72189
The only reason I'm using regulators is that I am new to electronics and thats the only component I know of at the moment to bring the 28 to 5.

Could you please explain a little more about the other 2 options what components/schematics are needed?

Also, the circuit will be drawing 5A on the 28v in before the regulator drops it to 5.

Image
User avatar
By leon_heller
#72191
That is a very silly way to do it. Use Mike's suggested technique, it will be a lot cheaper and simpler. It sounds like you need a grounding in basic electronics: get hold of a copy of The Art of Electronics.

Leon
By angelsix
#72192
What part of it is silly exactly? Presumably just the regulators? As the only other thing in this circuit is the mosfets which are needed and cannot be made simpler.

As for cost... can I really save that much with 78l05s costing £0.10 each? That means the other method must cost less than £0.60 to do the job? And either way like I said, can you elaborate on the suggestion, what you mean by it and what components to get... example would be nice or RS number so I can read up more.

And also, with the design I am using at the moment which works fine, can someone please clarify any potential problems of leaving out the input capacitors if any?
User avatar
By leon_heller
#72195
I've never seen anyone use regulators like that, which is why the design is silly. A voltage divider and diode clamp is the proper way, and will be much cheaper (2p for a couple of resistors and a diode costing 2p), vs a 78L05 and capacitors. You only need Ohm's Law to calculate the resistor values.

See the 78L05 data sheet regarding the capacitors. Most of them are stable with a 330n capacitor on the input.

You will probably need drivers for the MOSFETs - check the data sheet. The gates should have pull-down resistors, to stop them floating when the MCU is powered up.

You should have load capacitors on the MCU crystal, and the MCU supply should be decoupled. The 16F84 is obsolete and rather expensive, I'd use a 16F690; you won't need a crystal with that.

Leon
By noptical
#72227
angelsix wrote:What part of it is silly exactly? Presumably just the regulators? As the only other thing in this circuit is the mosfets which are needed and cannot be made simpler.

As for cost... can I really save that much with 78l05s costing £0.10 each? That means the other method must cost less than £0.60 to do the job? And either way like I said, can you elaborate on the suggestion, what you mean by it and what components to get... example would be nice or RS number so I can read up more.

And also, with the design I am using at the moment which works fine, can someone please clarify any potential problems of leaving out the input capacitors if any?
I think he meant that you using so many voltage regs is an overkill. also they dissipate too much power by dropping from 28v to only 5, which means you will need a switching regulator
By Philba
#72244
The silliness comes from using a VReg for signal conditioning.

The voltage divider and clamp diode will work although I would give strong consideration to a set of opto isolators as automotive environments are nasty.
By mako1138
#72275
IRF4905 is a P-channel device. The drain is connected to 28V? It's backwards in more than one sense. I assume the other end goes to a load? If you connect this to a load it will always be on, because the protection diode will be "on".

It would be simpler to use a N-channel FET, though I suggest studying a bit more about how these things work.
By angelsix
#72280
I'll read up on opto isolators also.

Still no clarity on this voltage divider/diode clamp.. I posted a post that has been blocked and awaiting moderation but I basically asked if vy a voltage divider you simply mean 2 resistors and the Vout coming off in between the 2, and doing that for all 5 inputs, so 10 resistors. And then no idea what this diode clamp is and cant find any info on it? This would mean 2 resistors at 7p and a diode would be well above the 12p for a reg.

I still fail to see the problem with using regs in thsi way. The other way seem to increase cost and add extra components for the benefit of power saving which really isnt a bother whatsoever on a trailer battery for 10 seconds. Could someone please clarify if I can leave the filter caps off the input lines for the sake of 10 second switches like I originally asked?

The P-Channel MOSFET is STD10PF06-1 and yes the load is on the side that goes to earth, and no it is not always on this is already a fully working board that has been in operation for weeks. I originally used an N-Channel MOSFET but clicked in when building up the prototype the load was on wrong side so an N-Channel wont work... correct me if I am wrong.

Final question, switching regulators? Why would I need switching regs on the input lines when they work perfectly fine witout to power the PIC chip? Or is it because I have 6?

Again thanks for all the help I am reading 2 books at present on electronics but I learn much more hands-on, so I like this method too. Hope I dont come across too arrogant or passive of the advice I am just very inquisitive and question things for understanding, not for doubting them.
User avatar
By leon_heller
#72284
If you are paying 7p for resistors, I'd change your supplier! Most people pay less than 1p for them!

1N4148 diodes should only cost you 2p or so.

This is a standard diode clamp circuit.
Code: Select all


In -------R1------------------------------Out
                              |
                              |
                              V
                            -----
                              !
                              !
                          +5V            
A second resistor to make a voltage divider might be a good idea in your application.

How does that increase the number of components and increase the cost?

Linear regulators are very inefficient when used with high voltage inputs, the excess voltage is wasted as heat. Switchers are very efficient and waste very little power.

Did you look at the 78L05 data sheet regarding the capacitors?

Leon
By angelsix
#72288
I use RS for resistors and they all cost 7 to 10p?

So for this resistor/resistor diode setup can I just use a 1k resistor as R1, a 150R as R2, and that diode 1N4148 (http://uk.rs-online.com/web/search/sear ... &R=6527343) ?

That would dictate at a 28v in I would get:

( 150 / (1000 + 150) ) * 28 =
0.1304 * 28 = 3.65V

Is that correct? My question is what about the fact that the V can range from 23V to 30V, so really the Vo could be anywhere from

0.1304 * 23 = 3V
to
0.1304 * 30 = 3.9V

yes? Which would be fine anyway but would just like to confirm that is correct?

So, resistors... I think it is because I was looking at 2W resistors for an original design with LEDs running on 28V using 30ma (0.84W), so 1W would of sufficed but went overboard, but now none of them are needed and can find 0.25W resistors for 2p like you said.

I will change the regs for this res/res/diode setup. Not quite sure I understand how that setup example with 1 resistor has lowered the voltage?

As for the opto-isolators... from what I have read and understand they are basically separating the electrical connections from one power supply and the other, using light as the barrier via a diode and phototransistor for example, instead of electricity. I would have to use one of these for each input correct? I think this may be slight overkill for this scenario though as the battery will always be running and stable before the switches are powered, but that brings rise to another thought... when the trailer is started up, will the voltage reg be OK with the large drop then rise back to 28v on and off probably 4-5 times a day? What would be the estimated lifespan?

Other than the regs replaced for a divider and confirming the P-Channel power MOSFETs dont need drivers (presuming not as it works), is there anything else to change or improve?
User avatar
By leon_heller
#72292
The diode clamp circuit is very simple - when the input is more than 5V the diode conducts putting 5V on the output, when the input is at 0V, it doesn't conduct and the output is low. Try it for yourself and see if it works. I haven't bothered with the 0.6V or so across the diode when it's conducting.

A resistance of 4k7 gives about 5mA through the diode, which is well within its spec. Power dissipation in the resistor is about 125 mW, so a 250 mW resistor will be fine. A voltage range of 23V - 30V won't make much difference.

Leon
By angelsix
#72296
What dictates when an input is >5v it conducts, and what dictates it then lowers the volts to 5v as would it not still be 28v just at 5mA no?

I can gather is the 2 resistors drop the volts to approx 3v using divider simple enough, then the diode simply creates a switching signal from a rising/falling signal of 3v and that is its purpose to create an on/off input. But with 1 resistor the I cannot see how that works, the voltage would always be 28v?

Also the spec states Vf (forward voltage) 1V max, what is that regarding? It cannot mean max of 1V through the diode surely?