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
Hardware Design
BOM
- 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.)
- Wheel Encoder: EVQ-WK4001 wheel encoder (surface mount)
- Scan Camera: Scan home barcode/qr-code scanner module (5v input, RX,TX)
- Button / signal light: 8mm diameter
- Power: button battery that supplies 5v. or DC 5V
Hardware Flowchart
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:
- 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. - 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. - 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.