user51488: I am planning to control a RGB lamp using Arduino. The lamp is 24V and I want to be able to control the brightness of the lamp. I found a relay that will let me control the 3 channels (red green and blue), but will only let me turn it on and off (Not control brightness)
I am looking for a way to control the lamp both on/off and brightness. What component will do the same as my relay, but also let me use the varying voltage from the arduino to control my 24V lamp? (Just like a transistor)
I have an external 24V powersupply along with 5V for the arduino
Thanks!

user50469: Yes it is possible to vary voltage with a relay.  A relay is simply a 2 way 3 pole switch.

simulate this circuit – Schematic created using CircuitLab
By switching in a resistor to the supply voltage you have lowered the voltage and will dim the 24V light source.  The actual resistor value will depend on how dim you want to go.  Make sure the resistor is rated for the load you plan to place on it.

user4143: No, you can't vary the voltage with a relay. The only way you could do it with a relay would be to have a selection of different voltages available, and then use multiple relays to select which voltage is used. Less than ideal.
You need to use PWM to create a square wave with varying duty cycle. The duty cycle (the percentage of time the power is on within a given period) defines the average voltage of the output.  That PWM needs to be fed into a MOSFET which will in turn control the 24V power to the lamp.
It's exactly the same as driving RGB LED strips, except it's in the shape of a lamp not a long strip.

51488: <p>I am planning to control a RGB lamp using Arduino. The lamp is 24V and I want to be able to control the brightness of the lamp. I found a relay that will let me control the 3 channels (red green and blue), but will only let me turn it on and off (Not control brightness)</p>

<p>I am looking for a way to control the lamp both on/off and brightness. What component will do the same as my relay, but also let me use the varying voltage from the arduino to control my 24V lamp? (Just like a transistor)</p>

<p>I have an external 24V powersupply along with 5V for the arduino</p>

<p>Thanks!</p>
 50469: <p>Yes it is possible to vary voltage with a relay.  A relay is simply a 2 way 3 pole switch.</p>



<p><img src="https://i.stack.imgur.com/9wnJG.png" alt="schematic"></p>



<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f9wnJG.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>

<p>By switching in a resistor to the supply voltage you have lowered the voltage and will dim the 24V light source.  The actual resistor value will depend on how dim you want to go.  Make sure the resistor is rated for the load you plan to place on it.</p>
 4143: <p>No, you can't vary the voltage with a relay. The only way you could do it with a relay would be to have a selection of different voltages available, and then use multiple relays to select which voltage is used. Less than ideal.</p>

<p>You need to use PWM to create a square wave with varying duty cycle. The duty cycle (the percentage of time the power is on within a given period) defines the average voltage of the output.  That PWM needs to be fed into a MOSFET which will in turn control the 24V power to the lamp.</p>

<p>It's exactly the same as driving RGB LED strips, except it's in the shape of a lamp not a long strip.</p>
