Understand the flow
It is important to understand the flow of Quick IoTs.
SENSOR DATA FLOW
- Device get data from sensors, send to MQTT server
- App server get data from MQTT server
- User use web browser, mobile to view data sent from sensors
GATEWAY DATA FLOW (IR, RF...)
- Users use web browser, mobile to send IR,RF.. code
- App server send these code to MQTT server
- Device get data from MQTT server, convert to IR code, RF code...
- IR code, RF code... send to other devices like TV, fans, light bulb to control. Eg, turn on/off
- MQTT like a big chatroom, devices send and receive message in a sub chatroom
- The best MQTT server is Mosquitto , download and install here.
- Default user and Password of Mosquitto is blank
- Supply user interface to web browser, mobile
- Base on Node-RED, we have Prebuilt Project to make a beautiful App for User in TWO click
Quick start #1
- Plug device, press Build & Upload
- Follow any advice (install Arduino IDE, board code...) until you could see black terminal show build is running
- Wait until finish. Open serial monitor to see device log
- If choose "Setup through Device wifi", connect to device wifi, open 192.168.4.1 and setup
Quick start #2
- Buy DHT11, plug to device (see below if you don't know how to plug)
- Build & Upload. Open serial monitor to see device log
- Open MQTT server, connect and see log of MQTT data
What I need to begin
To begin, you need to buy these thing
|A device: NodeMCU ESP8266, NodeMCU ESP32... Price and every info you need about device is here|
|Module: A sensor, Gateway.. To understand, lets begin with:
- First: Using Temperature and Humidity Sensor: DHT11
- Second: Using IR Receiver and Emitter, so you could control TV
|Cable to connect device and modules: You should buy all 03 type: Male-Male, Male-Female and Female-Female|
|A breadboard so we could put device and module on and most important
is to share power. Because the limit of VCC,GND on device (2 - 3), if we
cannot share VCC and GND, we only could plug maximum 2 - 3 module. In
short, breadboard work likes a mini
Learn how to use breadboard here. However when starting, if you are so confusing, just forget breadboard and connect cable directly from device to module
What is PIN, OUT, GND, VCC and How I plug/connect module
Understand PIN, GND, VCC... help you plug modules, sensors to device in 5 seconds.
- GND is cathode ( - ), VCC is anode (+). To power any module, we plug cable from GND on module/sensor to GND on device, VCC on module to VCC (5 Voltage) on device (or 3V if module required a 3V power)
- PIN: on device, PIN is where we connect cable. PIN is numbered 0,1,2,3 or label D1,D2,D3.. There is some special PIN label like: RX,TX, or HMISO... They are for special purpose and we will learn them when connect module.
- OUT/D0/D1/D2/A0: In module, you will see beside VCC, GND is many strange character: OUT/D0/D1/D2/A0 ....It mean you must connect this to PIN on device. Which PIN to connect need test and you cannot plug randomly to make module work. With Quick IoTs, we help you by specify what PIN the device connect to when activating module.
Temperature sensor (DHT11) with VCC,GND, OUT connect to device through breadboard
How do I send data from device to internet and display data in web/mobile
In flow, we use MQTT server to exchange data from device to user.
- Data send from device to MQTT, web/mobile app get data from MQTT to draw chart, value.
- User send data to MQTT (IR code, RF code), device get data and emit IR code, RF code to control TV, Lightbub, Air Conditioner
- The best MQTT server is Mosquitto , download and install here. Default user and Password of Mosquitto is blank
What is I2C