Project tutorial
Fox Advisor

Fox Advisor © GPL3+

Smart Box to improve customer satisfaction in restaurants which allows clients to rate the service via Sigfox and ThingSpeak IoT platform

  • 3,855 views
  • 2 comments
  • 13 respects

Components and supplies

Abx00014 featured xjsqphgdlv
Arduino MKR Fox 1200
Core of Fox Advisor
×1
181 02
Adafruit Standard LCD - 16x2 White on Blue
Screen for communication
×1
Keypad
Keypad for interaction with customers
×1
Adafruit white led
For user-adjustable luminosity
×1
09939 01
Rotary potentiometer (generic)
20k potentiometer for luminosity adjustment
×1
Fairchild semiconductor pn2222abu. image
General Purpose Transistor NPN
For Arduino-based LED strip regulation
×1
Mfr 25frf52 1k sml
Resistor 1k ohm
×4
Mfr 25fbf52 221r sml
Resistor 221 ohm
×1
9V alkaline
×1
09264 1
RGB Diffused Common Cathode
Diet indication LED
×1
09590 01
LED (generic)
Peronnel calling LED (green)
×1
Mydigital protoboard box 600  45096.1449790643.500.659
Digilent myDigital Protoboard for NI myDAQ & myRIO
×1
11026 02
Jumper wires (generic)
×1

Necessary tools and machines

09507 01
Soldering iron (generic)
3drag
3D Printer (generic)

Apps and online services

About this project

Fox Advisor: a rating a day keeps the failure away

Fox Advisor is a Sigfox-based project to be used in restaurants and franchises. It consists of a Smart Box (governed by Arduino MKR FOX 1200) installed in the centre of the table which improves the customer satisfaction by enabling direct feedback from clients to restaurant managers and other possible clients on the Internet. Fox Advisor uses the global Sigfox Network to send customers’ ratings to Sigfox-backend and, there, a custom HTTP callback sends these data to ThingSpeak IoT platform, incluying relevant information such as restaurant identifier or location.

Benefits for customers and restaurants

The most remarkable advantages of Fox Advisor are:

  • 140 packets per table is more than sufficient to send the variety of customer feedback generated along a whole day. Sigfox can increase the added value of the restaurant thanks to its low power consumption.
  • Sigfox provides global coverage for entire countries, which allows restaurants located in both urban and rural areas to use the Fox Advisor rating platform with no wireless constraints.
  • A straightforward interface allows customers to cooperate with the Smart Table, being able to control specific parameters of the table such as luminosity. ThingSpeak provides a visual interface to store the opinion of each customer.
  • This project encourages socially-sustainable businesses thanks to the allergy indication RGB LED, among others. It maintains the personnel informed about customers’ special requirements with no need to make them feel uncomfortable talking about food intolerances. Additionally, clients can press a simple button to activate the notification LED and receive assistance from the personnel, ask for the check, etc.

How does it work?

Eating in a restaurant never was that funny! Improve user experience using Fox Advisor. It consists of a Smart Box located in the centre of a table, specifically developed to be used in restaurants and franchises. The following functionalities have been developed:

  • Light adjustment: customers have a straightforward interface to control a LED strip and adapt the light level of their table.
  • Allergy indication: each Smart Table includes a RGB LED which allows them to indicate any kind of allergy or intolerance. Through the panel, each customer can select a kind of special diet and a RGB LED will be immediately switched on to advise the personnel of the restaurant with no need to provide additional explanations. The colour code for diet requirements is: pink (gluten-free), blue (lactose-free), orange (sugar-free), yellow (vegetarian) and green (vegan).
  • Staff notification: customers can press a button to switch on the red LED of the table, which will trigger an alarm to notify the restaurant staff about a special request.
  • Rating: customers are able to rate the restaurant using the panel located at the centre of the table by answering three short questions: Service quality (0-5), Food quality (0-5), Did you enjoy? (0-5). The results are sent to Sigfox-backend and, there, a custom HTTP callback sends them to ThingSpeak IoT platform to provide a visual statistic representing the opinion of the last customers.

A post-it with the instructions of Fox Advisor is shown below:

Step #1: Hardware

Once we know what Fox Advisor is and its main functionalities, let's have fun! In a few steps we'll see how to build the initial prototype, including all the parts and leaving apart the 3D design for the following steps.

I) Setting up the MKR FOX 1200, LCD and keypad

Firstly, connect the 4x4 keypad and the 16x2 LCD according to the schematics provided. It's important to test how it works once every component is included to facilitate the assembly and to avoid confusing mistakes.

The wires used in the LCD must be as long as possible (at least as the ones shown in the picture below) because the LCD will be the highest part of the device once the 3D housing is included.

Note: it's not recommended to connect the board without having connected the antenna before.

II) Connecting the LED strip and notification LEDs

Then, we will include in the first place the indication LEDs (in the initial prototype I used a red LED and a RGB LED board, but I changed them later in order to make them fit with my 3D design, you can use any generic LED). The resistors were 1kΩ, three for the RGB and one for the red one. Refer to the schematics for more details.

Now it's time to use the LED strip. I obtained the one of the picture (1 meter long) for 5 € approximatelly, so it's not too expensive. You'll see that the one used in the schematics is RGB, don't worry because you can use the scheme connections considering that this one has only two terminals. Additionally, we'll need a generic NPN transistor with a potentiometer to control light intensity from Arduino board and a 9-12V battery.

To start with the LED strip, cut it at the length you want (35 cm for the 3D design of Fox Advisor) and try to cut a small area of silicone to leave the soldering terminals free of silicone (see the set of pictures below). Then, solder the terminals with not necessarily long wires.

We use the NPN transistor to control the light intensity from the Arduino I/O pins. The potentiometer varies the resistance value at this point and, thus, the voltage sent to Arduino. Once Arduino receives the voltage level at pin A6, we use the A5 pin to generate an equivalent voltage level and apply it to the base of the NPN, which amplifies the current provided to the LED strip. (Refer to the schematics for more detail).

III) Initial Fox Advisor prototype

Once followed the previous steps, we have our initial prototype complete! Test the code and verify it works to continue with the following software steps.

Step #2: Arduino Software

We'll need to include the libraries for the Arduino MKR FOX 1200 board. We can find them directly in the sketch menu of Arduino IDE. In case they're not present, we can include them using the libraries manager.

Then, select the board in the tools menu:

And repeat the previous steps to include the following libraries:

<LiquidCrystal.h>

<Keypad.h>

The complete source code is provided below, but here I leave a short description of the blocks that have been programmed:

There is an initialization of the LCD according to the Arduino pins where we've connected it. In this case the parameters are: (0, 1, 2, 3, 4, 5). Regarding the keypad, we have defined the rows and columns and connected it to digital 6, 7, 8, 9, 10, 11, 12 and 13 Arduino pins.

Then, in the set up block we will define the inputs, outputs and finally the default message to be shown by the LCD. In this case:

* FoxAdvisor * Can we help you?

The loop function has an event listener to identify any pressed key and manages the state of the LED strip through A5 and A6 pins. Once any key is pressed, a different routine is defined to be executed.

Keys B and C activate a LED in order to notify different aspects. Key D asks the customer to introduce any special diet requirement (using the RGB indicatino LED) and keys * and A are used to rate the restaurant. Once the restaurant has been rated, a structure containing the following information is sent via Sigfox:

Restaurant ID, table ID, diet ID, question 1, question 2, question 3

Step #3: ThingSpeak

ThingSpeak is an open IoT platform based on MATLAB analytics which matches perfectly with Sigfox technology. Is brings you the opportunity to receive custom HTTP callbacks from Sigfox backend (in Step #4 we'll analyse this step deeper) and the knowledge required for this is not too demanding. The network architecture I've used for Fox Advisor proposal is shown below:

We will start by creating a new account (I use a student license provided by the University of Castilla-La Mancha, Spain). Once we have the account, we will continue creating a new channel, which refers to the main dashboard that will show data. The channel can be private or publicly accessible, I preferred to make it public so that it can be shared here.

When you create the channel, tou'll be asked to fill the fields with the data we want to receive from Sigfox-backend (in this case we need the restaurant ID, table ID, diet requirements, and the opinion from customers stored in questions 1, 2 and 3). The channed ID will be assigned automatically.

For additional information, check the official documentation by clicking here.

To finish with ThingSpeak, in the API KEYS tab we have the private keys for our channel. Don't share these keys. We’ll use the WRITE API KEY to send data from Sigfox-backend to ThingSpeak, so copy the key for the following steps.

Step #4: Sigfox-backend

Once we have our ThingSpeak account and channel and Arduino programmed, let's contiinue by creating a new account and activating the Sigfox device. For this, click and select a provider (Arduino) and your country.

The next step is to introduce the ID and PAC codes. You'll find them in the Serial console of Arduino IDE, by executing the FirstConfiguration.ino example of the <SigFox.h> library.

Finally, if you don't have an account, you'll be able to create it in this step so that you registered device is associated with your user account.

Done! Now we have a Sigfox-backend account. It’s time to configure messages in order to be able to receive information in ThingSpeak platform. For this, once we log in we have access to the Sigfox dashboard, where we'll click on device and, then, device type.

Then, on the left-hand menu click 'callbacks' and create a 'custom callback'.

According to ThingSpeak API, we'll define the callback so that every field defined in our structure is sent via HTTP to ThingSpeak everytime a client rates our restaurant. This is the configuration I used:

Type: DATA, UPLINK
Channel: URL
Custom payload config: restaurantID::uint:8 tableID::uint:8 allergy::uint:8 question1::uint:8 question2::uint:8 question3::uint:8
URL pattern: 
Use HTTP method: POST
Content type: application/x-www-form-urlencoded

Step #5: Data visualization

Finally, we'll test the complete system by rating the restaurant and verifying how the message is sent to Sigfox-backend and how the callback succeeds to send these data to ThingSpeak.

The response of the callback will be shown near every message sent at Sigfox-backend, and it should be something like this:

If we open our ThingSpeak channel, we'll find the data of the questionnaires represented in a column chart. We could also have the ID of the restaurant, the table or even the diet requirements (in case there are) because we're sending this information in each packet. Although, I didn't consider it necessary for the demo, take into account that you'll have access to all the information in ThingSpeak.

ThingSpeak gives us also the chance to program data visualization using MATLAB functions, so we'll complete the dashboard by including a custom program which shows the overall rating of clients in a scale 0-100% (using the previous questionnaire answers). For this, go to Apps -> MATLAB Visualizations -> new and paste the following MATLAB script:

% Celia Garrido-Hidalgo
% Channel ID to read data from 
readChannelID = 357609; 
question1 = 4; 
question2 = 5; 
question3 = 6; 
% Channel Read API Key  
% If your channel is private, then enter the read API 
% Key between the '' below:  
readAPIKey = 'WRITEHEREYOURKEY'; 
question1Data = thingSpeakRead(readChannelID, 'Fields', question1, 'NumPoints', 5, 'ReadKey', readAPIKey); 
question2Data = thingSpeakRead(readChannelID, 'Fields', question2, 'NumPoints', 5, 'ReadKey', readAPIKey); 
question3Data = thingSpeakRead(readChannelID, 'Fields', question3, 'NumPoints', 5, 'ReadKey', readAPIKey); 
bar(1:5, 33.33/5*[question1Data question2Data question3Data], 0.5, 'stack') 
axis([0 6 0 100]) 
title('Customer satisfaction') 
xlabel('Customer ID') 
ylabel('Satisfaction (%)') 
legend('Service quality', 'Food quality', 'Did you enjoy?')  

The output of the script is also public, so you can ckeck it here. The initial three charts including questionnaire answers are dynamically refreshed, but the Matlab script must be refreshed manually once we log into the channel (which is not a considerable problem). Once we execute the script and include it to our channel, we'll see something like this:

To finish, we'll enable location in the dashboard.

Schematics

These are the schematics of the project using Fritzing. note that the 4x4 keypad model does not exactly correspond to the one I used, but the connections are still the same. Something similar happens with the LED, I used a RGB model for the schematics but the one I used in Fox Advisor is white.

3D design

To finish, I designed a 3D model for the device, including the holes for the LCD, keypad, potentiometer and LED strip. The design is shown below and the original files can be downloaded and edited here and here.

Additionally, I included a tiny box in order to build a usefull objet for the table of the restaurant, where clients can access to napkins, ketchup, salt, etc.

To print the design I used red PLA, the resulting part is shown in the pictures below, where the assembly of all components described for the initial prototype has been done:

Video demonstration

Do you need more detail about how Fox Advisor works and the steps to build it? See the video below ;)

Fox Advisor assembly and demo

Code

Fox Advisor codeArduino
This code includes LCD, keypad and MKRFox1200 board to build a Smart Table able to interact with customers in restaurants: Fox Advisor.
/*Developed by Celia Garrido Hidalgo - FoxAdvisor: a rating a day keeps the failure away (with MKRFox1200)

   This code includes LCD, keypad and MKRFox1200 board to build a Smart Table able to interact with customers in restaurants.

 *  ************************** INSTRUCTIONS **************************
   //             Press (A)dvance to next question.                  //
   //             Press (B)ill to request the check.                 //
   //             Press (C)all to ask for assistance.                //
   //             Press (D)iet for special requirements.             //
   //               (1) = Gluten-free                                //
   //               (2) = Lactose-free                               //
   //               (3) = Sugar-free                                 //
   //               (4) = Vegetarian                                 //
   //               (5) = Vegan                                      //
   //               (0) = Other                                      //
   //             Press (*) to rate our restaurant.                  //
 *  ******************************************************************

   Useful libraries and examples:
    Sigfox:
      SendBoolean.ino (from <SigFox.h>)
      WeatherMonitor.ino (from <SigFox.h>)
    LCD:
      HelloWorld.ino (from <LiquidCrystal.h>)
    Keypad:
      EventKeypad.ino (from <Keypad.h>)

   Ratings from customers are sent to Sigfox Backend and an HTTP callback sends    the results to ThingSpeak cloud using:
    Custom payload config:
      restaurantID::uint:8 tableID::uint:8 allergy::uint:8 question1::uint:8          question2::uint:8 question3::uint:8
    URL pattern:
      http://api.thingspeak.com/update?api_key=yourapikeyhere&field1={customData#restaurantID}&field2={customData#tableID}&field3={customData#allergy}&field4={customData#question1}&field5={customData#question2}&field6={customData#question3}
*/

/************ LIBRARIES ************/

#include <LiquidCrystal.h>
#include <Keypad.h>
#include <SigFox.h>


/************ VARIABLES ************/

int RED = A1;
int GREEN = A2;
int BLUE = A3; // RGB LED
int questionNumber = 0; // Counter to check the current question asked
String question1 = "Service quality";
String question2 = "Food quality";
String question3 = "Did you enjoy?";
String range = "from 0 to 5: ";
boolean myFlags[] = {false, false}; // {Diet, Rating}

const byte ROWS = 4; // KeyPad: Four rows
const byte COLS = 4; // KeyPad: Four columns

char keys[ROWS][COLS] = { // Keys definition
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

typedef struct __attribute__ ((packed)) sigfox_message { // Structure to store information to be sent to sigfox-backend
  uint8_t restaurantID = 103; // Default
  uint8_t tableID = 7; // Default
  uint8_t allergy;
  uint8_t q1;
  uint8_t q2;
  uint8_t q3;
} SigfoxMessage;

SigfoxMessage msg; // Stub for message which will be sent


/********* INITIALIZATIONS *********/

LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

byte rowPins[ROWS] = {13, 12, 11, 10}; // Pin connections for the keypad (ROWS)
byte colPins[COLS] = {9, 8, 7, 6}; // Pin connections for the keypad (ROWS)

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


/************* SET UP *************/

void setup() {
  if (!SigFox.begin()) {
    // Something is wrong
  }

  SigFox.end(); // Send module to standby until we need to send a message
  SigFox.debug(); // Important (for more information check the Forum http://forum.arduino.cc/index.php?topic=478950.0;nowap)

  lcd.begin(16, 2); // Setting up the LCD's number of columns and rows

  pinMode(14, OUTPUT); // Red LED to call for assitance
  pinMode(RED, OUTPUT); // RGB (red color)
  pinMode(GREEN, OUTPUT); // RGB (green color)
  pinMode(BLUE, OUTPUT); // RGB (blue color)

  pinMode(A5, OUTPUT); // To control the LED strip

  for (int i = 0; i < 3; i++) { // Display "Welcome" message
    lcd.print("    Welcome!");
    delay(500);
    lcd.clear();
    delay(500);
    lcd.setCursor(0, 0);
  }

  lcd.print(" * FoxAdvisor *"); // Default message
  lcd.setCursor(0, 1);
  lcd.print("Can we help you?");
  keypad.addEventListener(keypadEvent); // Add an event listener for this keypad
}


/************* LOOP *************/

void loop() {
  char key = keypad.getKey();
  int rVal = analogRead(A6) / 4; // Read potentiometer voltage
  Serial.println(rVal); // Apply NPN voltage to control the LED strip
  analogWrite(A5, rVal);
}


/************ EVENTS ************/

void keypadEvent(KeypadEvent key) {
  int myCol = 0; // Column to write in the LCD
  int i;

  if (keypad.getState() == PRESSED) { // Once pressed any key...

    switch (key) {
      case 'A': /*************************   A   *************************/
        if (questionNumber == 1) { // If we were in question 1, go to question 2
          lcd.clear();
          lcd.setCursor(0, 0);
          lcd.print(question2);
          lcd.setCursor(0, 1);
          lcd.print(range);
        }

        else if (questionNumber == 2) { // If we were in question 2, go to question 3
          lcd.clear();
          lcd.setCursor(0, 0);
          lcd.print(question3);
          lcd.setCursor(0, 1);
          lcd.print(range);
        }

        else if (questionNumber == 3) { // If we were in question 3, send packet via Sigfox
          for (i = 0; i < 3; i++) {
            lcd.clear();
            lcd.setCursor(0, 0);
            lcd.print("Sending result");
            lcd.setCursor(0, 1);
            lcd.print("via Sigfox");

            for (myCol = 10; myCol < 16; myCol++) {
              delay(150);
              lcd.setCursor(myCol, 1);
              lcd.print('.');
            }
          }

          SigFox.begin(); // Wait at least 30ms after first configuration (100ms before)
          delay(100);
          SigFox.status();
          delay(1);
          SigFox.beginPacket(); // Sending packet via Sigfox
          SigFox.write((uint8_t*)&msg, 6);
          SigFox.endPacket(); // We finish the packet
          SigFox.end();

          lcd.clear(); // Say goodbye to customers
          delay(50);
          lcd.setCursor(0, 0);
          lcd.print("    Done! ;)  ");
          lcd.setCursor(0, 1);
          lcd.print("Have a nice day!");

          delay(8000); // Wait 8 seconds...
          lcd.clear();
          lcd.print(" * FoxAdvisor *"); // Receive new customers
          lcd.setCursor(0, 1);
          lcd.print("Can we help you?");
          questionNumber == 0;
        }

        break;

      case 'B':  /*************************   B   *************************/
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("- Bill request -");
        lcd.setCursor(0, 1);
        lcd.print("Press *, please");

        for (i = 0; i < 3; i++) { // Turn on notification LED to call the personnel and request the bill. In the meantime, fulfill the questionnaire
          digitalWrite(14, LOW);
          delay(500);
          digitalWrite(14, HIGH);
          delay(500);
        }

        delay(2000);
        lcd.clear();
        lcd.print(" * FoxAdvisor *");
        lcd.setCursor(0, 1);
        lcd.print("Can we help you?");
        break;

      case 'C':  /*************************   C   *************************/
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("We'll be here");
        lcd.setCursor(0, 1);
        lcd.print("in a moment!");

        for (i = 0; i < 3; i++) { // Turn on notification LED to call the personnel
          digitalWrite(14, LOW);
          delay(500);
          digitalWrite(14, HIGH);
          delay(500);
        }

        delay(2000);
        lcd.clear();
        lcd.print(" * FoxAdvisor *");
        lcd.setCursor(0, 1);
        lcd.print("Can we help you?");

        break;

      case 'D':  /*************************   D   *************************/
        lcd.clear();
        lcd.setCursor(myCol, 0);
        lcd.print("Special diet");
        lcd.setCursor(myCol, 1);
        lcd.print("requirements");

        for (myCol = 12; myCol < 16; myCol++) {
          delay(200);
          lcd.setCursor(myCol, 1);
          lcd.print('.');
        }

        delay(1000);
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Select option:");
        myFlags[0] = true; // Activate the diet flag.

        break;

      case '*': // Let's rate the restaurant!
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Great! Let's");
        lcd.setCursor(0, 1);
        lcd.print("start");

        for (myCol = 5; myCol < 16; myCol++) {
          delay(150);
          lcd.setCursor(myCol, 1);
          lcd.print('.');
        }

        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print(question1); // Asking question 1...
        lcd.setCursor(0, 1);
        lcd.print(range);

        break;

      case '#': // Nothing happens

        break;

      default: // For the numeric values of the keypad

        if (key > '5') { // The value specified is out of range
          for (i = 0; i < 3; i++) {
            lcd.clear();
            delay(500);
            lcd.setCursor(0, 0);
            lcd.print("Out of range 0-5");
            delay(500);
          }

          if (myFlags[0]) { // If we were asking for diet requirements...
            lcd.clear();
            lcd.setCursor(0, 0);
            lcd.print("Select option:");
          }

          else if (myFlags[1]) { // If we were asking for any question of the questionnaire...

            switch (questionNumber) { // Where are we?
              case 0:
                lcd.clear();
                lcd.setCursor(0, 0);
                lcd.print(question1); // Question 1
                lcd.setCursor(0, 1);
                lcd.print(range);
                break;

              case 1:
                lcd.clear();
                lcd.setCursor(0, 0);
                lcd.print(question2); // Question 2
                lcd.setCursor(0, 1);
                lcd.print(range);
                break;

              case 2:
                lcd.clear();
                lcd.setCursor(0, 0);
                lcd.print(question3); // Question 3
                lcd.setCursor(0, 1);
                lcd.print(range);
                break;
            }
          }
          break;
        }

        if (myFlags[0]) { // Special diet requirements
          lcd.setCursor(15, 0);
          lcd.print((char)key);
          myFlags[0] = false; // Clear the diet flag.
          delay(500);

          for (myCol = 0; myCol < 16; myCol++) {
            lcd.setCursor(myCol, 1);
            lcd.print('.');
            delay(80);
          }

          lcd.setCursor(0, 1);
          lcd.print("   Got it! ;)   ");
          analogWrite(RED, 0); // Switch off the RGB LED just in case
          analogWrite(GREEN, 0);
          analogWrite(BLUE, 0);

          switch (key) {
            case '1': // Gluten-free
              analogWrite(RED, 255);
              analogWrite(GREEN, 71);
              analogWrite(BLUE, 92);
              msg.allergy = 1;
              break;

            case '2': // Lactose-free
              analogWrite(BLUE, 200);
              msg.allergy = 2;
              break;

            case '3': // Sugar-free
              analogWrite(RED, 185);
              analogWrite(GREEN, 100);
              msg.allergy = 3;
              break;

            case '4': // Vegetarian
              analogWrite(RED, 255);
              analogWrite(GREEN, 225);
              analogWrite(BLUE, 53);
              msg.allergy = 4;
              break;

            case '5': // Vegan
              analogWrite(GREEN, 255);
              msg.allergy = 5;
              break;

            default: // Turn on notification LED to call the personnel and set the allergy type
              msg.allergy = 0;
              for (i = 0; i < 3; i++) {
                digitalWrite(14, LOW);
                delay(500);
                digitalWrite(14, HIGH);
                delay(500);
              }
              break;
          }

          delay(2000);
          lcd.clear();
          lcd.print(" * FoxAdvisor *"); // Go back to the default message
          lcd.setCursor(0, 1);
          lcd.print("Can we help you?");
        }

        else if (myFlags[1] && questionNumber == 0) { // Rating process, question 1 (getting the answer of the customer)
          questionNumber++;
          lcd.setCursor(13, 1);
          lcd.print((char)key);
          msg.q1 = key - 48; // Write in the structure the int value
        }

        else if (myFlags[1] && questionNumber == 1) { //Rating process, question 2 (getting the answer of the customer)
          lcd.setCursor(13, 1);
          lcd.print((char)key);
          questionNumber++;
          msg.q2 = key - 48; // Write in the structure the int value
        }

        else if (myFlags[1] && questionNumber == 2) { //Rating process, question 3 (getting the answer of the customer)
          lcd.setCursor(13, 1);
          lcd.print((char)key);
          questionNumber++;
          myFlags[1] = false;
          msg.q3 = key - 48; // Write in the structure the int value
        }
    }
  }
}
ThingSpeak application codeMATLAB
Code for visualization in ThingSpeak
% Celia Garrido-Hidalgo
% Channel ID to read data from 
readChannelID = 357609; 
question1 = 4; 
question2 = 5; 
question3 = 6; 

% Channel Read API Key  
% If your channel is private, then enter the read API 
% Key between the '' below:  
readAPIKey = 'WRITEHEREYOURKEY'; 

question1Data = thingSpeakRead(readChannelID, 'Fields', question1, 'NumPoints', 5, 'ReadKey', readAPIKey); 
question2Data = thingSpeakRead(readChannelID, 'Fields', question2, 'NumPoints', 5, 'ReadKey', readAPIKey); 
question3Data = thingSpeakRead(readChannelID, 'Fields', question3, 'NumPoints', 5, 'ReadKey', readAPIKey); 

bar(1:5, 33.33/5*[question1Data question2Data question3Data], 0.5, 'stack') 

axis([0 6 0 100]) 
title('Customer satisfaction') 
xlabel('Customer ID') 
ylabel('Satisfaction (%)') 
legend('Service quality', 'Food quality', 'Did you enjoy?')  

Custom parts and enclosures

Fox Advisor 3D model
Smart Box to improve customer satisfaction in restaurants which allows clients to rate the service via Sigfox and ThingSpeak IoT platform. This model represents the housing of Fox Advisor device.

https://myhub.autodesk360.com/ue2a81ade/g/shares/SHabee1QT1a327cf2b7a58105fffd6d4c558

Fox Advisor 3D box model
Smart Box to improve customer satisfaction in restaurants which allows clients to rate the service via Sigfox and ThingSpeak IoT platform. This model represents the box located near Fox Advisor device

https://myhub.autodesk360.com/ue2a81ade/g/shares/SHabee1QT1a327cf2b7af39e57d409415907?viewState=NoIgbgDAdAjCA0IDeAdEAXAngBwKZoC40ARXAZwEsBzAOzXjQEMyzd1C0AmCCTgFk4AOQQFoArHwAmfEX0Z8xIxp1y4RAIz4AzQVoBsYgMZitYyWgC%2BIALpA

Schematics

Fox Advisor Schematics
Smart Box to improve customer satisfaction in restaurants which allows clients to rate the service via Sigfox and ThingSpeak IoT platform.
foxadvisor_sketch_4QqtltX6QG.fzz

Comments

Similar projects you might like

Arduino MKR FOX 1200 Sigfox Meteo Station

Project tutorial by Giovanni Gentile

  • 3,167 views
  • 5 comments
  • 7 respects

Sigfox kWh Meter

Project tutorial by jassak

  • 6,117 views
  • 7 comments
  • 15 respects

SmartWay

Project tutorial by Andrei Florian

  • 4,559 views
  • 7 comments
  • 13 respects

Sigfox-Enabled Parking Lot

Project tutorial by jassak

  • 1,069 views
  • 0 comments
  • 8 respects

MKR FOX 1200 Weather Monitor

Project tutorial by Arduino_Genuino

  • 22,187 views
  • 12 comments
  • 38 respects

Carfox: A Device to Find Them All

Project tutorial by Luis Roda Sánchez

  • 7,427 views
  • 2 comments
  • 28 respects
Add projectSign up / Login