555 timer LED flasher
The most famous chip in electronics, blinking an LED about once a second.
Shop by category
Shop all componentsMany dimmers, variable-speed drives and valve actuators take a 0 to 10 V control input. An Arduino cannot make that voltage alone, but the MCP4725 12-bit DAC gives 0 to 5 V over I2C, and an LM358 op-amp on a 12 V supply with a gain of two lifts it to 0 to 10 V. A knob on A0 sets the level, and the sketch updates the DAC. Check the result with a multimeter.
Keep the 0-10 V circuit away from mains wiring.
Check the drive or dimmer manual before you connect, as the control terminals differ.
Tick anything you already have and the total updates.
SMPS supply, 12 V version, for the op-amp
Follow the colours: red is power, dark grey is ground, blue is a signal.
The op-amp needs 12 V to swing to 10 V. Join the 12 V supply's ground to the Nano's GND. The LM358's output stops about 1.5 V below its supply, so expect about 10.5 V at most.
dac_0_10v.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_MCP4725.h>
Adafruit_MCP4725 dac;
void setup() {
Serial.begin(115200);
if (!dac.begin(0x60)) dac.begin(0x62); // try the two common addresses
}
void loop() {
int knob = analogRead(A0); // 0 to 1023
int code = map(knob, 0, 1023, 0, 4095); // 12-bit DAC code
dac.setVoltage(code, false); // 0 to 5 V; the op-amp doubles it
Serial.print("out about "); Serial.print(code / 4095.0 * 10.0, 2); Serial.println(" V");
delay(50);
}
Check pin 8 has 12 V, pin 4 GND, and that the DAC address is right.
The LM358 stops about 1.5 V below its supply. Use a 12 V supply or a rail-to-rail op-amp.
Add 100 nF across the op-amp supply and keep the DAC wires short.
No. Use a drive input meant for 0-10 V and join grounds only if the manual says so.
Only through the dimmer's own low-voltage 0-10 V input. Never connect the output to mains wiring.
PWM with a filter works too, but a DAC gives a cleaner, faster, more accurate voltage.
8 parts: Generic Nano CH340 Development Board (Soldered), MCP4725 12-Bit I2C DAC Module, LM358 Dual Op-Amp IC (DIP-8), Resistor Assortment Kit (30 Values), 10kΩ Slide Potentiometer Module, SMPS Power Supply, Metal Enclosure (5V / 12V / 24V), Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Digital Multimeter. On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (dac_0_10v.ino).
About ₹770 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
How a DAC turns a number into a voltage; A non-inverting op-amp amplifier with gain of two; Why an LM358 cannot reach the full supply voltage.
Ideas that reuse this build: DC energy meter. They are listed under Take it further on this page.
The most famous chip in electronics, blinking an LED about once a second.
Press once and the light stays on for about 11 seconds, then goes off by itself.
A running light like the one on Knight Rider, made from two classic chips.
Touch two wires with a fingertip and an LED lights: skin current switches a transistor pair.
Learning project. Check every circuit and the datasheet of each part before you power it up.