MicroST
Published © GPL3+

AC Line Load Opto Control

How to interface a 220V load with the Arduino in safety mode.

BeginnerProtip2,400
AC Line Load Opto Control

Things used in this project

Story

Read more

Schematics

MST_K17 arduino driving example

Code

MST_K17 code

Arduino
/* ITA 
Codice per pilotaggio dell'interruttore optoelettronico MST_K17. 
Collegando il pin CNT=53 all'ingresso positivo del modulo MST_K17
e l'ingresso negativo alla GND della scheda Arduino( MEGA)
accendera' e spegnera il carico tramite il modulo MST_K17 per un tempo ( in millisecondi)  settati con la variabile dly
Come carico del MST_K17 si puo usare una lampada. un motore o un riscaldatore
*/

/* ENG 
Simple code for driving the optoelectronic AC relay MST_K17. 
Connecting the pin CNT=53 at the positve input of the MST_K17
and its  negative input to the GND of the Arduino board (MEGA)
the load will be turn on / off by the MST_K17 module for a time ( in milliseconds)  set by the variable dly
As load of the MST_K17 you can use a lamp, motor or heater.
*/

// set pin numbers:
const int CNT = 53;     // the number of the CNT pin


// variables will change:

int dly=100;      // tempo di ON e OFF del modulo 

void setup() {
  
  pinMode(CNT, OUTPUT); //  CNT pin as an output:

}

void loop() {

  digitalWrite(CNT,HIGH);
  delay(dly);
  digitalWrite(CNT,LOW);
  delay(dly);

}

Credits

MicroST
12 projects • 20 followers
Electronic is my life passion...
Contact

Comments

Please log in or sign up to comment.