MikuQ Optocoupler isolation Relay extend Module and how to use


(BlinkQ) #1

MikuQ Relay Module with Two Opticalcoupler Relay Info: 2A 30VDC or 1A 125VAC (Maximum support 250VAC)


(BlinkQ) #2

Sample code:

#include < wiringPi.h>
int main(void)
{
  wiringPiSetup() ;
  pinMode (0, OUTPUT) ;
  pinMode (2, OUTPUT) ;
  for(;; )
  {
    digitalWrite(2,  LOW) ; delay (5) ;
    digitalWrite(2, HIGH) ; delay (1000) ;
    digitalWrite(0,  LOW) ; delay (5) ;
    digitalWrite(0, HIGH) ; delay (4000) ;

  }
}

ON 1S and OFF 4S In each period, only 10ms current consumption


(bpi team) #3

very cool ,thank you.:wink:


(BlinkQ) #4

BPI-M3 20W 220V energy-saving lamps MikuQ Relay Module Secure connection: Run: Gif:


(BlinkQ) #5

MikuQ Relay Module as the first module support by MikuDuino,it run well on BPI-M2+

/*
 * relay.cpp:
 *
 *	Welcome to MikuQ.com! MikuDuino for BananaPi 
 *	
 *     by MikuQ(i@mikuq.com) 2016-6-4
 *	
 * https://github.com/bpiq/MikuPi
 *
 */

#include "MikuDuino.h"
#include "MikuRelay.h"

Miku_Relay relay;

void setup()
{	
	sayHello();
}

void loop()
{
	relay.setOn();
	delay(2000);
	relay.setOff();
	delay(8000);
}