Control AC bulb with Arduino AC Swtich
Control AC load with Arduino and Triac Switch AC Swtich Module
This this video shows how turn ON or OFF an AC load with Arduino using RobotDyn AC Swtich Module.
Resources for this sketch
- Control AC load with Arduno with 1 Push button (Push ON, Push OFF)
- Control AC load with Arduno with 2 Push buttons
- MOC3042 Optoisolators Triac Driver(pdf)
- BTA16 600B Triac datasheet (pdf)
- Get Wiring Diagram for this from Robojax Arduino Course on Udemy
- Get Early Access to my videos via Patreon
/**************
* RobotDyn AC Switch
*
* Turn AC Load ON or OFF with Triac BTA16 600B module and Arduino
*
* Written by Ahmad Shamshiri on Friday Oct 27, 2019 at 18:50 in Ajax, Ontario, Canada
*
* Watch video instruction for this code :
* https://youtu.be/1phdcshRZ_I
*
*
* Get this code and other Arduino codes from Robojax.com
Learn Arduino step by step in structured course with all material, wiring diagram and library
all in once place. Purchase My course on Udemy.com http://robojax.com/L/?id=62
If you found this tutorial helpful, please support me so I can continue creating
content like this. You can support me on Patreon http://robojax.com/L/?id=63
or make donation using PayPal http://robojax.com/L/?id=64
* * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.*
* This code has been download from Robojax.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#define powerControlPin 5 //
void setup() {
Serial.begin(9600);
pinMode(powerControlPin, OUTPUT);
}
void loop()
{
digitalWrite(powerControlPin,HIGH);
delay(3000);// keep the light(or anohter AC Load) ON for 3 seconds
digitalWrite(powerControlPin,LOW);
delay(2000);// keep the light(or anohter AC Load) OFF for 2 seconds
}