[Diao Ye learns programming] Arduino hands-on (175) --- Gizwits ESP8266 development board module 2

The reference to 37 sensors and actuators has been widely circulated on the Internet. In fact, there must be more than 37 sensor modules compatible with Arduino. In view of the fact that I have accumulated some sensor and actuator modules on hand, according to the concept of practicing true knowledge (must be done), for the purpose of learning and communication, I am going to try a series of experiments one by one, regardless of success (the program goes through) or not, They will be recorded - small progress or unsolvable problems, hoping to inspire others.

[Arduino] 168 kinds of sensor module series experiments (data code + simulation programming + graphics programming)
Experiment 175: ESP8266 Gizwits Cloud Development Board ESP12F wifi module (intelligent hardware development kit supporting cloud)

insert image description here
Knowledge points: Gizwits (www.gizwits.com)
Gizwits is the largest self-service development and cloud service platform for intelligent hardware in Asia. Its products and services cover main functions such as terminal management, connection management, application support and business analysis. Developers of the Internet of Things provide one-stop development tools for smart hardware and cloud operation and maintenance services, and provide IoT open source embedded code libraries, cloud API interfaces, and APP-side SDKs to facilitate secondary development for developers, and support public clouds and private clouds at the same time , hybrid cloud, and global deployment. It is currently the most mature IoT technology, the most complete cloud application function, the most mass-produced customers in the world, and the most popular mass-production-level intelligent hardware development and cloud service platform for IoT developers. It is recognized by the industry and the media. The first brand of third-party cloud services for the Internet of Things.

insert image description here

Arduino and Gizwits reached a strategic cooperation to jointly serve IoT developers
Beijing, September 20, 2016 /PRNewswire/ – On September 19, Arduino, a world-renowned open source hardware www.gizwits.com) officially reached an in-depth strategic cooperation. The two parties announced that they will carry out in-depth cooperation in the field of Internet of Things development and jointly provide tools, products and technical services for third-party developers. Arduino will provide Gizwits IoT hardware and related technical materials based on Arduino, and Gizwits will provide Arduino with self-service development platform tools and cloud services based on "Gizwits Cloud", as well as corresponding technical support and operation and maintenance guarantee.

The two parties have initially cooperated as early as 2014. The second-generation open source kit Gokit2.0 launched by Gizwits is already compatible with the Arduino Uno development board, and has widely served Arduino developers. With the growing demand for IoT development technology, Arduino has successively launched a series of new and upgraded products with built-in WiFi modules, such as Uno WiFi, Arduino Yun, Arduino Tian, ​​Arduino Primo, and Star OTTO. The in-depth cooperation between the two parties this time is based on the common goal of helping IoT development enthusiasts quickly enter into IoT development.

The two parties will start with the Arduino Uno WiFi, and gradually realize the cooperation of the whole line of products. Gizwits will provide Arduino with free development tools and cloud services needed by its developers. Developers can not only define the function data points of devices developed through Arduino through the Gizwits self-service development platform, but also realize the statistical analysis of Arduino devices’ networking data. Intelligent functions such as upgrade and remote control can also make full use of the full development capabilities of the Gizwits Cloud 4.0 platform such as the Gizwits Cloud 4.0 rule engine to configure device operating logic, develop cloud applications, and develop APPs. The two parties will jointly provide developers with one-stop IoT development tools and technical services.

Arduino focuses on the development of open source hardware, while Gizwits focuses on the cloud service development of intelligent hardware. Cooperation with Gizwits can expand the extension of Arduino at the product application level, allowing users to enjoy more data-based application services. Chen Yurong, managing director of Arduino China, said: "The Internet of Things will be the standard configuration of all smart hardware in the future. Arduino has been exploring how to provide an easy-to-use yet flexible and powerful IoT solution, so that makers and developers can easily integrate Connect your own works to the Internet and enjoy more possibilities brought by big data. This strategic cooperation between Arduino and Gizwits will combine their respective advantages and uphold the spirit of open source, so that this goal can be quickly realized.”

The cooperation between Gizwits and Arduino shows that the two teams are accelerating their strategic deployment in IoT. In this regard, Huang Zhuo, CEO of Gizwits Cloud, said that the next few years will be a period of rapid development in the field of IoT, and multi-party cooperation can promote the creation of an ecosystem of IoT developers. Resources and technological advantages, the conclusion of this cooperation will help both parties jointly develop IoT developers in the future, with mutual benefit and synergy.

insert image description here
Cloud Services
Cloud services are the growth, usage, and interaction patterns of Internet-based related services, usually involving the provision of dynamically scalable and often virtualized resources over the Internet. Cloud is a metaphor for network, internet. In the past, the cloud was often used to represent the telecommunications network in the figure, and later it was also used to represent the abstraction of the Internet and the underlying infrastructure. Cloud services refer to obtaining required services through the network in an on-demand and easy-to-expand manner. Such services can be IT and software, Internet related, or other services. It means that computing power can also be circulated as a commodity through the Internet. By having computation distributed across a large number of distributed computers rather than local computers or remote servers, enterprise data centers will behave more like the Internet. This enables enterprises to switch resources to required applications and access computers and storage systems as needed. It's like changing from the ancient single generator mode to the centralized power supply mode of the power plant. It means that computing power can also be circulated as a commodity, just like gas, water and electricity, easy to access and low cost. The biggest difference is that it is transmitted over the Internet.

insert image description here
ESP8266 Gizwits Cloud Development Board Module
(Official Introduction) This is a smart hardware development kit that supports the cloud. It is the simplest and most cost-effective IoT development board in history. It does not require you to understand the underlying complex knowledge of network, TCP/IP, HTP, and MQTT , as long as you know C voice, you can use Anxinke's Gizwits SDK to quickly realize secondary development. This DEMO board can use the mobile phone traffic to control the onboard RGB colorful lights, and the mobile APP can display the ambient brightness through the photoresistor. You only need to modify the code for half an hour to make a remote control device of your own. The system generates APP (Android, IOS) for free and opens the SDK. You only need to do the UI interface of the APP to develop a finished product. .

insert image description here
insert image description here
insert image description here
ESP8266
1. Low power consumption, highly integrated Wi-Fi chip
2. Only 7 components are required
3. Ultra-wide operating temperature range: -40°C to +125°C
4. ESP8285 - ESP8266 internally encapsulated 8 Mbit Flash
5. Highly integrated——ESP8266EX is the most integrated Wi-Fi chip in the industry, with a minimum package size of only 5mm x 5mm. ESP8266EX is highly integrated antenna switch, RF balun, power amplifier, low noise amplifier, filter and power management module, requiring only a few
circuits, which can minimize the occupied PCB space.
6. 32-bit Tensilica MCU - ESP8266EX built-in Tensilica L106 32-bit microcontroller (MCU), with ultra-low power consumption and 16-bit RSIC, the clock speed can reach up to 160 MHz. Support real-time operating system (RTOS), currently Wi-Fi protocol stack only uses 20% of MIPS, the rest can be used for user programming and development.
7. Low power consumption - ESP8266EX is specially designed for mobile devices, wearable electronic products and Internet of Things applications, and achieves the lowest power consumption through a number of proprietary technologies. ESP8266EX has three operating modes: active mode, sleep mode and deep sleep mode, which can prolong battery life.
8. Stable performance - ESP8266EX integrates more components, stable performance, easy to manufacture, and the operating temperature range reaches -40°C to +125°C.

insert image description here

This is a fully integrated ESP82666 development board, using the ESP-12F module.

The board has built-in RGB LEDs, buttons, and the ability to upload programs directly.

You can pretend to be a safe and reliable cloud service to develop, or you can develop it as an ESP82666.

Directly develop with Arduino IDE, please select "WeMos D1 R2 & Mini" for the board, and use it as D1 mini!

Because of the built-in RGB LED, photosensitive contact, and buttons, it is very suitable for teaching and does not need to be wired.

insert image description here

The ESP8266 Witty Cloud ESP-12F WiFi Module is a powerful WiFi processor integrated with RGB LED, LDR light sensor and button in a compact package for easy stand-alone operation.

Main Features
Microcontroller: ESP-8266 32-bit
Clock Speed: 80 / 160MHz
USB Converter: CH340
USB Connector: Micro USB
Operating Voltage: 3.3V
Flash Memory: 4 MB
Digital I/O: 11
Analog Input: 1
Communication: Serial OK, SPI. I2C and 1-Wire via software library
WiFi: Built-in 802.11 b/g/n
LED: Built-in RGB LED
Light sensor: Built-in LDR Photoresistor
Button: Built-in button
Programming: Compatible with Arduino IDE and NodeMCU
On-board LDR Light sensor
WS2812 On-board
3x Tactile buttons (1x on Witty board, 2x on CH340 board)
support 3 modes: AP, STA, AP+STA
Dimensions: 24mm x 16mm
Micro USB connection for power and/or programming

insert image description here
Aside from adding WiFi capabilities, the main advantage of the ESP8266 processor over the standard Arduino's AVR processor is that it has a larger 4 MB flash memory, runs at 80 MHz, and can sometimes optionally be overclocked to 160 MHz for faster processing speeds . These can be used as a standalone MCU in place of something like an Arduino, or as a peripheral with another MCU to provide WiFi functionality.

The module integrates several common components, including an RGB LED and an LDR photoresistor, making it more of a stand-alone device. It also contains a button that initiates some type of action.

The module consists of two stacked boards. The top board is the main processor board with the ESP8266 and the bottom board provides the USB interface. If desired, the top plate can be removed and used without the bottom plate once the module is programmed and the USB is no longer needed. Note that if the module is used without the backplane, the USB connector on the top board can optionally power the module, but it does not provide USB communication.

insert image description here
insert image description here
Digital Inputs/Outputs
All digital I/Os support PWM and interrupts except pin 16 which does not support interrupts. Additionally, they can be configured with pull-up or pull-down resistors. Although there are 11 digital I/O pins, if serial communication is used, typically 2 are reserved for TX/RX lines, leaving 9 digital I/O pins for other purposes. Some of these 9 pins are connected to onboard LEDs, but can be used for other purposes if desired.

The default PWM range is 0-1023, not the typical 0-255 on the Arduino. The range can be modified using the command analogWriteRange(255), which sets the range between 0-255.

The default PWM frequency is 1kHz. Similarly, it can be modified using analogWriteFreq(500), setting the frequency to 500 Hz as an example.

These pins are labeled GPIOx. When used with the Arduino IDE, the digital pin numbers are the same as the pin numbers, so GPIO2 is simply referenced as "2".

The small blue onboard LED is connected to pin 2 (GPIO2).

The onboard general purpose button on the top board is connected to pin 4 (GPIO4).

RGB LEDs are common-cathode, so they light up when driven high. It is connected to the following pins:

Pin 15 (GPIO15) = RGB Red LED
Pin 12 (GPIO12) = RGB Green LED
Pin13 (GPIO13) = RGB Blue LED
Digital I/O is limited to 3.3V by specification, but the manufacturer has stated that the digital pins actually are 5V tolerant and there are many installations that use modules that connect directly to the 5V MCU logic lines, so use your own judgment.

Analog Input/Output
Analog input A0 (ADC) is a 10-bit ADC input that is connected to an LDR (light dependent resistor).

The LDR has a dark resistance of approximately 2.5K and is placed in series with a 470 ohm resistor to form a voltage divider to power the ADC input. The LDR is connected to the Vcc side of the voltage divider with a 470 ohm resistor to ground. As the light intensity increases, the LDR resistance decreases, so the voltage on the ADC input increases.

By measuring the voltage, the relative brightness of the light falling on the sensor can be determined.

Powering the Module
The module can be powered from the USB port on the top or bottom board, or from an external 5V supply connected to the Vcc pin. The top module includes a 3.3V regulator that steps down the 5V to the 3.3V required by the ESP8266.

insert image description here

ESP8266 Witty Cloud ESP-12F WiFi module (Gizwits)
to build an Arduino development environment

In the preferences, add the development board manager address http://arduino.esp8266.com/stable/package_esp8266com_index.json

insert image description here

Open IDE——Development Board Manager——Search for ESP8266——Install

insert image description here
Development board selection - Adafruit Feather HUZZAH ESP8266

insert image description here

set up look

insert image description here

Found an electrical schematic

insert image description here
insert image description here
ESP-12F module

insert image description here
Floor plan

insert image description here
RGB LED: G segment (green) connects to GPIO pin 12, B segment (blue) connects to pin 13, R (red) connects to pin 15. Calling "digitalWrite()" before declaring them as OUTPUTS is sufficient to activate them.

LDR: This photoresistor is already mounted on the board and occupies the only Analog-to-Digital Converter (ADC) of our ESP8266 which is A0. The Arduino function "analogRead()" will allow us to know the sensor reading by returning a number in the range 0 - 1023 (10 bits), where 0 is darkness/penumbra and 1023 is maximum illumination.

Button: Connected to GPIO4, we can read its status using digitalRead() before declaring it as INPUT.

insert image description here

[Arduino] 168 kinds of sensor module series experiments (data code + simulation programming + graphics programming)
Experiment 175: ESP8266 Witty Cloud ESP-12F WiFi module Witty cloud development board ESP Witty
project 1: RGB LED colorful lights serial port printing light value

Experimental open source code

/*
  【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
  实验一百三十五: ESP8266 Witty Cloud ESP-12F WiFi模块 机智云开发板 ESP Witty
  项目一:RGB LED七彩灯 串口打印光线数值
*/

int rojo = 15;
int verde = 12;
int azul = 13;
int colores[] = {
    
    rojo, verde, azul};
int timeDelay = 200;

void setup() {
    
    
  Serial.begin(9600);
  pinMode(rojo, OUTPUT);
  pinMode(verde, OUTPUT);
  pinMode(azul, OUTPUT);
}

void loop() {
    
    
  Serial.println(analogRead(A0));

  for (int count = 0; count < 3; count++)
  {
    
    
    digitalWrite(colores[count], HIGH);
    delay(timeDelay);
  }
  for (int count = 0; count < 3; count++)
  {
    
    
    digitalWrite(colores[count], LOW);
    delay(timeDelay);
  }
}

Project 1: RGB LED colorful light serial port printing light value

Project serial port return status
insert image description here
Project 1: RGB LED colorful light serial port printing light value

Item serial plotter return

insert image description here

Arduino experiment scene diagram

insert image description here

Guess you like

Origin blog.csdn.net/weixin_41659040/article/details/131990645