element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT: In the Cloud
  • Challenges & Projects
  • Project14
  • IoT: In the Cloud
  • More
  • Cancel
IoT: In the Cloud
Blog Basic IoT switches - flashing  SONOFF’s with Arduino IDE
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join IoT: In the Cloud to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: carmelito
  • Date Created: 8 May 2019 4:38 AM Date Created
  • Views 1916 views
  • Likes 3 likes
  • Comments 0 comments
  • iotcloudch
  • esp8266
  • project14
Related
Recommended

Basic IoT switches - flashing  SONOFF’s with Arduino IDE

carmelito
carmelito
8 May 2019

About a couple of months back a work buddy of mine, moved back to Canada and  gave me 4 Sonoff switches, he was using the Sonoff to control his lamps using the default sonoff mobile app. I dint want to use the mobile app, to send data to the cloud, and after a couple of search’s on the internet found they use an ESP8266, which means if you are able to locate the pads you can re-program it, to load your own firmware . On Github there are repositories which you can use to flash the Sonoff switches with a FTDI cable and the Arduino IDE, but before I get to using those I wanted to write a small webpage/web-server to flash the Sonoff, using the Arduino IDE. My goal with this project is to use all the 4 Sonoff’s that I have and connect them to 3 Lamps I have in my apartment, and have one connected to my old air conditioner in the apartment to switch it on at 5 PM in the evening if the temperature from the Openweather map API is greater than 80 F, so that it is nice an cool when I am back home.. In addition,  for master device I plan to either us Home-Assistant(https://www.home-assistant.io/) on a Raspberry Pi 3, with the Sonoff switches as MQTT client. OR use MKR WIFI 1010 as a MQTT server, with the Sonoff switches as MQTT client.

 

On inspection of the Sonoff, there are pins located at the back which you can use the flash the ESP8266, here is list of pins

  • GND
  • TX
  • RX
  • Vcc 3.3V
  • IO2

image

 

I soldered on some two pin headers, so that I can connect a FTDI cable with ease.

image

 

While flashing using the Arduino IDE, to place an ESP8266 into program mode, you will to follow the sequence of steps-

  • If you are connected AC power, disconnect before following the steps below
  • Connect FTDI cable to the soldered pin
  • Open the Arduino IDE on your computer
  • Hold down the tall switch and then connect the USB cable to your computer
  • Let go off the switch and upload the sketch using the Arduino IDE

image

Code and Video is still a work in progress…

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube