Devices & Components
Arduino Uno Rev3
mosfet(moc3020)
bta16(triac)
Jumper wires (generic)
LM35(TEMPERATURE SENSOR)
1N4007 – High Voltage, High Current Rated Diode
Resistor 1k ohm
4n25 mosfet
1N4007 – High Voltage, High Current Rated Diode
Hardware & Tools
Solder Wire, Lead Free
Soldering iron (generic)
PCB, For DMB-4775
Software & Tools
Arduino IDE
Project description
Code
code
c_cpp
1#define triacPulse 10 2#define SW 7 3#define ZVC 2 //we can declare onlly pin 2 or 3 here because these both have interrupt read ability 4int tempmax=50; 5int tempmin=30; 6 7int x = 0; 8void setup() 9{ Serial.begin(115200); 10 pinMode(ZVC, INPUT_PULLUP); 11 pinMode(A0, INPUT); 12 pinMode(triacPulse, OUTPUT); 13 pinMode(11,INPUT); 14 pinMode(12,INPUT); 15 pinMode(13,INPUT); 16} 17float temp() 18 { int val = analogRead(A0); 19 float temp1 = ( val/1023.0)*500; 20 return temp1; 21 } 22void pulse() 23{ delayMicroseconds(x); // read AD0 24 digitalWrite(triacPulse, HIGH); 25 delayMicroseconds(50); //delay 50 uSec on output pulse to turn on triac 26 digitalWrite(triacPulse, LOW); 27} 28void pulse_for_min() 29{ delayMicroseconds(7200); // read AD0 30 digitalWrite(triacPulse, HIGH); 31 delayMicroseconds(50); //delay 50 uSec on output pulse to turn on triac 32 digitalWrite(triacPulse, LOW); 33} 34void pulse_for_full() 35{ delayMicroseconds(200); // read AD0 36 digitalWrite(triacPulse, HIGH); 37 delayMicroseconds(50); //delay 50 uSec on output pulse to turn on triac 38 digitalWrite(triacPulse, LOW); 39} 40void loop() { 41 float temperature=temp(); 42 bool full_on = digitalRead(11); 43 bool full_off = digitalRead(13); 44 bool automatic = digitalRead(12); 45 if(automatic==HIGH && full_on==LOW && full_off==LOW) 46 { if((temp >= tempmin) && (temp <= tempmax)) 47 { // if temperature is higher than minimum temp & less than maximum temperature 48 int x = map(temp(), tempmin, tempmax,7200 ,200 ); 49 Serial.println(digitalRead(ZVC)); 50 attachInterrupt(0, pulse, FALLING); // attach Interrupt at PIN2 51 } 52 if(temp>=tempmax) 53 pulse_for_full(); 54 if(temp<=tempmax) 55 pulse_for_min(); 56 } 57 if(automatic==LOW && full_on==HIGH && full_off==LOW) 58 pulse_for_full(); 59 if(automatic==LOW && full_on==LOW && full_off==HIGH) 60 pulse_for_min(); 61 62} 63
Downloadable files
CIRCUIT DIAGRAM
CIRCUIT DIAGRAM
arduino with triac gate
arduino with triac gate

circuit diagram for connecting arduino with triac
circuit diagram for connecting arduino with triac

lm 35 sensor with arduino
lm 35 sensor with arduino

zero detection circuit
zero detection circuit

arduino with triac gate
arduino with triac gate

lm 35 sensor with arduino
lm 35 sensor with arduino

zero detection circuit
zero detection circuit

CIRCUIT DIAGRAM
CIRCUIT DIAGRAM
circuit diagram for connecting arduino with triac
circuit diagram for connecting arduino with triac

Comments
Only logged in users can leave comments