Below is the project: Dimmer Printed Circuit Board I was doing cooporated with Shuyan Chen in the semester, and basically we wanted to print a circuit board as a dimmer to control a normal lamp with 230 voltage. So that I can have the experience to make use of it to adapt it into normal life or homes.

I had experience with Arduino and programming parts, however what I did before was more limited only in prototypes. Therefore, I want to make some experiments to test the soldering and Arduino into real functional use.


I ordered Sharp GP2YOA710KOF distance sensor, Vellman dimmer k8064, lamp, and some wires and certain plug online. I was trying to use distance sensor to detect the distance, so that when somebody was near in certain distance, the lamp will turn on automatically. Dimmer1.jpg Dimmer2.jpg Dimmer3.jpg Dimmer4.jpg



Later on, I was using this distance dimmer controller into my exhibition design project. Consequently, when visitors come near the exhibition, the lamp will automatically turn on. Below are the links to the testing of the dimmer in experiment and exhibition. https://www.youtube.com/watch?v=YNOZi9MiDC0 https://www.youtube.com/watch?v=F6Ph7mzfpyg



Source Code

<source lang=c>

// Coded by Kan Feng

// Project for Oberlichtsaal.gallery and seminar for Fire-Water-Earth-Human

// in 2015 wintersemester in Bauhaus University

// contact: kandesign.feng@gmail.com

int IRpin = 0; // analog pin for reading the IR sensor

float distance, distance1, distanceLED;

int LEDfade = 0;

int LEDval = 0;

int LEDpin = 9;

int count;

void setup() {

 Serial.begin(9600);                             // start the serial port
 pinMode(LEDpin, OUTPUT);


void loop() {

 float volts = analogRead(IRpin)*0.0048828125;   // value from sensor * (5/1024) - if running 3.3.volts then change 5 to 3.3
 distance = 65*pow(volts, -1.10);          // worked out from graph 65 = theretical distance / (1/Volts)S - luckylarry.co.uk
 distanceLED = distance - distance1;
 delay(100);                              // arbitary wait time.
 if (distance < 100 && distanceLED < 10 && LEDval < 255){    
   count += 1;
   if (count>5){                          // count the mistaken times due to the unstable detection by Sharp sensor
     LEDfade = 5;
   else {
     LEDfade = 0;
 else if (distance > 100 && LEDval > 0){
   count = 0;
   LEDfade = -5;
   count = 0;
   LEDfade = 0;
 LEDval += LEDfade;
 analogWrite(LEDpin, LEDval);
 distance1 = distance;

} <source>