element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • 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
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
Connected Cloud Challenge
  • Challenges & Projects
  • Design Challenges
  • Connected Cloud Challenge
  • More
  • Cancel
Connected Cloud Challenge
Blog Super Smart Home #2 The Door Opener
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: balearicdynamics
  • Date Created: 22 Apr 2020 3:40 PM Date Created
  • Views 1028 views
  • Likes 7 likes
  • Comments 11 comments
  • connected cloud challenge
  • raspberry pi 4b
  • arduino ide
  • door opener
  • elegoo
  • esp8266-01
  • digitspace
  • solenoid
Related
Recommended

Super Smart Home #2 The Door Opener

balearicdynamics
balearicdynamics
22 Apr 2020

  • Components
  • Developing on the ESP8266-01
    • A Simple Programmer Board
    • Testing the ESP8266-01
  • The Software
  • Full Content
      • Already Posted (until now)
      • Sources, Circuits, and Documentation
      • Thanks to

Components

A short foreword that will remain valid for all the other projects: it is my intention, all where possible, to make the projects of Super Smart Home fully functional and install them in the home where I live. According to the availability of the components, the first node I started to develop is the door opener.

imageimage

As shown in the above images I bought on Amazon en electromechanical door opener. It has the characteristics I need: strong and robust it is durable, can be operated by the outside with a conventional key too, and from the internal side, the opener button is mechanic. It works with 12V 2A and has an internal solenoid response time of 100 ms.

The impulse to the solenoid should be sent by a relay, so I decided that I will use an ESP8266 relay by Digispace (see the image below). It was also the first time I approached the ESP8266 features and programming, a good opportunity to learn something new.

image

 

Developing on the ESP8266-01

image

The ESP8266-01 is one of the smaller boards of the ESP family with only four GPIO pins (two of them are also used for serial TTL connection) but has a lot of powerful features on the WiFi side, as well as a considerable amount of memory. Thanks to the effort of the ESP8266 developer group and the popularity of the Arduino IDE it is possible to develop C software on this platform after installing the IDE extra component with the board manager (more details can be found on the ESP8266/Arduino GitHub repository). The issue I met was to find the right way to wire the microcontroller so it can be programmed with the Arduino IDE and a USB adapter on the computer.

To make a long story short, during the first week of tests I have found a series of issues that made me crazy (maybe more crazy!); the real problem is that you can find on the Internet an incredible quantity of different wiring schemes, circuits suggestions all partially working but not in a fully trustable way. After a first phase trying to keep my learning curve as short as possible, due to the few available time, below I list the most common issues experienced and in some cases the reason why:

 

  1. It is not possible to program the ESP8266-connected to the software serial. It works while using the AT commands but not for programming. The reason is that the software serial works at low speeds (the suggested speed is 9600 bps). Good for communicating but impossible to use for programming, where the requested speed is 115Kbps.
  2. Someone suggests so use a couple of resistors to step-down the signal voltage of the serial between the 5V TTL of the popular FTDI USB to Serial adapter and the 3V3 absolutely needed by the ESP board to avoid to damage it permanently. Actually it is not sufficient, it is a crap solution and this method works only sometimes. If choosing this way it is needed a real step-down adapter based on a chip or using a couple of NPN transistors.
  3. Someone suggests put the chip-enable pin to 3V3 and someone else to put to GND
  4. Someone advice to use a pulling resistor while others avoid it
  5. Someone ask to pull down or up the signals with a resistor

and more.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

A Simple Programmer Board

 

Without pretending to find the definitive solution, I have developed a small prototype programmer (it can be done more and more better) that works, accordingly to the specifications of the ESP8266-01 datasheet when it is set in programming mode.

Thanks to the USB to serial adapter from the Cypress PSoC 4 board it was possible to ignore the problem of the signal levels compatibility so only the USB 5V power line has been reduced with an LM1085, the last I have found here around.

image

The advantage of the LM1085 is that it already provides a regulated 3V3 voltage so no extra trimmer is needed. If I need other regulators for this project I will use one of the LM350 regulators that need a bit more complex circuit design. After excluding most of the suggestions found on the Internet I have designed the wiring scheme for the programming setup of the ESP8266-01 based on the datasheet details (attached to this post).

image

Tested on different machines the final version of the programmer worked fine. The below image shows the simple circuit I have used.

image

In the original circuit, I left the reset pin floating; as the reset is needed to reprogram the board I have added the temporary switch you see in the circuit.

As I tried to reset the ESP the USB was stopped working as it was identifying the reset button as a short circuit. an overcharge. After further investigations, thanks to the help of Jan Cumps and the time he spent with remotely a resistor before the GND solved definitely the problem.

 

Below: the first version of the ESP8266

imageimage

 

Testing the ESP8266-01

 

image

The first tests have been done using the bench power supply but I needed a more flexible method to follow the development lifecycle of the ESP, also considering that I plan to use more than one of them in the project nodes. As the Raspberry Pi 4B will be used as the desktop station to control the nodes and both signals and power voltage of the Pi works at 3V3 I decided to make a prototype Pi Shield for efficiently test the board, including the serial communication. Changing a while the programmer circuit I made the scheme shown below:

image

Note that the reset button does not need any resistor but – again after a long series of tests with Jan Cumps – I have added a jumper to enable or disable the serial connection between the Pi and the ESP, as well as a power switch. The creation of the prototype shield based on this circuit worked well but due to a latch-up condition on the Raspberry Pi, it is not possible hot powering the shield. Despite this detail, the ESP8266 can communicate with the Raspberry Pi Serial and is powered without difficulty.

imageimage

imageimage

The right procedure to plug and remove the board from the shield is the following:

 

To Remove the ESP8266

  1. Power off the switch on the shield
  2. Optionally disable the Serial Pi Tx signal (suggested)
  3. Remove the ESP8266

 

To Insert the ESP8266

  1. Shutdown the Raspberry Pi
  2. Insert the ESP8266 board
  3. Power on the board and also the Raspberry Pi will power on.

 

The Software

Modifying the classic Blink Led sketch for the ESP8266 I have tested the relay with a 100 ms pulse every 3 seconds.

 

/**
 * @file BlinkLED.ino
 * 
 */

void setup() {
  pinMode(0, OUTPUT);
}
void loop() {
  digitalWrite(0, HIGH);
  delay(3000); 
  digitalWrite(0, LOW);
  delay(100);
}

 

As the source above emits the pulse on the GPIO 0 connected to the relè I have used this to test the relay and door opening solenoid.

imageimage

In the next episode, we will see the integration of the door opener WiFi activated and the set up of the Raspberry Pi Control Center Desktop. Stay in touch!

Full Content

 

Already Posted (until now)

Super Smart Home #1 The project

Super Smart Home #2 The Door Opener

Super Smart Home #3 Designing the Control Center

Super Smart Home #4 Activating the Door Opener

Super Smart Home #5 Connecting the First Node to the Control Center

Super Smart Home #6 PSoC6 On the Cloud

Super Smart Home #7 From AWS IoT Core to AWS SiteWise

Super Smart Home #8 The Kitchen Node: Parts, Design and Components

Super Smart Home #9 The Kitchen Node: Circuit and Software

Super Smart Home #10 Building IoT nodes with PSoC6-WiFi-Bt and Mbed OS

Super Smart Home #11 Project Summary, Highlights, and More...

Super Smart Home #12 PSoC6 Local Node: Application Skeleton

Super Smart Home #13 PSoC6 Protection Case

 

Sources, Circuits, and Documentation

All the software sources, scripts, circuits schematics, and more are available as Open Source material on the SuperSmartHome GitHub repository.

The video episodes of this challenge are repurposed on the blog posts of the site we-are-borg.com

 

Thanks to

Element14, AWS, and Cypress, main sponsors

Elegoo for 3D printers ad printing material

Digitspace for sensors, actuators, and boards

The friends and community members Jan Cumps and shabaz always available with advice and suggestions.

Attachments:
imageESP8266 Datasheet.pdf
  • Sign in to reply

Top Comments

  • balearicdynamics
    balearicdynamics over 2 years ago in reply to dubbie +2
    Hi Dubbie, as much as things are small a powerful as much they are difficult to manage. But I never resign! The thing that really lost me a lot of time is the number of unverified instructions and indications…
  • yuricts
    yuricts over 2 years ago +2
    Another nice project... I really need more time... ;-)
  • balearicdynamics
    balearicdynamics over 2 years ago in reply to phoenixcomm +2
    phoenixcomm Cristina, the solenoid works at 12V. SO to power the entire door opener and the opposite side doorbell I have used a 600W ATX switching power supply. The solenoid in particular is operated…
  • balearicdynamics
    balearicdynamics over 2 years ago in reply to phoenixcomm

    phoenixcomm Cristina,

    the solenoid works at 12V. SO to power the entire door opener and the opposite side doorbell I have used a 600W ATX switching power supply. The solenoid in particular is operated by a relay connected to an ESP8266-01 implementing an SSL/TLS rest server managed by remoted (The Raspberry Pi control center for manual opening from my studio or the doorbel two-way password opener.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 2 years ago in reply to balearicdynamics

    balearicdynamics Enrico where do you get your power for the solenoid? In smarthab my power is from the door controller. If you have a keypad use one with RS-485 output to the controller. Then in the controller a relay is turned on and releases the strike!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 2 years ago in reply to phoenixcomm

    Sure it is inside! Outside there is just the keyhole, as any door. It is an industrial electric door lock I have hacked. And seeing it in reality it is very robust, surely more than my actual door locker. I have to complete also the doorbell before installing it at home. But all the appliances and stuff described in the project posts will be installed in my home.

     

    Enrico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 2 years ago in reply to balearicdynamics

    balearicdynamics  ie. then its on the inside? yes?  If you look at most "smart" locks today you will notice that the combo is on the outside!! One blow with a hammer then screwdriver to turn the mechanism

    ~~Cris.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • balearicdynamics
    balearicdynamics over 2 years ago in reply to yuricts

    Thank you Yuri! image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
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 © 2023 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube