FoodTimer | Front-end Dev

As planned in the previous post, I realized most parts of the front-end development including barcode/qr-code scanning following this example and food data fetching using OpenFoodFacts api.

  • Create fake ideal database - DONE
  • Realize scan barcode functions  - DONE
  • Realize image recognition functions - DONE
  • Shelf time auto-fill based on food status and place - DONE
  • Search/tag functions - DONE
  • UI 1:1 realization - almost

I should have finished the database part but due to the unexpectedly heavy workload of thesis, I had to move it to this week's to-do.

Here's what I have done so far.

Next steps:

  • Finish database and auto-fill shelf time functions in software-side - DONE
  • Diagram for the hardware: what protocol to choose, what the data will look like, etc. - DONE
  • Design for the hardware - DONE
  • BOM for the hardware side and shopping - almost

System Diagram

System diagram of FoodTimer

Hardware Design

Electronic parts are subjected to the BOM attached. The hardware will be attached with magnets so at to stick to the fridge door

BOM

  1. Screen: 2.4'' TFT LCD touchscreen with ILI9325 chip. similar product. using ILI9225 library as Tom's post documented. (3.3v-logic, 5v-power, no special pin required.)
  2. Wheel Encoder: EVQ-WK4001 wheel encoder (surface mount)
  3. Scan Camera: Scan home barcode/qr-code scanner module (5v input, RX,TX)
  4. Button / signal light: 8mm diameter
  5. Power: button battery that supplies 5v. or DC 5V
Parts from left to right (1) 2.4'' TFT touchscreen; (2) wheel encoder-surface mount; (3) scan module with compatible breakout board

Hardware Flowchart

Flowchart for FoodTimer

Data Structure

For each food item, the data structure is like

{"_id": xx,
"_foodId": "018231231231";
"_foodName": "xxxxx";
"_foodCategory": "xxxxxxx";
"_foodStatus": "open";
"_foodPlace":"freezer";
"_startTime": date;
"_shelfTime": 5 days
"_leftTime": x days
"_isDanger": true/false,
"_foodImgURL": "ImgURL"}

around ~50 items in the list.

Questions:

  1. Should I add the "update" function from the hardware side? e.g. delete/change status of the food item from the hardware side.
    Answer: not for now.
  2. BOM part: TFT screen compatible with nano 33? What's the output pins for wheel encoder?
    Answer: Try nano 33 first. Consider changing to UNO if not working.
  3. Is it possible to use button batteries to power the device for a week? Any suggestions to save the power?
    Use 2 3.7v lithium batteries (300mah each) in serial to create 7.4v voltage.

Front-End Dev Progress

Finished almost all functions, including filter/search/auto-data fill. (suggested-shelf-time-func has problems).

Scan Module Test

Scanning and reading barcode has been realized. The question is how to manually control the module to switch between working and sleeping to save power.