element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi Chef Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Pi Chef Design Challenge
  • More
  • Cancel
Pi Chef Design Challenge
Blog Bake Mate - Pi Chef Blog #8 - The software needs a little more cooking
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: avnrdf
  • Date Created: 9 Mar 2018 5:15 PM Date Created
  • Views 665 views
  • Likes 7 likes
  • Comments 2 comments
  • pi_chef
  • bakemate
  • pi chef - bake mate
  • pi chef design challenge
  • pi chef
Related
Recommended

Bake Mate - Pi Chef Blog #8 - The software needs a little more cooking

avnrdf
avnrdf
9 Mar 2018

Bake Mate - Pi Chef Blog #8 - The software needs a little more cooking

 

Status Update:

I managed to get most of it to work! There are a few non-critical bugs, but it works well enough.

Picking up from yesterday's post Bake Mate - Pi Chef Blog #7 - Code Prep, which covered the organization of all the software components, I've included a screen capture of the program in action:

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

On the left is the Python Shell, in the middle is the IDLE (the Python IDE), and on the right is the .json file for the recipe that was selected.

I start the Bake Mate GUI application (based on Python/tkinter), and go to the screen that lets me select the recipe. The app automatically searches for valid .json files in the recipe directory, parses data from them and displays the valid recipes in a list. Selecting a particular recipe in the list will cause the application to display a short snippet of information to the right, which is parsed from the description field in the .json file. As you can see, I've not included too many details as it's a work in progress.

Selecting a recipe will take the user to the Scale Page, where the scaling ratio for the recipe can be selected. This page is also a work in progress, and I plan on displaying some useful information in the empty place on the left.

Clicking 'Start' here will take the user to the actual steps of mixing/baking.

 

  • In this case, step 1 is a simple 'do' instruction to keep the baking tin ready. This data is obtained from the .json file on the right; have a look at the first element of the Steps array.

 

  • Clicking on 'Next" moves us to Step 2. Step 2 is a 'addm' instruction (as can be seen in the .json file). The Python app detects this and automatically changes the layout of the page to the template for the 'addm' instruction type, and populates the fields with data from the step in the .json file. The ingredient, its unit and value are parsed and displayed.

Also on this screen is a ProgressBar which will tell the user how much more of an ingredient needs to be added. I've not tested it out by connecting it to the weighing scale yet, but the plan is to take a reading from the weighing scale, so some math on it (to account for the weight of the bowl & previously added ingredients), and update the values in realtime. I used dummy values in the video demonstration.

  • Step 3 is similar. The app parses data from the json file and populates the fields with data.
  • The following few steps work the same way. The app checks the type of instruction in the next step and displays the required screen (all are addm in this case).
  • Step 6 is to add Vanilla Essence (Typo in the video image). Since the amount added is usually a few drops and too small to measure, the weight is not measured. This instruction is 'addnm - add non-measurable'
  • Step 7 is a 'do' instruction. In this case, it reminds the user to preheat the oven.
  • Step 8 is also a 'do' instruction.
  • Step 9 is the 'bake' instruction. The json file contains the duration & temperature that is required. As you can see, temperature is stored as Gas Mark 5 in the json file, but is automatically detected and converted to 190C in the UI. I haven't yet integrated the MAX31856 libraries (which I hope won't be too much trouble). I want to include a matplotlib graph on this screen, but I'll need to see how I can rearrange everything: a 2.4" display is small to begin with.

 

I did have a little trouble managing the code today because Python threw a bunch of import errors since. I fixed this by consolidating most of the code. The main application (that contains the layouts and code for the UI) is close to 700 lines long (~27KB), and the modules that handle parsing the json files & converting units aren't big: 100 lines (6 KB) and 70 lines (1 KB) respectively.

 

To Do:

  • Try it out on the Pi 3. I've been developing on Windows 10, and will need to try running the code on the Raspberry Pi 3. This shouldn't be much of a problem because Python ports without too much trouble.
  • It's time to mix hardware & software. I'll need to wire up the HX711 (load cell amplifier) and MAX31856 (thermocouple converter) and test it out.
  • Adding advanced conversion features: lookup tables for densities & weights of different ingredients.
  • Finalize the GUI.
  • Sign in to reply

Top Comments

  • genebren
    genebren over 7 years ago +1
    Looking great! Nice job on the menus and JSON recipe container. Everything look real polished. Keep up the good work! Gene
  • DAB
    DAB over 7 years ago +1
    Good progress. DAB
  • DAB
    DAB over 7 years ago

    Good progress.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 7 years ago

    Looking great!  Nice job on the menus and JSON recipe container.  Everything look real polished.

    Keep up the good work!

    Gene

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube