@davidzh
Powersupply is rather simple chinese one:
https://aliexpress.com/item/1pcs-small-size-ac-dc-power-supply-module-220v-to-3-3v-1w-isolated-LED-
ac/32653670258.html?spm=a2g17.10010108.1000016.1.73e0545dSSfyHB&isOrigTitle=true
Posts made by Mateusz Pięta
-
RE: 2gang in wall dimmer with touch sensors
-
2gang in wall dimmer with touch sensors
Hello,
I would like to present you my latest project - 2 gang dimmer to be placed in wall (EU) with livolo panel on top of it. Works with standard light bulbs and dimmable leds
sorry fot the panel condition - it wen throuhg a lot
in short:
220v to 3v3 power supply
esp8266-12e
printable case
zero-cross detection
ttp223 touch sensors
1.2A per dimm channel
ws2812b RGB led![alt text](image url)and some pictures:
-
RE: Software for PCB 3D design
kicad - thats what i was looking for - thank you
ps. any chance its compatible with eagle libraries ? -
Software for PCB 3D design
Hello There,
just a quick question.
Which software is used for 3D pcb designs on openhardware.io ? i would like to design some of my ownRegards.
-
RE: Wall Switches Solid State relay 1cm Square
any idea how to achieve dimmer with that ?
-
RE: Wall Switches Solid State relay 1cm Square
by the way, there is also AQH3223 which can handle up to 1.2A
-
RE: Wall Switches Solid State relay 1cm Square
Hi there !
That is very interesting.
Can you share some schematic how to wire things up ?? whad Zero voltage switching means ??i have also found AQH1213 which i guess is easier to obtain.
-
RE: MultiRelayExpanderWithToggleSwitch unstable
Everything works now
below is corrected code://"MultiRelayExpanderWithToggleSwitch" for MySensors 2.0 //Author : Mateusz Pieta //email: m.pieta@outlook.com // //Sketch to use PCF8574 expanders for Relay Arrays with Button Actuators // // //#define MY_RADIO_NRF24 //#define MY_REPEATER_FEATURE #define MY_GATEWAY_SERIAL #include <MySensor.h> #include <SPI.h> #include <Wire.h> #include <PCF8574.h> #define RELAY_ON 1 #define RELAY_OFF 0 #define noExpanders 2 class Relay { public: int buttonPin; int relayPin; boolean relayState; boolean buttonState = 1; }; PCF8574 relays_exp[noExpanders]; PCF8574 buttons_exp[noExpanders]; Relay Relays[noExpanders][8]; MyMessage msg; void setup(){ relays_exp[0].begin(0x38); relays_exp[1].begin(0x39); buttons_exp[0].begin(0x3B); buttons_exp[1].begin(0x3F); for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { Relays[i][j].buttonPin = j; Relays[i][j].relayPin = j; Relays[i][j].relayState = loadState(8*i+j); buttons_exp[i].pinMode(j, INPUT_PULLUP); wait(100); relays_exp[i].pinMode(j, OUTPUT); relays_exp[i].digitalWrite(Relays[i][j].relayPin, Relays[i][j].relayState? RELAY_ON:RELAY_OFF); msg.setSensor(8*i+j); msg.setType(V_LIGHT); send(msg.set(Relays[i][j].relayState? true : false)); wait(50); } } } void presentation() { sendSketchInfo("MultiRelayExpanderWithToggleSwitch", "0.9b"); wait(100); for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { present(8*i+j, S_LIGHT); } } } void loop() { for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { if (buttons_exp[i].digitalRead(j) != Relays[i][j].buttonState) { Relays[i][j].relayState = !Relays[i][j].relayState; Relays[i][j].buttonState = !Relays[i][j].buttonState; relays_exp[i].digitalWrite(Relays[i][j].relayPin, Relays[i][j].relayState?RELAY_ON:RELAY_OFF); msg.setSensor(8*i+j); send(msg.set(Relays[i][j].relayState? true : false)); saveState(8*i+j, Relays[i][j].relayState ); } } } wait(50); } void receive(const MyMessage &message){ if (message.type == V_LIGHT) { if (message.sensor < noExpanders * 8) { if (message.sensor < 8) { Relays[0][message.sensor].relayState = message.getBool(); relays_exp[0].digitalWrite(Relays[0][message.sensor].relayPin, Relays[0][message.sensor].relayState? RELAY_ON:RELAY_OFF); saveState( message.sensor, Relays[0][message.sensor].relayState ); } if (message.sensor >= 8) { Relays[1][message.sensor -8].relayState = message.getBool(); relays_exp[1].digitalWrite(Relays[1][message.sensor -8].relayPin, Relays[1][message.sensor -8].relayState? RELAY_ON:RELAY_OFF); saveState( message.sensor, Relays[1][message.sensor -8].relayState ); } } } wait(20); }
-
MultiRelayExpanderWithToggleSwitch unstable
Hello,
Im working on GW with directly attached sensors for Relay array using PCF8574 ( i need about 24 relays & buttons ) using MySensors development branch
I know that code works but sometimes gateway does not respond to domoticz at startup ( or even serial monitor ) and sometimes it breaks after few minutes of working..faulty arduino ? dont have any spare one to test
Or maybe there is a code problem ?check it out:
//#define MY_RADIO_NRF24 #define MY_GATEWAY_SERIAL //#define MY_REPEATER_FEATURE #include <MySensor.h> #include <SPI.h> #include <Wire.h> #include <PCF8574.h> #define RELAY_ON 0 #define RELAY_OFF 1 #define noExpanders 2 class Relay { public: int buttonPin; int relayPin; boolean relayState; boolean buttonState = 1; }; PCF8574 relays_exp[noExpanders]; PCF8574 buttons_exp[noExpanders]; Relay Relays[noExpanders][8]; MyMessage msg; void setup(){ relays_exp[0].begin(0x38); relays_exp[1].begin(0x39); buttons_exp[0].begin(0x3B); buttons_exp[1].begin(0x3F); for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { Relays[i][j].buttonPin = j; Relays[i][j].relayPin = j; Relays[i][j].relayState = loadState(8*i+j); buttons_exp[i].pinMode(j, INPUT_PULLUP); wait(50); relays_exp[i].pinMode(j, OUTPUT); relays_exp[i].digitalWrite(Relays[i][j].relayPin, Relays[i][j].relayState? RELAY_ON:RELAY_OFF); msg.setSensor(8*i+j); msg.setType(V_LIGHT); send(msg.set(Relays[i][j].relayState? true : false)); wait(50); } } } void presentation() { sendSketchInfo("MultiRelayExpanderWithToggleSwitch", "0.9b"); wait(100); for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { present(8*i+j, S_LIGHT); } } } void loop() { for ( int i = 0 ; i < noExpanders ; i++ ) { for ( int j = 0 ; j < 8 ; j++ ) { if (buttons_exp[i].digitalRead(j) != Relays[i][j].buttonState) { Relays[i][j].relayState = !Relays[i][j].relayState; Relays[i][j].buttonState = !Relays[i][j].buttonState; relays_exp[i].digitalWrite(Relays[i][j].relayPin, Relays[i][j].relayState?RELAY_ON:RELAY_OFF); msg.setSensor(8*i+j); send(msg.set(Relays[i][j].relayState? true : false)); saveState(8*i+j, Relays[i][j].relayState ); } } } wait(50); } void receive(const MyMessage &message){ if (message.type == V_LIGHT) { if (message.sensor < noExpanders * 8) { if (message.sensor < 8) { Relays[0][message.sensor].relayState = message.getBool(); relays_exp[0].digitalWrite(Relays[0][message.sensor].relayPin, Relays[0][message.sensor].relayState? RELAY_ON:RELAY_OFF); saveState( message.sensor, Relays[0][message.sensor].relayState ); } if (message.sensor >= 8) { Relays[1][message.sensor -8].relayState = message.getBool(); relays_exp[1].digitalWrite(Relays[0][message.sensor -8].relayPin, Relays[1][message.sensor -8].relayState? RELAY_ON:RELAY_OFF); saveState( message.sensor, Relays[1][message.sensor -8].relayState ); } } } wait(20); }