Advertisement

Quick Links

Welcome!
Thank you for purchasing our AZ-Delivery Relay Shield for D1 Mini. On the
following pages, you will be introduced to how to use and set-up this handy
device.
Have fun!

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the D1 Mini and is the answer not in the manual?

Questions and answers

Summary of Contents for AZ-Delivery D1 Mini

  • Page 1 Welcome! Thank you for purchasing our AZ-Delivery Relay Shield for D1 Mini. On the following pages, you will be introduced to how to use and set-up this handy device. Have fun!
  • Page 2 Areas of application Education and teaching: Use in schools, universities and training institutions to teach the basics of electronics, programming and embedded systems. Research and development: Use in research and development projects to create prototypes and experiments in the fields of electronics and computer science. Prototype development: Use in the development and testing of new electronic circuits and devices.
  • Page 3 Note: Only mount the product on stable and flat surfaces. Use appropriate spacers and housings to minimize mechanical stress. Attention: Make sure the product is securely fastened to prevent accidental slipping or falling. Note: Use appropriate support or secure mounting in enclosures or on mounting plates. Attention: Use the product only with the specified vol- tages.
  • Page 4: Table Of Contents

    Table of Contents Introduction....................3 Introduction to ESP8266 and D1 Mini module..........5 Specifications of D1 Mini module...............6 Specifications of Relay shield................7 The pinout.....................8 How to set-up Arduino IDE................9 D1 Mini with Arduino IDE................13 Soldering.....................17 Connecting the Relay shield with D1 Mini...........19 Sketch example..................20...
  • Page 5: Introduction

    Introduction Relays are used to control AC circuits, switching them ON or OFF. The relay is one of the most important control elements. It is an electrical switch that responds to a signal received from the microcontroller (like in Atmega328p or Raspberry Pi). Relays are widely used in remote control, communications, mechatronics devices, power electronic devices, etc.
  • Page 6 On the DC side of the board there are two rows of 8 pins for connecting on the D1 Mini board. The shield uses 3.3V pin, GND pin and digital I/O pin 5 (labeled as D1, this is further explained later in the text). To change the state of the relay, change the sate of digital I/O pin 5.
  • Page 7: Introduction To Esp8266 And D1 Mini Module

    ESP8266. Also, the microUSB port provides a power supply for the module. There are different ways to program the D1 Mini module. If you have used Atmega328p boards before, then this is really easy for you. Just keep in...
  • Page 8: Specifications Of D1 Mini Module

    D1 Mini is a breakout board for the ESP8266 microcontroller. This board has CH340 USB to Serial chip that is used to program the ESP8266 microcontroller. Specifications of D1 Mini module Microcontroller: ESP8266 Operating voltage: 3.3V Digital I/O pins: 11, all support interrupt/pwm/I2C/1-wire (except D0) Analog input pins: 1 (Max input: 3.2V)
  • Page 9: Specifications Of Relay Shield

    Specifications of Relay shield » Maximum AC: 5A 50V » Maximum DC: 5A 30V » Contact Type: Both: Normally Closed – NC, Normally Opened - NO » Dimensions: 28 x 28 x 18mm [1.1 x 1.1 x 0.71in] - 7 -...
  • Page 10: The Pinout

    The pinout The pinout diagram is on the following image: Pin GPIO5 is the pin on which Relay input is connected. Changing the sate of the GPIO5 pin, the state of the relay can be changed. - 8 -...
  • Page 11: How To Set-Up Arduino Ide

    How to set-up Arduino IDE If the Arduino IDE is not installed, follow the link and download the installation file for the operating system of choice. For Windows users, double click on the downloaded .exe file and follow the instructions in the installation window. - 9 -...
  • Page 12 For Linux users, download a file with the extension .tar.xz, which has to be extracted. When it is extracted, go to the extracted directory and open the terminal in that directory. Two .sh scripts have to be executed, the first called arduino-linux-setup.sh and the second called install.sh.
  • Page 13 Almost all operating systems come with a text editor preinstalled (for example, Windows comes with Notepad, Linux Ubuntu comes with Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text editors are perfectly fine for the purpose of the eBook. Next thing is to check if your PC can detect an Atmega328p board.
  • Page 14 If the Arduino IDE is used on Windows, port names are as follows: For Linux users, for example port name is /dev/ttyUSBx, where x represents integer number between 0 and 9. - 12 -...
  • Page 15: D1 Mini With Arduino Ide

    D1 Mini with Arduino IDE To set-up the Arduino IDE so that the D1 Mini module can be programmed via the Arduino IDE, follow the next steps. First, install the ESP8266 core. To install it, open the Arduino IDE and go to: File >...
  • Page 16 If there are one or more links inside Additional URLs field, just add one comma after the last link, paste a new link after a comma and click the OK button. Then close the Arduino IDE. Open Arduino IDE again and go to: Tools >...
  • Page 17 The next step is to select the right board in the Arduino IDE. Open Arduino IDE and go to: Tools > Board > {board name} and select the first Generic ESP8266 Module as shown on the following image: - 15 -...
  • Page 18 After that, select the port on which the D1 Mini module board is connected. Go to: Tools > Port > {port name goes here} If the D1 Mini module board is connected on the USB port, there should be some port names. In this eBook the Arduino IDE is used on Windows, port names are as follows: For Linux users, port name is /dev/ttyUSBx for example, where “x”...
  • Page 19: Soldering

    The Relay shield comes with two male headers with eight pins. In order to connect Relay Shield with the D1 Mini module, first the headers of each board has to be soldered on the specific board.
  • Page 20 Next, solder male headers onto the Relay Shield, as shown on the following image: - 18 -...
  • Page 21: Connecting The Relay Shield With D1 Mini

    Connecting the Relay shield with D1 Mini Connect the Relay Shield with the D1 Mini module, as shown on the following image: - 19 -...
  • Page 22: Sketch Example

    LOW); delay(1000); Upload the sketch to the D1 Mini, the clicks from the relay can be heard. When the relay changes state from active to rest and vice versa, the switching clicks can be heard. The light bulb should blink every second.
  • Page 23 Change the NO/NC pin states by using the following lines of code: digitalWrite(RELAY_PIN, HIGH) - NC pin is not connected to the common pin - NO pin is connected to the common pin digitalWrite(RELAY_PIN, LOW) - NC pin is connected to the common pin - NO pin is not connected to the common pin - 21 -...
  • Page 24 If you are looking for the high quality microelectronics and accessories, AZ-Delivery Vertriebs GmbH is the right company to get them from. You will be provided with numerous application examples, full installation guides, eBooks, libraries and assistance from our technical experts.

Table of Contents