Coder Social home page Coder Social logo

arniex / swifitch Goto Github PK

View Code? Open in Web Editor NEW
132.0 23.0 29.0 15.78 MB

Swifitch is ESP8266 based relay board that could be used to turn any light or any wall socket into smart one!

Home Page: http://www.swifitch.cz

License: Other

esp8266 arduino relay-board relay hardware open-hardware switch wifi iot iot-platform

swifitch's Introduction

Readme v Češtině

Table of contents

Introduction

What is it?

ESP8266 based WiFi enabled relay board, that will let you easily turn any light or any plug to SMART one. Easily control using HomeKit (other HW needed) or using any MQTT based SmartHome application. Or if you are skilled developer, write any code you want.

What can it do?

Main purpose is to turn things ON or OFF. But it can do lot more than that, swifitch is equiped with header to connect another 4 digital devices and 1 analog. These could be sensors etc.

If you need, by sacrificing one of the data pins, you can get 5V for your 5V sensors.

⛔ Be aware that swifitch's pins are not 5V tolerant and cannot accept 5V on any of the pins provided, and it will damage the ESP.

There are also two jumpers. One is for enabling deep sleep and the other is to put ESP into flash mode when you use conventional USB2UART programmer. We have reused one NodeMCU to make a lot more convenient programmer out of it, because it handles resets and flash mode boot automatically. Details will follow.

What is expected cost?

We have designed swifitch to be both cheap and safe. So it is not ultra cheap but not expensive too. Our cost calculations has stoped at $8! Not bad, what you think?

How does it look like?

Definitely beautiful!!

How big is it?

Actually very small, you should be able to fit it almost anywhere without any hassle. But I know, numbers tell it all, so here it is.

Width Height Depth Weight W/O BOX Weight W/ BOX
42mm / 1.65" 60.5mm / 2.36" 19.6mm / 0.77" ~42g / ~1.48oz ~72g / ~2.54oz

Is it safe?

We have designed few safety features in swifitch. Most important are fuses on mains input. There is one overcurrent fuse and one overvoltage fuse (surge protection), and more importantly temperature fuse that will disconnect swifitch from mains input when temperature raises above 100°C. There should be another few safeties in HLK-PM01 but we didn't want to depend on it's quality.

OK I'm sold! What do I need to build it?

Capacitors

Preview Part Buy
4.7μF 0805
100nF 0805
10nF 0805
47μF ⌀6.3x5mm
47nF X2

Resistors

Preview Part Buy
10kΩ 0805
1.5kΩ 0805
2.2kΩ 0805
47kΩ 0805
160Ω 1206
S10K275

Power and Controls

Preview Part Buy
SCHURTER MST 250VAC 500mA
PROFFUSE TZ-P100/2 100°C or similar
Hi-Link HLK-PM01 AC-DC 5V/3W
SRD-05VDC-SL-C Relay
FINDER 36.11.9.005.4011

Other SMD Parts

Preview Part Buy
BC817-16.215
BAS86
MCP1825T-3302E/DC Voltage Regulator
Ferrite Bead 600Ω 100MHz 0805
Any 0805 LED diode

Connectors

Preview Part Buy
Headers 1x2 2.54mm pitch
Headers 2x5 2.54mm pitch
Terminal 2P and 3P, 5.08mm pitch rounded lead

The rest

Preview Part Buy
ESP8266-12(E/F/S)
PCB

Most of it could be purchased on AliExpress or eBay for what we call "no money", some parts are safer to get from your local trusted electricians shop (fuse and relay if you do not want chinese).

Most AliExpress links in table above are tested and trusted sellers, but we do not give any guarantees.

TME.eu is good source for EU citizens and especially guys in Czech Republic.

Farnell should be OK for all over world.

SeeedStudio Fusion PCB

How to order PCBs

First grab gerber files ZIP and upload it to SeeedStudio Fusion PCB then follow instructions below.

We have created sreenshots from ordering process so you can recreate the process in same manner. Decide how many pieces you want and get started. Keep in mind that each board are actually two swifitches ;). That makes it even cheaper.

Gerber files preview:

After you build it

OK DONE! What's next?

Now you need to flash some software to it. Either use conventional CP2102 USB2UART programmer or build your own as we did from NodeMCU, it is definitely best option you have.

This image tell you all you need to know but basically this is the list of steps:

  • Desolder ESP8266 from NodeMCU (Heatgun baby!! But carefully you can use it for swifitch then.)
  • Solder colored wires to the contacts according to image below
  • Insert these wires to 2x5, 2.54mm pitch connector
  • Connect to swifitch and flash firmware

We have created software for you to get started quicky so go to it's own repository.

⚡ DO NOT CONNECT SWIFITCH TO MAINS VOLTAGE WHEN FLASHING ⚡

It should be safe, but we do not recommend it!

Software

Swifitch default software

If you went with our software you are good to go, just follow the README in the repository.

Custom software

Just few things you need to know if you develop your own software.

  • Relay is controled by D1 or GPIO5 PIN
  • Built in LED is controled by D6 or GPIO12 PIN

Enclosure

3D Printed

If you have access to 3D printer, have a look at our original swifitch box.

If you wish to design your own box and you use Fusion 360, here is 3D model of Swifitch.

Use ABS plastic filament as this device is using mains voltage and ABS is safer for such devices.

DO NOT USE CONDUCTIVE FILAMENTS

Purchased ABS box

We have fitted swifitch to box that can be purchased from various electrical shops. May not be available in all countries thought.

Soldering cheatsheet

Back side

Start with SMD parts on the BACK side.

Capacitors

Slot Part
C1 4.7μF
C3 4.7μF
C5 4.7μF
C6 4.7μF
C4 100nF
C7 100nF
C8 10nF

Resistors

Slot Part
R3 10kΩ
R4 10kΩ
R5 10kΩ
R6 10kΩ
R7 10kΩ
R8 2.2kΩ
R9 47kΩ
R10 160Ω
R11 160Ω

The rest

Slot Part
FB1 FB 600Ω 100MHz
D1 BAS86
T1 BC817
WiFi1 ESP8266-12(E/F/S)

Front side

Front side contains mostly THT parts, but start with SMD parts that would be harder to solder when you finish all bigger parts.

SMD

Slot Part
R1 470Ω < Rled < 2kΩ (depends on LED1)
LED1 Choose color you like
V1 Voltage Regulator

THT

Slot Part
DC1 HLK-PM01
F2 100°C fuse
R2 S10K275
F1 MST250/0.5A
C10 47nF
C2 47μF
C9 47μF
SB1 Optionaly enable D5 or 5V
JP1 1x2 header
JP2 1x2 header
J3 2x5 header
RE1 Relay
J1 2P terminal
J2 3P terminal

🎉 DONE 🎉

Credits

  • PCB design, electronics ideas, parts selection - Miroslav Batěk
  • SW, Git Repo, design, 3D printed enclosure - Martin Doubek

Mentions

Yellow Couch

Czech - with English subtitles

What's next?

If you liked swifitch and want to submerge deeper into IoT we will reference some other projects here.

IoT platforms and enablers.

Photos

swifitch's People

Contributors

arniex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swifitch's Issues

Altium Designer Library

Hi ArnieX,

First of all thank you for providing us with such a nice project. Excellent work! I want to add series of relay (6 no.) in my project. I tried loading the design files provided by you in Altium but I am not able to load exact footprints, symbols and 3D models. So will you please add these files in the repository so that I can use it for my project. It will be helpful for us in our projects. Pardon me if I have hurt your sentiments.

Best Regards,
Kool Engineer

Odpájanie od wifi

Ahoj,
postavil som si 2ks swifitchu a oba kúsky mi robia, že po nejakom čase sa odpoja od wifi a naspäť sa pripoja až po odpojení napájania. Odpája sa mi to cca po hodine možno aj skôr. Signál wifi mám dobrý. Nevieš poradiť kde by mohol byť problém?

PCB design in ascii format?

Hi,

I am trying to create and use a swifitch, this is an idea I already had in mind, and looking for an open source/hardware solution, I have arrived to your github repos. I think your solution is a really great solution, and a ready to use solution in a real scenario (not a prototype).

I am a software developper and my knowledge about hardware and soldering skill is limited. So I am trying to import your design in this site: https://easyeda.com. In this site you can design a circuit, choose the components, design a pcb and after that you can print the pcb and buy all the components easily (I am not sure if they also send you the pcb with the components assembled, that should be great). This way it will be super easy to buy all required components for N swifitchs.

This site (https://easyeda.com) supports importing an Altium project. I am trying this option, using your published design files, but I get following error:

Bad file format, ensure your file is Altium ASCII v5.0 format (*PCB/Schematic only*)

  1. Could you please add to the repo the design files in this format?
  2. Do you know an alternative site to mentioned one, that is compatible with your design files, to do the same thing: print the pcb and buy all the components at once
  3. The mentioned site also allows to share a design, it should be great that you publish your design (choosing the right components) in this site. While your are designing and choosing components you can get easily the BOM and the cost of all components to get an idea of total cost. I know that requesting this is too much, but I had to try!

Thank you very much for sharing this awesome project and making life easier to software developers with limited hardware knowledge but with great ideas.

Possible to have the SPI pins available

I really love this work. I have been looking for this diy-HW for a long time. Thank You.

I am interested in applying i2c and/or SPI sensors, displays etc.

Would it be possible to make al the pins available through headers?

Using swifitch with existing switches & 110v

Hi,

First of all, huge thanks for this awesome project!

I would like to try to install it behind existing light switches and rewire them so I can reuse the actual physical switch to control the lights + have the ability to do it remotely.

  1. It looks like the main component which would depend on the mains voltage is the Hi-Link HLK-PM01, and it seems that its compatible with both 220 and 110V. Do you know about any other components which may be affected? Can it be used in the US?

  2. Second question is regarding the physical switch. I read the firmware source code, and it looks like I can connect the 'analog' switch to D4... Have you tried to use it in a similar setup? I want to have both a physical switch + remote control.

  3. if the previous question is indeed possible, can you please explain how to wire it? I think it will be beneficial to add to Readme as well. (How to connect the existing switch to D4 so it acts as a button + connecting the mains to swifitch)

zapojenie swifitchu namiesto jednotlačítkového vypínača

Dobrý deň,
rád by som zapojil swifitch namiesto klasického jednotlačítkového vypínača, ktorý otvára a zatvára prívodný a odvodný kábel svetla. Je to možné? Lebo som si pozeral obrázok swifitchu a obávam sa, že swifitch potrebuje sólo dráhu napájania a následne spína/rozpína svetelný okruh.
Ak by sa to dalo zapojit úspešne aj do mojej kabeláže, bolo by to perfektné. ďakujem vopred za poradenie

PCB design files?

Hi!

Congrats for this project which looks very clean and well-designed. I was thinking of building something similar myself but I couldn't do it alone and it looks like you already did it!

I see your project is open hardware but I don't see any design files. Can you release them? I would love to add a second relay so that it could still fit into the wall and turn roller shutters up and down (requires two relays).

Another suggestions that comes to mind is to use a 220V - 3.3V AC-DC converter (such as this) with a 3V-switched relay and get rid of the voltage regulator, but probably 3V relays are not as popular as 5V ones.

Thanks :)

ESP8266 vs ESP12S

I have just realized that the link for the ESP8266 points to an ESP12S. This one (ESP12S has only connectors in both laterals only). Is this one compatible?

I have bought all the components following your links. Maybe aliexpress has changed the component?

(All the photos in your repo have swifitches using ESP8266)

Doubt

Hi,

The project is simply awesome and I'm in process of ordering the PCB's. However, I'm confused when you say "Keep in mind that each board are actually two swifitches ;) as there's only one relay or am I missing something.
Further, the analog switch function - does this mean I can use a conventional wall switch to control the load along with web control?
Thanks

Can swifitch relay work with DC?

I do not know if this is an stupid question. I would like to know if it is possible to power swifitch with AC and use the relay for a DC circuit.

I have a really simple intercom at home and I am wondering if I could use swifitch to bypass the button of the intercom. Could I power swifitch, puggling it to main current (220V AC), and use swifitch's relay to bypass the button of the intercom, which works with DC? (it has 8.8 V and 65 mA)

How to desolder ESP8266 from NodeMCU

My soldering/desoldering knowledge is very limited. How could I desolder ESP from NodeMCU?

Do you have any recommended tool? Do you have some tips? I have already tried with a normal soldering tool, and it seems impossible to me.

How to control multiple relays?

Thanks for sharing this good work. It is helpful.

Wondering if you have this design extended for controlling more than one relay. And also, how to make it work with dimmers etc (in the same board alongside with normal relays)?

Zmenšení (Swifitch Mini)

Ahoj,

v první řadě bych chtěl moc poděkovat za to, že takový projekt vůbec vznikl a byl dotažen do funkčního konce. Opravdu tleskám ve stoje a klobouk dolů. ESP8622 je prostě super chip a určitě si vaší variantu někdy zkusím sám sestavit.

U mě toto pobláznění vzniklo při koupi ESP8622 produktu Sonoff Basic, který je sám o sobě úplně o ničem, ale s vlastním firmwarem, mqtt, homebridge, HomeKit, Apple TV je to pro mě nejzajímavější produkt IoT historie. V ČR se dá koupit za 229,- (i s krabičkou 😉) z banggood za 109,- free ship👍🏻

A teď k podstatě této issue. Nejde ani tolik o to, že Sonoff vyjde levnějš a s vynaložením mnohem menšího úsilí(přidaná hodnota radosti z úspěchu sestavením vlastního ESP8622 spínače je nevyčíslitelná), ale Sonoff je prostě a jednoduše mnohem menší a většinou se vejde za běžní nástěnný vypínač(GPIO14 má samozřejmě taky).

Plánuje se varianta Swifitch Mini ?

Ještě jednou moc díky za vaší práci a přeji mnoho dalších úspěchů.

S pozdravem Standa ✋🏻

Fotky z mého flashování Sonoff Basic:
80c060bc-3905-4073-a1ae-27c16c6bc198
3a2881f4-3137-442c-9140-772b14a783c2
cb5d9ef3-ca65-47b0-b74c-c58ecac9eee1
924c0854-60f2-471a-8e13-a161233b0080
3b50c73d-d591-4882-a3f8-da951b715ad0
2442229d-e89f-403b-8cfb-92d5250f0755

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.