logo
navigationGo.pngQuick Navigation
allprojects32.pngAll projects
hardware32.pngHardware
links32.pngLinks

favoriteStar32.pngTop projects
Alan numitron clock
Clapclap 2313/1386
SNES Pi Webserver
USB Volume/USB toys
Smokey amp
Laser cutter
WordClock
ardReveil v3
SNES Arcade cabinet
Game boy projects
cameleon
Home Presence Detector

github32.pngGitHub
AlanFromJapan

navigationMail.pngContact me

alanfjmail.png
3flags.pngWho's Alan?


Akizukidenshi
Elec-lab
Rand Nerd Tut
EEVblog
SpritesMods
Switch-science
Sparkfun
Suzusho
Datasheet Lib
Reddit Elec
Ermicro
Carnet du maker (fr)
Marutsu
ATmel blog (defunct)

sonoff

Sonoff from iTead.cc is a small box with an ESP8266, a transformer and a relay, 2 connectors for input and output AC, supports 110-220v AC and costs 5 USD on eBay! How to resist? Don't! Just buy it!

Presentation

Specification

  • Voltage range: 90-250v AC(50/60Hz)
  • Max current: 10A
  • Max Wattage: 2200 watts
  • Dimensions: 88*38*23mm (L*W*H)
  • Color: White
  • Humidity: 5%-95%
  • Frequency: 2.4Ghz
  • Working Temp: ﹣20℃-75℃
  • Schematics
  • Points of interrest

    An ESP8266 with transformer and realy for 5USD: do I need to say more??

    Review

    That has been done somewhere else on the net, just let me write down my thoughts about it.
    Positive points:
  • Very cheap (5USD) for what you get
  • The pads to upload your own code: that is superb foreward thinking! Many thanks.
  • Nice little box, with connectors. If you use the default app, nothing to solder.
  • General good quality for that price in that small form factor
  • Negative points:
  • Clearance between the pins of the AC connector: there's a nice wide gap, but they still seem a bit close-ish to me.
  • AC screw connector: couldn't they have made it a bit bigger? You can't use any wire size you'd find at home center, the bigger ones won't fit.
  • Edit: I tried with Ø 0.75mm (max 7A at 100V) wire it works just fine. I think it should work until Ø 1.6mm.
  • A little marking on the board and in the box for the "IN" / "OUT" would have been most welcome
  • Implementation

    How to program

    Wiring schematics is below: plug your 3.3v voltage converter, and hit upload in your Arduino:
  • Board = Generic ESP8266 module
  • Flash mode = DIO
  • Flash freq = 40MHz
  • CPU freq = 80MHz
  • Flash size = 512k (64k SPIFFS)
  • Upload speed : 115200

    1. Turn off the Sonoff
    2. Press the Sonoff button and stay pressed
    3. Turn on the Sonoff (with the 3.3v serial usb converter and NOT with the AC plugged of course. Seriously, don't be an idiot and do unplug the AC)
    4. Release the Sonoff button
    5. You're in programming mode now, and your Arduino IDE should do that for you as a charm

    Schematics


    Pinout (taken here)

    Source code

    On GitHub as usual, the "sonoff_"... projects.

    Important things to know:
  • LED is on pin 13
  • RELAY is on pin 12
  • One free GPIO is available on the board and it's pin 14
  • Pictures

    Links

    Helpful sources

  • This one is great: just read it! http://randomnerdtutorials.com/reprogram-sonoff-smart-switch-with-web-server/
  • Tackling that reconnection problem ? https://github.com/esp8266/Arduino/issues/2186
  • Inspiration

    All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated)
    electrogeek.cc ~ Formerly known as Kalshagar.wikispaces.com (AlanFromJapan [2009 - 2017])