SSR flickering problem
hello,
i trying run below code ac circuit using ssr ac powered halogen light bulbs flickers.
some people in forums special arduino code or 555 timer or 741 coupler need used 0 crossing voltage...
please advise how solve problem.
thank you.
parts available in attached photo;
moc3020 (according play ground tutorial)
h11aa1m (according play ground tutorial)
ssr ald112
ssr xssr da240201
ssr 25 da
lots of mosfets, resistors etc..
i trying run below code ac circuit using ssr ac powered halogen light bulbs flickers.
some people in forums special arduino code or 555 timer or 741 coupler need used 0 crossing voltage...
please advise how solve problem.
thank you.
parts available in attached photo;
moc3020 (according play ground tutorial)
h11aa1m (according play ground tutorial)
ssr ald112
ssr xssr da240201
ssr 25 da
lots of mosfets, resistors etc..
code: [select]
const int led = 9; // pin led attached to
const int sensor1 = a1;
const int sensor2 = a2;
int brightness = 250; // how bright led is
int lightgoal = 0;
int maxbrightness =252;
const int upfadeamount = 5; // how many points fade led by
const int dnfadeamount = 3; // how many points fade led by
int timer = 1000;
// setup routine runs once when press reset:
void setup() {
// declare pin 9 output:
pinmode(led, output);
pinmode(sensor1, input); // declare sensorpins inputs
pinmode(sensor2, input);
}
// loop routine runs on , on again forever:
void loop() {
if (digitalread(sensor1) == high || digitalread(sensor2) == high) { // detect if either sensor triggered
timer = 15; // every increment adds tenth of second
lightgoal = maxbrightness; // set lights turn on
//if (brightness == 0){ brightness = 1;}
}
/// light brightness / fading section
if(brightness == lightgoal){ // brightness want it?
if (timer == 0){
lightgoal = 0;
}
delay(100); // finctioning delay in timer, not percise
timer = timer - 1; //countdown timer every loop
}
else{
if(brightness < lightgoal){ // brightness low?
// raise brightness
brightness = brightness + upfadeamount;
}
else { // if light isn't low, it's high
// lower brightness
brightness = brightness - dnfadeamount;
}
// set brightness (pwm duty cycle) of led
analogwrite(led, brightness);
// wait 30 milliseconds see dimming effect
delay(25);
}
}
1) pictures way big.
2) can post schematic?
3) analogwrite(led, brightness) - can not apply pwm ssr not work. because once triggered ssr stay on until next half cycle. result beat , yes cause flickering.
4) why delay(100) ?
2) can post schematic?
3) analogwrite(led, brightness) - can not apply pwm ssr not work. because once triggered ssr stay on until next half cycle. result beat , yes cause flickering.
4) why delay(100) ?
Arduino Forum > Using Arduino > General Electronics > SSR flickering problem
arduino
Comments
Post a Comment