Arnov Sharma
Published © GPL3+

Powering an Arduino with AC source

*Powering an Arduino with Capacitor Dropper Circuit*

AdvancedFull instructions provided18 minutes4,921
Powering an Arduino with AC source

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
0.1uf 300V
×1
470uF 10V Cap
×1
5V Zener diode
×1
LED (generic)
LED (generic)
×1
UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
10 ohms 1W Resistor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

etching solution

Story

Read more

Schematics

SCH

Code

code

C/C++
int led = 3;           // the PWM pin the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
  // declare pin 9 to be an output:
  pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // set the brightness of pin 9:
  analogWrite(led, brightness);

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 30 milliseconds to see the dimming effect
  delay(30);
}

Credits

Arnov Sharma

Arnov Sharma

293 projects • 299 followers
Just your average MAKER

Comments