Esp12-e WiFi QUAD 277Vac/16Amp Relays + power supply

Download the CAD file by clicking:
http://piwifio.com/Brute4ce22.pcb
The CAD file can be viewed AND PC boards can be ordered
by using http://expresspcb.com CAD software.
Minimum order is $68 for (3) PC boards,
Yielding (6) Esp12-e Quad Relay circuits

Here’s a complete parts/source list
(excluding the Esp12-e)
for building 6 PC boards:
http://www.digikey.com/short/3hhq13

1 Like

well- I sure hope all is going swimmingly with the ESP12-e integration,
because I just sent off to expressPCB.com
for (2) Esp12-e designs.
I put 2 separate designs on 1 board. I’m…“frugal”. :wink:

These will be my “experimenter” PC boards for the Esp12-e.

I haven’t even fired up an Esp12-e yet. I hope it works…

I’m thinking “GROW LIGHT Controller”. Yeah.
-With (4) binary inputs for thermostats and door alarms.
Relays will be used for lighting and exhaust fans (triggered by thermostats).
It would be awesome if I can monitor everything remotely, on my Nexus7.

I LOVE California!
Be SURE you have the proper permits, though,
or you get arrested!


1 Like

Meh.
I SHOULD have put a THIRD circuit on there,
instead of (2) “Allie” circuits.
The third circuit uses a MCP3004 4 input SPI bus A/D converter.
I’d eliminate the relay and GPIO connector,
and have a RJ45 connector to the MCP3004.
-for 4 temperature and humidity (or binary switch) inputs.
Oh well, too late. Next time.
I’ll post a “Trio” PC board in the “project” section after testing.
-Gotta test!

It’s all good.
This circuit works like a champ!
I’ve already made a couple of’em.
As of this time- there is no “official” support on ESP units-
so…
I cannot (at this time) directly control
relay 2, 3 and 4 (GPIO 13, 14 and 16).

You CAN do a software work-around using VIRTUAL PINS,
(I wish someone could post the code for this @adam )

OR

you can reroute each transistor “base”
current limiting resistors
to GPIO 2, 4 and 5
without modifying any PC board traces.

Either method works.

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
//#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "qrm6a4rr6e";
// Your network name and password.
char ssid[] = "FBI Wiretap";
char password[] = "insanefun";

void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}

void loop()
{
  Cayenne.run();
}

The code is very simple. Just add a new widget for your device using virtual pin instead of digital/analog (ex. pin V0) and then use this in your code below the loop function:

CAYENNE_IN(V0){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
  Serial.println("Receiving Data");
  //code here

}

This didn’t work, @adam

 //#define CAYENNE_DEBUG         // Uncomment to show debug messages
    //#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
    #include "CayenneDefines.h"
    #include "BlynkSimpleEsp8266.h"
    #include "CayenneWiFiClient.h"

    // Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
    char token[] = "qrm6a4rr6e";
    // Your network name and password.
    char ssid[] = "FBI Wiretap";
    char password[] = "insanefun";

    void setup()
    {
      Serial.begin(9600);
      Cayenne.begin(token, ssid, password);
    }

    void loop()
    {
    CAYENNE_IN(V13){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
      Serial.println("Receiving Data");
      //code here
      Cayenne.run();
    }

Again- it didn’t work.
The “simple” is apparently to difficult for me. I’m not a coder.
I did add a virtual pin in the Cayenne device setup. (V13)

I understand that this may be too difficult a task for asking for help.
I need to address GPIO 13, 14 and 16-

Resolving this would engage a programmer for, -what…weeks? Months?
Why do I need a Serial.println(“Receiving Data”);

-you’d have to show me verbatim, concisely, what to do.
Like, show me the actual code.
I’m a custom homebuilder- not a programmer.

Definition of “Concise”
con·cise
kənˈsīs/Submit
adjective
giving a lot of information clearly and in a few words; brief but comprehensive.

Definition of “Verbatim”
ver·ba·tim
vərˈbādəm/
adverb & adjective
in exactly the same words as were used originally.

Try this:

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
//#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "qrm6a4rr6e";
// Your network name and password.
char ssid[] = "FBI Wiretap";
char password[] = "insanefun";

void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}

void loop()
{
  Cayenne.run();
}

CAYENNE_IN(V13){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
  Serial.println("Receiving Data");
  //code here - do whatever you want to do ex digitalWrite
  digitalWrite(13,!digitalRead(13));
}

CAYENNE_IN(V14){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
  Serial.println("Receiving Data");
  //code here - do whatever you want to do ex digitalWrite
  digitalWrite(14,!digitalRead(14));
}

CAYENNE_IN(V16){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
  Serial.println("Receiving Data");
  //code here - do whatever you want to do ex digitalWrite
  digitalWrite(16,!digitalRead(16));
}

I’ll try using your code to address gpio14 on the sonoff device, too!
Thanks!

i changed the current limiter resistors from 2.2k to 5.6k to allow V+ to go up to 36V without frying my 2N2222 s

I just got my re-supply of (10) Esp12-e units!

Happy happy!

Okay, I tried what you posted-

CAYENNE_IN(V13){ //Change V0 to whatever your virtual pin number is.  Create additional CAYENNE_IN functions for additional virtual pins
  Serial.println("Receiving Data");
  //code here - do whatever you want to do ex digitalWrite
  digitalWrite(13,!digitalRead(13));
}

But I don’t understand
"
code here - do whatever you want to do ex digitalWrite
digitalWrite(14,!digitalRead(14));
"
Can you show me an example of MAKING the ESP12-e
GPIO 14 as a digital INPUT ,
and
Making GPIO 16 a digital OUTPUT?

I tried cutting and pasting your code, but still I can’t add “virtual” pins 14, and 16.
After loading the code, I added the device to Cayenne, added virtual GPIO pin 14 as a digital input. It didn’t work.

Instead of CAYENNE_IN(V14) use CAYENNE_OUT(V14) and then send your data in that function. There are plenty of examples around here, one of them is here