0
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« on: May 04, 2007, 04:01:27 pm » |
Hi Arduinos, I'd like to use the arduino with sensors to dim AC lights. I've never interfaced a microcontroller to dim AC and would like to know some tips and tricks and bypass the traps that you might have encountered while doing so. Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Berlin
Offline
Newbie
Karma: 0
Posts: 23
|
 |
« Reply #2 on: May 30, 2007, 05:49:57 pm » |
As someone who's gone the light&arduino path.. it only really ended when i bought dmx equipment.. which by itself is a fragile protocol, but as least it dims lamps easily.. I've also built the arduinoDmx ( http://www.arduino.cc/playground/Learning/DMX) it worked but i had a lot of sync problems with my dmx lamp - although to really debug these problems you must have a dmx testing device, or at least some more dmx equipment to try on. Ciao, oori
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #3 on: May 30, 2007, 08:35:09 pm » |
Hi Oori, For this project, I wanted to control normal house lamps and not rely on DMX equipment. I've gone the DMX way and had my share of DMX problems, btw search for my posts on DMX for a more precise code for Arduino DMX if your DMX lamps are picky.
also Thanks Tomski for the velleman kit reference.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 203
|
 |
« Reply #4 on: May 31, 2007, 02:27:57 am » |
X10 with a "firecracker" controller? That should be easy to drive from an Arduino. You can get the firecracker, transceiver, hand held remote, and a dimmer for $20. Looks like extra dimmers go for about $10 each. Those are 110v 60hz units, I presume there are variants for folk with more deadly mains. It looks like the firecracker works by using RTS and DTR as both power and signaling. I don't know if you'd have to drive them with more than 5v. http://www.rentron.com/FireCracker.htm As if I didn't have enough to do.. it looks interesting.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Denver
Offline
God Member
Karma: 19
Posts: 776
Inactive - PM
|
 |
« Reply #6 on: April 09, 2009, 09:26:26 am » |
@jims I've already interfaced to the firecracker - http://www.arduino.cc/playground/X10/CM17A
|
|
|
|
|
Logged
|
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom." ~ Clifford Stoll
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 1
Arduino rocks
|
 |
« Reply #7 on: May 11, 2009, 09:41:41 am » |
Hi, I used an Arduino and a Velleman K8064 to make my own WakeUpLight. The electric circuit scheme of brakmolotov.net posted by jeep1984 above was very helpful, thanks! Everything works fine, I've placed a . // Define pins
int pwmPin = 9; // select the output pin for the dimmer int analogPin = 1; // select the input pin for the alarmclock int ledPin = 13; // select the pin for the LED
// Program variables
int pwmVal = 0; // Variable to store the value to send to the pin int analogVal = 0; // Variable to store the value read from the analog pin int fadeCount = 0; // Loop counter int stopCount = 0; int wait = 250; // 250ms delay; shorten for faster fades
void setup() { pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT pinMode(pwmPin, OUTPUT); // sets the pins as output analogWrite(pwmPin, pwmVal); // Write current values to pwm pin }
// Main program void loop() { analogVal = analogRead(analogPin); // read the value from the sensor if (analogVal==0) // if no alarm beep is received { stopCount += 1; } else // if alarm beep is received { fadeCount += 1; stopCount = 0; } if (fadeCount==20 && pwmVal!=255) { fadeCount=0; pwmVal += 1; analogWrite(pwmPin, pwmVal); // Write current values to pwm pin digitalWrite(ledPin, HIGH); // turn the ledPin on } else { digitalWrite(ledPin, LOW); // turn the ledPin off } if (stopCount==60) { stopCount=0; fadeCount=0; pwmVal = 0; analogWrite(pwmPin, pwmVal); // Write current values to pwm pin } delay(wait); // Pause for 'wait' milliseconds before resuming the loop
}
Tim
|
|
|
|
« Last Edit: May 11, 2009, 09:43:05 am by t.m.assman »
|
Logged
|
|
|
|
|
berlin
Offline
Full Member
Karma: 0
Posts: 150
fubbi.com
|
 |
« Reply #8 on: June 25, 2009, 05:50:20 am » |
I have built the circuit exactly like in brakmolotov's example. I can see the value going up and down between 0v and 5v nicely on pin 9 when I run his code. But I am not getting past the transistor. When I measure at the output to the velleman I see a constant 6v Any clues as to why this might be? Have I got something the wrong way around? Thanks here's the schematic 
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25442
Solder is electric glue
|
 |
« Reply #9 on: June 25, 2009, 07:47:47 am » |
I noticed the schematic has a GND connection going to the Velleman. This is wrong it should go to the analogue input line on SK3. These are not the same as gnd on the Velleman
|
|
|
|
|
Logged
|
|
|
|
|
berlin
Offline
Full Member
Karma: 0
Posts: 150
fubbi.com
|
 |
« Reply #10 on: June 25, 2009, 07:49:52 am » |
SK3?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25442
Solder is electric glue
|
 |
« Reply #11 on: June 25, 2009, 07:53:57 am » |
SK3? That's what it says on the data sheet.
|
|
|
|
|
Logged
|
|
|
|
|
berlin
Offline
Full Member
Karma: 0
Posts: 150
fubbi.com
|
 |
« Reply #12 on: June 25, 2009, 08:38:48 am » |
Hi Mike
I get what you mean, but not what it means...
The SK3 has "+" and "-" connectors, "-" is not ground?
thanks
fubbi
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25442
Solder is electric glue
|
 |
« Reply #13 on: June 25, 2009, 11:06:23 am » |
The SK3 has "+" and "-" connectors, "-" is not ground? No it is the other side of an opto isolator. So it needs to be connected to this and not ground as shown in the diagram. In fact the 1M and capacitor are rubbish. But it will work if you connect what is marked gnd to the SK3 - and the 5V to the SK3 +
|
|
|
|
« Last Edit: June 25, 2009, 11:06:41 am by Grumpy_Mike »
|
Logged
|
|
|
|
|
berlin
Offline
Full Member
Karma: 0
Posts: 150
fubbi.com
|
 |
« Reply #14 on: June 25, 2009, 12:21:11 pm » |
most excellent sir
thank you
fubbi
|
|
|
|
|
Logged
|
|
|
|
|
|