12v analog out from arduino

Hi,

I want to control an analog 0-12v feed using an arduino. The resolution doesn't need to be very high, eg. 32 steps should be enough. PWM wouldn't work, or i'd simply use a transistor. So i need a way to scale up 0-5v to 0-12v, preferable not drawing much current from the micro. Is there a simple component to do that, or do i need an amplifying ic?

What about filtered PWM? a transistor to 12V then an RC filter.
What sort of current do you need?

Perhaps i should mention that the 12v is the raw power source going into my project (vcc). So i want to trim the raw source with the arduino.

What do you mean by trim? Do you mean adjust? If so over what range?
I ask again what current are we talking about?

Grumpy_Mike:
What do you mean by trim? Do you mean adjust? If so over what range?
I ask again what current are we talking about?

You sound like your name: Grumpy. Really, i thought this forum was about helping people out...

Did you not read the rest? How difficult is it to understand 0-12v (there's your range), in 32 steps or so (resolution), the source voltage needs to power 8 car bulbs, i suppose it's no more than 2W @12v, driven by an arduino to adjust the brightness.

Did you not read the rest?

I did, nowhere do you mention 8 car headlight bulbs.

I do not understand why you say PWM would not work, it would.

A reply can only be as good as a question, and missing out vital information or not making things clear results in people asking you supplemental questions. Your original question was confusing because you said 0-5V from the arduino. The arduino only produces 0 or 5V nothing inbetween.

If you take my replies as offensive then I will not bother trying to help you anymore.

Grumpy_Mike:

Did you not read the rest?

I did, nowhere do you mention 8 car headlight bulbs.

I do not understand why you say PWM would not work, it would.

A reply can only be as good as a question, and missing out vital information or not making things clear results in people asking you supplemental questions. Your original question was confusing because you said 0-5V from the arduino. The arduino only produces 0 or 5V nothing inbetween.

If you take my replies as offensive then I will not bother trying to help you anymore.

First, i didn't think the 8 bulbs was relevant. I was asking for the electronics equivalent of an analog amplifier. Secondly you ask me about range which i clearly stated. I'm new on this stuff and that's why i come to forums like this. Now i feel that my head gets bitten off for not asking the right questions.

Back to the topic: How would PWM work? I was thinking like something of a digital trimpot, but clearly i am misinformed. I thought there was something like analogWrite...

AnalogWrite works by generating PWM it does not produce an analogue voltage. Read this page I wrote explaining it.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
PWM on a filament light works by using the thermal delay in the filament, cooling and heating rapidly in turn produces less light than on all the time. Driving your bulbs is relatively simple if you use PWM as you can use a power FET directly connected to the arduino. However delivering a steady DC voltage is much more tricky because it involves amongst other things dissipating the power you are not taking in the bulb as heat in the FET. I assume from your figures that these are 3W bulbs, is this correct? That would make it a 24W load. Therefore a 2A load.

Now I have to ask you another question. What are you trying to do. Yes I know apply a variable voltage to a bulb but to what aim? If it is to control the brightness then you have to know that the brightness is linearly proportional to the voltage applied to it. So with 32 equal voltage steps then most of the perceived change will be at one end of the range.

Thank you for taking the time to explain it.

Grumpy_Mike:
Now I have to ask you another question. What are you trying to do. Yes I know apply a variable voltage to a bulb but to what aim? If it is to control the brightness then you have to know that the brightness is linearly proportional to the voltage applied to it. So with 32 equal voltage steps then most of the perceived change will be at one end of the range.

I am trying to replace a manual rheostat for dashboard lighting with a digital alternative (yes, to adjust the brightness of the bulbs). It's part of a car-related demonstration project. If using analog gets too complex I will simply replace the incandescent bulbs with LEDs and use the PWM output to control the original wiring through a transistor.

Thanks the more information the better. I can't see why using PWM in that situation would be a problem I would try that first. Filament bulbs do respond well to PWM and it will be easier than replacing your lights.
So a simple FET or transistor should do you.

Grumpy_Mike:
Thanks the more information the better. I can't see why using PWM in that situation would be a problem I would try that first. Filament bulbs do respond well to PWM and it will be easier than replacing your lights.
So a simple FET or transistor should do you.

Is it really that simple? Who would have thought...

RobvdVeer:
Hi,

I want to control an analog 0-12v feed using an arduino. The resolution doesn't need to be very high, eg. 32 steps should be enough. PWM wouldn't work, or i'd simply use a transistor. So i need a way to scale up 0-5v to 0-12v, preferable not drawing much current from the micro. Is there a simple component to do that, or do i need an amplifying ic?

The volts isn't the problem. How many amps...?

RobvdVeer:
Is it really that simple? Who would have thought...

Here is an example if you want:-
http://bildr.org/2012/03/rfp30n06le-arduino/

RobvdVeer:

Grumpy_Mike:
What do you mean by trim? Do you mean adjust? If so over what range?
I ask again what current are we talking about?

You sound like your name: Grumpy. Really, i thought this forum was about helping people out...

Did you not read the rest? How difficult is it to understand 0-12v (there's your range), in 32 steps or so (resolution), the source voltage needs to power 8 car bulbs, i suppose it's no more than 2W @12v, driven by an arduino to adjust the brightness.

I am trying to see what is grumpy in those questions. Why do you think he was asking you questions? To deliberately offend you, or to help you?

I also see that in spite of -your- rudeness, Grumpy_Mike has continued to lend his assistance. See how useful the answers can be with the proper information about your project?

Grumpy_Mike:

RobvdVeer:
Is it really that simple? Who would have thought...

Here is an example if you want:-
http://bildr.org/2012/03/rfp30n06le-arduino/

Thanks for the link, Mike.

polymorph:
I also see that in spite of -your- rudeness, Grumpy_Mike has continued to lend his assistance. See how useful the answers can be with the proper information about your project?

'My' rudeness? Now, this is getting awfully offtrack. Mike was pretty capabable speaking up for himself, and i explained the matter. There is no need to call me rude. We got back on topic. If you want to have further discussion, i suggest you PM me. I propose to move on.

Grumpy_Mike:
So a simple FET or transistor should do you.

Incandescent light bulb - Wikipedia says

"The actual resistance of the filament is temperature-dependent. The cold resistance of tungsten-filament lamps is about 1/15 the hot-filament resistance when the lamp is operating."

So, the FET/transistor would need to be rated for what, 30A for the cold start surge?

I tried reading the explanations about transistors and fets, but i have some trouble understanding the difference. Why would i be needing a fet instead of a regular transistor (if any such thing exists). N-fet, p-fet, mosget, bjt, it all dazzles me a bit.

Let me add that this question is purely theoretical.

Why would i be needing a fet instead of a regular transistor

For switching currents above an amp or two you are better off using a FET. This is because the voltage dropped across it when it is on is very much smaller than a transistor. This means it does not get as hot and generally will not need a heat sink.

So, the FET/transistor would need to be rated for what, 30A for the cold start surge?

Remember that a FET has a surge current rating as well as a continuous current rating. You are never going to be able to run a FET anywhere close to its maximum current rating due to power dissipation issues.

Just for completeness, here are the bulbs i am talking about.

http://www.bulbtown.com/161_MINIATURE_BULB_GLASS_WEDGE_BASE_p/161.htm

They are 14 Volt .19 Amp 2.66 Watt . The binnacle contains 5 of each, connected in parallel.