IOT - EFREI - M1 - 2020 - Toka Consulting
Our project is called The Infinity Glove. Our project consists of a glove thaht would allow physically handicaped people (or others) to use everyday technology on their own. By touching one of their fingers with their thumbs, they could access different commands (turn on/off a LED for example). On the dorsal side of the glove, LEDs would turn on when commands are launched in order to give a visual feedback to glove wielder. For the moment, we just have the proof of concept, so we control two different LEDs with our glove. To control the LEDs, we just have to connect our thumb with another finger on the glove.
Slides & Videos
Members
Name | Contribution |
---|---|
DAMASSE Thomas | Make video presentation Make power point presentation Research on technologies used Write report Work on software development ESP NOW connection part ESP Wifi Server connection part Work on software development |
CHAMPSAUR Lucas | Implementation of system Construction of prototype Research on technologies used Work on software development Make powerpoint presentation Make video presentation Fritzing to create schematics Montage construction Write report ESP32 server connection ESP NOW connection part |
State of the Art
Business Aspect
It’s human nature to find ways that make everyday life easier and more pleasant. This is where home automation idea comes in.
Home automation can also be called Smart home. Smart home means that there are the use of technical systems, automated processes and connected, remote-controlled devices in the house. The main objective is to improve the quality of life and convenience in the home. Controlling the garage door, the lights, the shutters, and even the coffee machine, the possibilities are vast.
To control these different ‘smart’ objects, you have to connect them to a device that can control them, it can be a phone, tablet, or a remote.
That’s why we had the idea to make a glove that can control the different ‘smart’ object. On the market, there are no equivalent product. So we proposed to you a revolutionary idea, although our product is not finished and can be improve.
The question that can be asked is how a glove better than a tablet or a remote ?
For the disabled people that can’t do a lot of movement with their hand, it is easier to use. Because to execute a task all they have to do is to create a contact between the thumb and another finger.
For the people in general, you can say that a tablet is better to control everything, however for simple task such as turning on and off the light a simple movement with the glove is easier. Nowadays, a lot of people doesn’t know how to use a tablet while with the glove it is more instinctive to use. So we can imagine that if our product is commercialized, it will be easier for the people to learn his functionment.
Moreover, we have an interface to see the different connected object around us and in which state they are in.
There are a lot of possibilities with this product.
Modeling of the system
Schema showing the functionment of the system. The essence of it.
Technical Aspect
Home automation technologies used
There are several technologies that can be used to control ‘connected’ objects. For our project we used the ESP NOW Protocol because with the materials that we had it was the best. Meaning that it has the more range and the best connection, compare to Wifi and Bluetooth Protocol with the ESP32.
Although for the final product and more budget, we can use better materials so the possibility of the different technologies is bigger.
Wifi
Using wifi network of the home. Wi-Fi is a power-hungry technology and this it drains the batteries of a battery-operated network faster in comparison to other protocols. Connecting multiple devices to the Wifi Network will make the response slower for the devices.
Bluetooth
Famous protocol used. It consumes less energy, and when it’s connected to multiple devices the connectivity feature stay the same. However, the connection is short.
Radiofrequency
One of the oldest protocol, to make it work you need a transmitter and a receiver. Only can do straight-forward solution, this protocol is outdated nowadays.
ZigBee
An advance protocol for home automation. It is connected through the radio frequency with complete wireless technology. It can control several devices at the same time, and it consumes few energy and eliminates the usage of battery.
Z-Wave
It is a procedure that is connected with the us of radiofrequency. It is an energy-saving solution with the Z-wave frequency used for the wireless devices.
Infrared
Most straight-forward protocol, it is used for one-way command (see remote control usage).
Li-fi
Wireless technology that use light to transmit data and position between devices. Li-Fi utilizes visible lights, infrared and ultraviolet instead of radio waves.
UPB
Protocol for power-line communication between devices. PLC carries data on a conductor that is also used simultaneously for AC electric power transmission or electric power distribution to consumers. Wiring are used to transmit data.
INSTEON
Hybrid protocol utilizing wireless and wires communication. All Insteon devices are repeaters of Insteon signals, which means the more devices installed in the home, the stronger the wireless network.
Thread
Project Description
Problem Definition
By creating such a connected object, it would allow handicaped people to interact with a house simply and efficiently. We can imagine that this glove could also interess other types of users in their everyday lives as it allows one to send commands to connected objects in a simple manner while also being able to monitor one's connected objects.
Challenges & Motivation
Real and Complete Usecases
Activity diagram of the basic scenario of the system (instead of use case).
Technical Description
Let us see how we created the infinity glove and the components that compose it. Let us see how these components act and interact, the step-by-step realisation of the project and the problems we faced.
COMPONENTS AND INTERACTION
The Infinity Glove project rests mainly on two ESP32 boards. As we had already used this component during the IoT labs, we knew that it had integrated WiFi. That is why we directly thougt of this component in particular to send data from the glove. (We used two ESP32 D1R32 so we had to install a driver on our laptops to use them.)
Picture of a ESP32 D1R32
As already said, our project is composed of two ESP32 boards: a master and a slave. The master board is the one situated on the glove. It communicates with the slave board that serves a coordinator for all the connected objects we want to send
commands to. In order to make the two boards communicate together, we used the protocol ESP32. The two boards act as WiFi stations when communicating. However, the slave board also serves as an access point for the user to monitor its connected objects.
Communication processes of The Infinity Glove
The ESP32 slave board receives packets from the ESP32 master board and hosts a web server at the same time. In order to send information to the web page, we use the Arduino_JSON library to create a JSON variable from the data received. In order to host the web server,
the slave board needs to connect to a local network: we used our phones’ mobile data during the project.
The ESP32 master board sends packets to the ESP32 slave board by pairing it as a peer. In order to do this, it uses the slave board’ MAC address.
STEP-BY-STEP CREATION
When designing the glove, we first wanted to create a glove with touch sensors at the tip of each finger. However, we thought that it would not have been very easy to manipulate so we came with another idea that is using the fingers in the glove as wire that would create open and closed circuits.
Once that we had designed our glove, we started the creation of the prototype by testing each functionnality one-by-one. Hence, we first assured that we could detect when the circuit was open/closed, and that we could use the opening or the closing of the circuit as a switch.
We then tried to make the ESP32 communicate together. We succeeded to make two ESP32 communicate with ESP-NOW quite quickly. We then added the web server connection in order to monitor what we were doing from a web page. We had some difficulties understanding how this was working at first. The real struggle we had for the communication of the ESP32 is that we wanted (at first) to make the glove communicate with several ESP32. If we managed to do such a thing, we did not manage to do this while also being able to monitor the commands sent by the glove from one web page.
Then we thought that it was more ergonomic to use one main slave ESP32 as a coordinator rather than several slave boards. We made this whole communication process for one finger (and thus only one command). We then added a new command (a new finger connection) to finish the communication and thus the testing part. We struggled to add the new command.
As we had made sure that everything was working, we started to implement our prototype on the glove. We designed a circuit that could work without any bread board and only with aluminum, while also fitting on one hand. The process of building the prototype on the glove was quite a difficult process as we had to make sure that our circuit was still working, holding in place, and connected to the slave ESP32 board.
One of the important problems we had to face during the creation of this project was to be forced to work remotly on the project.
Hardware
Materials
Schematic
Software
Arduino Code
// We used and modified some parts of the code accessible at this url : https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/ // We used and modified some parts of the code accessible at this url : https://randomnerdtutorials.com/esp32-esp-now-wi-fi-web-server/ #include#include #include "ESPAsyncWebServer.h" #include const char* ssid = "iPhone de Lucas"; const char* password = "huihui2em"; unsigned long previousMillis = 0; const long interval = 10000; unsigned int readingId = 0; constexpr char WIFI_SSID[] = "iPhone de Lucas"; typedef struct struct_message{ int ledSwitch; int readingId; int led; } struct_message; struct_message incomingReadings; JSONVar board; AsyncWebServer server(80); AsyncEventSource events("/events"); void OnDataRecv(const uint8_t * mac_addr, const uint8_t *incomingData, int len) { char macStr[18]; Serial.print("Packet received from: "); snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); Serial.println(macStr); memcpy(&incomingReadings, incomingData, sizeof(incomingReadings)); board["ledSwitch"] = String(incomingReadings.ledSwitch); board["readingId"] = String(incomingReadings.readingId); board["led"] = String(incomingReadings.led); String jsonString = JSON.stringify(board); events.send(jsonString.c_str(), "new_readings", millis()); Serial.printf("ledSwitch: %d \n", incomingReadings.ledSwitch); Serial.printf("readingID value: %d \n", incomingReadings.readingId); Serial.printf("command from finger: %d \n", incomingReadings.led); Serial.println(); if (incomingReadings.ledSwitch == 1 && incomingReadings.led == 16) { digitalWrite(16, HIGH); } else if (incomingReadings.ledSwitch == 1 && incomingReadings.led == 17) { digitalWrite(17, HIGH); } else if (incomingReadings.ledSwitch == 0 && incomingReadings.led == 16) { digitalWrite(16, LOW); } else if (incomingReadings.ledSwitch == 0 && incomingReadings.led == 17) { digitalWrite(17, LOW); } } const char index_html[] PROGMEM = R"rawliteral( ESP-NOW DASHBOARD ESP-NOW DASHBOARD
)rawliteral"; void setup() { Serial.begin(115200); pinMode(16, OUTPUT); pinMode(17, OUTPUT); WiFi.mode(WIFI_AP_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Setting as a Wi-Fi Station.."); } Serial.print("Station IP Address: "); Serial.println(WiFi.localIP()); Serial.print("Wi-Fi Channel: "); Serial.println(WiFi.channel()); if (esp_now_init() != ESP_OK) { Serial.println("Error initializing ESP-NOW"); return; } esp_now_register_recv_cb(OnDataRecv); server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ request->send_P(200, "text/html", index_html); }); events.onConnect([](AsyncEventSourceClient *client){ if(client->lastId()){ Serial.printf("Client reconnected! Last message ID that it got is: %u\n", client->lastId()); } client->send("hello!", NULL, millis(), 10000); }); server.addHandler(&events); server.begin(); } void loop() { static unsigned long lastEventTime = millis(); static const unsigned long EVENT_INTERVAL_MS = 5000; if ((millis() - lastEventTime) > EVENT_INTERVAL_MS) { events.send("ping",NULL,millis()); lastEventTime = millis(); } }GREEN LED
Reading ID:
BLUE LED
Reading ID:
// We used and modified some parts of the code accessible at this url : https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/ // We used and modified some parts of the code accessible at this url : https://randomnerdtutorials.com/esp32-esp-now-wi-fi-web-server/ #include#include #include uint8_t broadcastAddress[] = {0xF0, 0x08, 0xD1, 0xD8, 0x09, 0xE4}; typedef struct struct_message{ int ledSwitch; int readingId; int led; } struct_message; struct_message myData; unsigned long previousMillis = 0; const long interval = 1000; unsigned int readingId = 0; constexpr char WIFI_SSID[] = "iPhone de Lucas"; int32_t getWiFiChannel(const char *ssid) { if (int32_t n = WiFi.scanNetworks()) { for (uint8_t i=0; i = interval) { previousMillis = currentMillis; if (dReadContact(16)==0) { if (myData.ledSwitch==0) { myData.ledSwitch = 1; } else if (myData.ledSwitch==1) { myData.ledSwitch = 0; } myData.readingId = readingId++; myData.led = 16; } if (dReadContact(17)==0) { if (myData.ledSwitch==0) { myData.ledSwitch = 1; } else if (myData.ledSwitch==1) { myData.ledSwitch = 0; } myData.readingId = readingId++; myData.led = 17; } esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(struct_message)); if (result == ESP_OK) { Serial.println("Sent with success"); Serial.println(dReadContact(16)); Serial.println(dReadContact(17)); } else { Serial.println("Error sending the data"); } } }