I do not know anything about electronics but know alot about programming.
I want to digitally control a 12v source,
using 0 to 255, so:
255 = 12v
0 = 0v
128 = 6v
(Doesn't have to scale perfectly)
I have a 12v source available and an arduino of course
How would I go about doing this?
The correct answer depends on the impedance of the device you want to control.
One way is to integrate the 5volt PWM first with a resistor and a capacitor.
Followed by a 2.4x amplifying opamp.
This won't "load" the integrator, so good linearity.
Another way is to first amplify the 5volt PWM to 12volt PWM with a transistor.
And then integrate the 12volt PWM.
Works only if the device is not "loading" the output voltage.
What is the devide you want to control.
I actually want to control 3 LED strips
Using 3 different channels from the arduino
Well its one LED strip, a RGB strip
So I could do say
Pin 8 = 255
Pin 7 = 128
Pin 6 = 128
This would show a light red
You need 3 NPN transistors.
Arduino drives base of each thru a 220, 250, 270 resistor, something in that range (but no less than 220).
Emitters connect to Gnd.
Collectors connect to R, G, B of LED strip, + to 12V.
analogWrite the values you want control brightness of each color.
Each 3 LEDs in the strip will require about 60mA. How many LEDs in the strip you are using? That will have an impact o the transistor you use, and perhaps change to N-Channel MOSFET might be suggested, such as AOI514:
(forum screws up link, may need to edit the beginning of it)
Ignore post#1, because you gave me the wrong information.
Ive just recieved the LED strip and it has
+12v, R, G, B
Im guessing that means 3 Gnds
Will that still work?
I reckon ill use about 36 LEDs, Im actually using a Computers PSU to power them,
then the arduino to fade them
Yes, that will work and is the easiest and most common way. That's why it has a configuration like that. Controlling a 12V led strip with an Arduino is done like a million times before so yeay....
How did you do the keyboard macro for the Google search ?
Let me Google that for you…