I am making a project for my power power tools to have a soft start function when I turn on the tool.
So far I decided this settings specs.
Ramp time is 0 - 60 seconds
Kickstart is 0-100 percent power for 0.5seconds.
Right now I am using the Arduino Uno but I will adopt it with Attiny85 after it works.
I will be using MOC3052 coupled with a triac for the output.
For the input, I saw some post here that used the LTV814 from Lite-On, but i am not sure if this will detect the zero crossing of the AC power source.
I will also have some input pin to detect if the power tool was switched On.
I will be needing some help on the code soon.
code below is just a test for the analog input.
const int aiRampTime = A0; // ramp time refer to arduino board for the physical pin
const int aiKickStart = A1; // Start torque adjustment
const int diPowerOnMotor = 3; // Motor switch on
const int diAcCycle = 2; // input signal from AC source
const int doAcSource = 13; // output for Motor control
//note Ramp Time 0-60 seconds variable depends on analog input
//60 seconds equal to 3600 cycles at 60 Hz
void setup()
{
pinMode (diPowerOnMotor,INPUT);
pinMode (diAcCycle,INPUT);
pinMode (aiRampTime, INPUT);
pinMode (aiKickStart,INPUT);
pinMode (doAcSource,OUTPUT);
}
int valaiKickStart() //read analog input and store value to valaiKickStart
{ // Value can rannge fromn 0-1023
int a = 0;
a = analogRead(aiKickStart);
return a;
}
int valaiRampTime = 0;
/*// read analog input and store value to valaiRampTime
{ // convert analog inpput value to 1 minute maximum cycles
int v=0; // 3.52 = 3600/1024 multiplier for 3600 cycles
v = 3.52 * analogRead(aiRampTime);
return v;
}*/
void loop()
{
// read the value from the sensor:
valaiRampTime = 10 * analogRead(aiRampTime);
// turn the ledPin on
digitalWrite(doAcSource, HIGH);
// stop the program for <sensorValue> milliseconds:
delay(valaiRampTime);
// turn the ledPin off:
digitalWrite(doAcSource, LOW);
// stop the program for for <sensorValue> milliseconds:
delay(valaiRampTime);
}