Experimental switched voltage regulator using arduino ADC and PWM
authorTomas Mudrunka <tomas@mudrunka.cz>
Tue, 28 Aug 2012 23:15:58 +0000 (01:15 +0200)
committerTomas Mudrunka <tomas@mudrunka.cz>
Tue, 28 Aug 2012 23:15:58 +0000 (01:15 +0200)
arduino/.gitignore
arduino/Regulator/Regulator.ino [new file with mode: 0644]

index dc5cbd57a82201f9f38e96dc559ede2e37641af7..f1ef629636e838891b937d87ece1686250dab4d4 100644 (file)
@@ -1,4 +1,5 @@
 *.*
+!*.ino
 !*.pde
 !/.gitignore
 applet/
diff --git a/arduino/Regulator/Regulator.ino b/arduino/Regulator/Regulator.ino
new file mode 100644 (file)
index 0000000..879654b
--- /dev/null
@@ -0,0 +1,19 @@
+/* Software voltage regulator using analog read and PWM
+   Connect both voltage sensor and output pin to possitive side of capacitor
+   Then connect negative side to ground
+   Voltage should be approximatelly stabilized at AREF/2
+   You can use some push-pull (totem pole) kind of buffer at output pin to supply more current
+*/
+
+
+#define SENSOR A0
+#define OUTPIN 11
+
+void setup()  { 
+} 
+
+void loop()  { 
+  analogWrite(OUTPIN, map(analogRead(SENSOR), 0, 1023, 255, 0));
+}
+
+
This page took 0.170927 seconds and 4 git commands to generate.