Close
0%
0%

FIMble

Concept of a plug-and-play IoT food monitoring system. It aims to reduce food wastage at consumer and distributor level

Similar projects worth following
Dear organisers, please find below the judging points for my project:

Project documentation - under Project Logs:
hackaday.io/project/171810/logs

Project completeness - video of fully working prototype:
hackaday.io/project/171810-fimble/log/182462

BOM - under Components:
hackaday.io/project/171810/components

Code - in Github repo:
github.com/zst123/Project_Fimble

Block Diagrams - see log:
hackaday.io/project/171810-fimble/log/182248

What do I want to build?

  •  FIMble (Cypress PSoC 6 WiFi-BT Pioneer Kit )

My aim is to build a simple device to reduce wastage due to improper organization of the foods, and improve efficiency in determining soon-to-expire items. Ideally, it should be easily implemented, with minimal setup and learning curve required. Additionally, it should be modular and portable, so it can be used on today's existing storage spaces and fridges. 

Existing prototypes of smart fridges, using barcodes or RFID technologies to update the inventory, require the user to scan or move the item close to the sensor (like tapping your card on the bus) every single time you place or remove something. This is very clunky and not user-­friendly.

By utilising long range RFID, FIMble is made possible. I will explain how it works below...


What is my inspiration?

In stores, often times there will be workers assigned to do inventory checks regularly. With a large inventory, keeping track of expiry dates becomes a pain.

At home, it is a routine to clean out the fridge at the end of the year, to get rid of expired food. These food items are usually buried behind other items, hence forgotten and left until it expires, amounting to quite some waste.

Technical details of the system

In certain food products industries, RFID tags are already being used for labelling. RFID tags are getting extremely cheap and the cost is negligible compared to the potential wastage of food.

Using FIMble, every time a food item is placed inside the fridge, an RFID scaner detects the proximity of the item and updates the inventory. When food is removed, the reader can no longer detect the item within the range and it’s removed from the inventory. This is done automatically and there is no need to manual intervention 

A phone app will connects to the reader via WiFi. Bluetooth location tracking is useful for larger scale retail storage. It makes it easier to find on which shelve or aisle a specific item is located at.

For example, a list of expiry dates can be easily generated and sorted by food type. For consumers, food nutrition and diet recommendations can be made available for monitoring the quality of food. They can also be alerted if any specific item is running low and needs to be topped up.

Prototyping Plans

For prototyping, I plan to use the Cypress PSoC 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WIFI-BT). It has the features and peripherials I need such as:

  • WiFi - This will allow data to be sent to the cloud, where data analytics can occur
  • Bluetooth - This will allow multiple FIMble devices to exchange location data, such as shelve number and fridge number.
  • TFT LCD Display - User display interface to be shown in the fridge.
  • Touch buttons - User can interact and specify settings
  • Arduino Headers - An RFID shield can be attached such as the SparkFun Simultaneous RFID Reader which can do long range RFID.

Cloud applications and IoT data analytics

These are some examples of how using FIMble can improve the user's standard of living by collecting data related to food storage.

  • For foods with a shorter shelf life, which requires a more controlled storage environment. Examples include expensive seafood (like oysters and lobsters), and dairy products. The users need to be notified if it is being kept for too long; they can keep track of declining freshness of the products.
  • Sensors can be used to recommend the optimal environment for storage of certain food types.
  • Since the inventory is relayed to the phone app, users will also be able to check it when grocery shopping. They need not struggle to remember if they need to buy a certain item, preventing them from unnecessarily buying what they already have.
  • Users can search for where a certain item is via the app. This improves efficiencies within a storage unit.

My learning experience for this project

I look forward to learning more about IoT application especially with regards...

Read more »

presentation - 317.46 kB - 07/18/2020 at 12:41

Download

  • 1 × Cypress PSoC® 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WIFI-BT)
  • 1 × DIY Paper Craft Enclosure
  • 1 × RFID Reader MFRC522 Arduino Module
  • 1 × Amazon Web Services Services used: IoT Core, Lambda, API Gateway, DynamoDB
  • 1 × Flutter App (Hosted on AWS S3) A mobile app to show the inventory list along with analytics

View all 6 components

  • Demonstration Video

    zst12308/20/2020 at 12:52 0 comments

    It is approaching the end of the Cypress PSoC 6 contest. I would like to end it off nicely with a demo video of how my system functions.

    I really learnt a lot from this contest. Do let me know what you think to!

  • Overall Block Diagram

    zst12308/15/2020 at 13:19 0 comments

    To wrap off, I decided to revisit the block diagram of the finalized system.

    I hope this makes it clearer to you how my entire system operates

  • The Final System setup is done!

    zst12308/10/2020 at 06:21 0 comments

    In the previous log, I received the RFID module and got it working with the Cypress board.

    RFID Scanner LCD Interface.

    Now, I created a nice GUI screen to interact with it. 

    • Scanning items - RFID scanner is waiting for changes
    • Updating - when the item is not found in the inventory, it will update accordingly
    • Successful - the update has been completed.

    Final Enclosure with Stand

    Previously I also made an enclosure for the Cypress development board

    I thought I should make one for the RFID scanner and then place everything nicely together.

    Placing inside the box (module on a breadboard, with flexible wires).

    After mounting everything.

    The system is mounted on a stand.

    And it can be powered using a power bank battery.

    More pictures.

    And how the scanner interface looks like

    In the next update, I will wrap up the remaining codebase and hopefully create a demo video in the next week for the judges to see.

  • MFRC522 RFID Reader

    zst12308/08/2020 at 10:28 0 comments

    Change of Plans

    I initially wanted to use the "SparkFun Simultaneous RFID Reader - M6E Nano", however my local Sparkfun resellers do not plan to bring in any stock. I chose that RFID reader because it was a UHF long range RFID reader which will be needed if my smart inventory system is placed in a large storage space. It is unfortunate that I couldn't get one. Many other UHF RFID readers on the market are meant for industrial use and I cannot possibly afford it (costing from a few hundreds to thousands of dollars). I wanted to at least have a fully working prototype, so I had to look for alternatives.

    Furthermore, I realised that the Cypress PSoC 6 Kit does not have a lot of GPIOs left. This is because the LCD display module takes up most of the pins. I found out there are no exposed hardware UART pins, SPI pins or I2C pins. (Technically, I can share I2C with the one for the KitProg).

    With the constrain on the pins, I decided to choose the MFRC522 RFID Reader module which requires only SPI. SPI is very easy to bit-bang and I am familiar with the MFRC522 because I have used once when I first started with Arduino programming. 

    Testing the MFRC522 Module

    I first verified that my module works using the Arduino examples.

    And it works, so I ported the Arduino C++ library to a C library so I can use it with my Cypress PSoC.

    As for wiring, I tapped off VDD and GND from the Pmod connector. I wanted to avoid soldering, so I used long socket pins to make a friction fit.

    For the SPI pins, I connected it as follows:

    • MOSI = P6_2
    • MISO = P6_3
    • SCK = P9_6
    • SDA = P9_7
    • RST = P13_7
    This is how the whole setup looks like.

    Shown in the above picture is the debug screen. The RFID card UID is being read.

    That is it for today. The hardware is 100% completed for this project. The next post will be to have the RFID reader upload the card detected to AWS.  I will then simulate an inventory with RFID tags and make a demo video for you to see soon!

  • AWS S3 For Flutter Web App

    zst12307/30/2020 at 08:39 0 comments

    When I created the Flutter Android App, I thought of cross-platform as one of my reasons for trying out Flutter. 

    I read that Flutter Web is still in early support, however, it will be good to try it out. I want to see how to host it on Amazon Web Services itself.  If I can host my app on AWS, it will turn my project into a fully serverless and cloud-based concept.

    Adding Web support to my Flutter App


    To add web support, first I ran these commands in my flutter app directory. 

    I followed this guide: https://flutter.dev/docs/get-started/web

    Run the commands:

    $ flutter channel beta
    $ flutter upgrade
    $ flutter config --enable-web
    $ flutter devices
    $ flutter run -d web-server --release
    

    Hosting on AWS S3


    In the end, I chose AWS S3 as a suitable service because I realised that I can generate the Flutter app as a static webpage.

    I followed this guide closely to set up the S3 bucket, permissions and properties:

    Go to S3 console and create a new bucket

    Under properties, I enabled static web hosting. I went with all the default settings

    Here, we can see that it is enabled afterwards

    We need to allow public access, so I went to permissions to edit the bucket policy.

    I modified to have this bucket policy for my use-case:

    {
      "Id": "PolicyForPublicWebsiteContent",
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "PublicReadGetObject",
          "Action": [
            "s3:GetObject"
          ],
          "Effect": "Allow",
          "Resource": "arn:aws:s3:::cypress-psoc/*",
          "Principal": "*"
        }
      ]
    }

    I then uploaded all the files from the build directory: ./flutter_fimble/build/web/

    And as simple as that, my app is now hosted online live! It was way easier than I thought!

  • Flutter Android App for Smart Inventory

    zst12307/22/2020 at 13:09 1 comment

    As of now, most part of my project is done. For the hardware side,  the only missing piece is the RFID reader which I have yet to receive due to issues with shipping delays. All the code is working perfectly and interfaced with AWS cloud so I will say it is 90% done for the hardware.

    My next plan was to make an Android app which will keep track of all the inventory items in the system. I have had experience coding Android apps before. But for this I decided to try something new and use Flutter which is a new framework which is cross-platform for Android, iOS and web apps. 

    Today, I finally completed my app and it is looking great. I will describe the features below.

    Run-through of the app

    This is the run-through of each page of the app. There are 3 major features which I will propose for my project.

    Inventory Page

    The first page will show all the items currently inside the inventory (eg. items inside your smart fridge). When the user clicks on an item, there will be a description of the item and also nutritional values of the food item.

    Statistics Page

    This page will display the settings of temperature control of the storage area. It is useful especially for sensitive food items which need to be stored at a certain temperature.

    A breakdown of the category of the items can also be derived via analytics from all the data gathered through this smart inventory system.

    Overview Page

    Lastly, the overview page is useful for large inventories especially in warehouses. By providing visual icon representation of the storage area, the workers in a warehouse can quickly navigate and find the item they are looking for.

    Working principles behind the app

    The app makes use of AWS API Gateway which serves a HTTP page to retrieve the items from the database dynamically. A lookup table is implemented to provide the item image and description for the user. In practical use, there are also online databases with thousands of food nutritional labels which can be made use by the app.

    A possible further improvement will be to host the app on the AWS platform itself, and make it truly a cloud solution. As I mentioned earlier, I used Flutter which allows making Web Apps. Using AWS EC2 or S3 may be a possible service to host it on. But I will focus on getting the final bits of my project working first, and try it out only if I have additional time.

    As usual, the source code is posted in my Github repo, feel free to take a look and discuss with me.

  • Paper Craft Enclosure Case Design

    zst12307/18/2020 at 12:15 2 comments

    Out of curiosity, I took a look at what other people were doing for this contest. I was inspired by this project log in the Nanodrone project. In the link below, the author designed a case for 3D printing. 

    I wanted to do something similar but I didn't have a 3D printer. And also all the Makerspace facilities near my home are closed due to the coronavirus situation. I decided to create a paper craft version of it. I can print it on colored stock paper.


    Final Design of Paper Craft Enclosure

    Thus, here is my design for the paper craft enclosure for the Cypress PSoC® 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WiFi-BT).

    The original files can be found open-source on my github repository. Feel free to download it and make one yourself!

    Initial prototype using paper

    Final prototype using card stock

  • Temperature/Humidity using DHT11

    zst12307/18/2020 at 02:36 0 comments

    This is just a quick post on adding DHT11 wiring to my board and my plan is to connect it to AWS.

    In my Android app, I thought it will be good to know the analytics of temperature/humidity of my smart inventory fridge.

    First, let's look at the DHT11 pinout -- it needs 3 wires and a pull up resistor.

    I wired it on a breadboard as follows.

    And then I looked at the PSoC pinout. 

    With the LCD in place, I chose the bottom left corner pin, P13_6, which is unused by the LCD. Many other pins are used up by the LCD.

    And for VCC and GND, I used the Pmod connector VCC and GND.

    Final pinout.

    I will then add the code and upload the data on to AWS. 

    In my next post, I will finish the basic outline of my Android app.

  • emWin Bitmaps using Python script (cross platform)

    zst12307/10/2020 at 09:06 0 comments

    I wanted a nice splash screen for my project. I wanted to test the bitmap capabilities of the emWin driver, because I can see that it allows bitmaps to be displayed.

    There is a Segger emWin Bitmap Converter, but there are some issue with it.

    (1) It is Windows-only, and I am running my setup on Linux.

    (2) It is a demo version, which shows a demo watermark.

    As a hobbyist, I cannot afford the full version of the Bitmap Converter, hence I tried to derive the bitmap format myself and create an open-source cross platform using a Python script.

    I referred to these sources which show how emWin bitmaps C files are generated.

    From here, I can understand that I can have different formats of color encoding (for example, ARGB888, RGB565). The emWin LCD driver is very powerful too as it supports color palettes to compress bitmaps to a smaller size.

    I implemented these into my python script. https://github.com/zst123/Project_Fimble/tree/master/emWin-Converter/

    Here's the result from my work today.

  • AWS API Gateway to DynamoDB

    zst12307/04/2020 at 06:44 0 comments

    Since my app is of a food tracking system, I eventually need to implement an Android app to show an overview of what is inside the fridge inventory.

    I am planning for a HTTP API for (perhaps) an Android App to access. The request flow will be like this.

    • Android app → HTTP Request → AWS API Gateway → AWS Lambda → AWS DynamoDB

    I will try out AWS API Gateway today to retrieve contents in the AWS DynamoDB database.

    (1) Create Lambda to be invoked by API Gateway.

    Go to Lambda console

    • Function > Create function
    • Function name: CypressPsocApiLambda

    After creating the lambda go to IAM console

    • Access management > Roles > Permissions > (Click on the function name) 
    • Attach policy: AmazonDynamoDBFullAccess

    (2) Create API Gateway and integrate it to Lambda

    Navigate to the API Gateway service console, and choose Create API. In API name, type CommentsApi and type a short description. Finally, choose Create API.

    • HTTP API > Build
    • API name: CypressPsocApi
    • Stage name (leave as default)

    Create a route

    • GET request: /retrieve

    Create and attach and integration

    • Integration with: Lambda function > Choose “CypressPsocApiLambda”

    (3) Edit Lambda to parse DynamoDB items

    I used the document client to scan for the table name. This retrieves all the items without any filters. Perhaps I'll add a filter parameter in if I need it in the future part of this project.

    And now, I can go to the /retrieve page and I see all the test entry in my database.

    For next time, I want to do up the android app and also the RFID portion of the PSoC device.

View all 14 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates