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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 Kitchen Brainiac: Intro
  • 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: fixstuff
  • Date Created: 26 Jan 2018 9:20 PM Date Created
  • Views 507 views
  • Likes 4 likes
  • Comments 3 comments
Related
Recommended

Kitchen Brainiac: Intro

fixstuff
fixstuff
26 Jan 2018

Hi folks!  I'm not going to go into unboxing the contest items - that has already been done pretty well by the other folks, so I'll defer to them.

 

I'm going to jump right into this project, which I'm calling the Kitchen Brainiac.  This entails a centralized controller, turning on, and off remote controls located on various devices, such as crock pots, coffee makers, bread machines, beer distilling rigs, sous vide cooker, meat thermometers, etc.  Each "device" will house either a simple Wifi enabled board, such as a ESP8266, or will use a node Raspberry Pi with a relay output, such as the Piface.  To keep costs down, I will initially go with the ESP8266 based node (an Adafruit Feather Huzzah), and connect back to the host controller with Modbus TCP, which is a widely used industrial protocol which has good Arduino and Python support. 

 

image

 

https://en.wikipedia.org/wiki/Modbus

 

A bit about myself.  My background is building industrial control systems typically built around PLCs, Programmable Logic Controllers, so I work quite a bit with them, and look to apply some of the techniques and methods I use in building those types of systems.  Rather than building a single smart device or item for the kitchen, my goal is to build a system, which can be implemented for any number of devices in the kitchen, or even expanded to the whole house (think smart control, or even holiday lights).

 

I love the capabilities of the Pi and the richness of the community in terms of inspiration and content, and it's no different from the PLC side of things.  Granted, most every bit of software out for the Pi is open source, and is widely available in the form of libraries, and how to guides, and is mostly free.  For my project, I am using a very inexpensive component for the PLC runtime from a company based in Europe called 3S Systems, who make a product called Codesys.

 

To make a long story short, 3S systems develops and licenses their PLC runtime technology to hundreds of manufacturers around the world, probably including many large companies you may know or have heard of, who will remain unmentioned here, but take my word for it, it's a lot.  Most amazingly, 3S, has made their flagship runtime available for the Raspberry Pi for a pittance (about $50), which is comparable to industrial PLC systems costing 10X or more for the same capabilities.  It's also a really good way to learn some PLC languages and methods you probably won't be exposed to in the Pi world unless you use PLC's either.  I won't get into Codesys or 3S anymore than that, but feel free to navigate to their site, particularly the store where you can download the IDE, and the runtime package itself, as well as their active forum on the Raspberry Pi.  The runtime runs for free up to 2 hours, but the license removes this time restriction.  The IDE is free also, and requires no license for it.  There are a lot of videos on using Codesys with the Pi on Youtube.  I will post some hopefully as well, as I document the project progress.

 

Install the IDE first:

image

image

 

The install the Raspberry Pi package:

image

 

Here are good resources for questions on the Pi with Codesys on their forum:

 

image

 

In a nutshell, the main controller, the Kitchen Brainiac, will consist of the Raspberry Pi 3, with it's associated HAT.  The contest provided a wide selection of available HATs to use.  One problem with this, is that most of them are top HATS - so using more than one can get tricky.  It's possible to create a sort of mini backplane, with the Pi's 40 pin header getting split to multiple header's for each board, but I want to stay away from that for simplicity's sake.  My alternative, is to use MULTIPLE raspberry Pis, all interconnected over the network, and keep each Pi with it's own HAT.  This way, it solves the TOP hat issue, but it also demonstrates another nifty capability of the Pi with Codesys - distributed control using network variables.

 

image

 

For the project, I will be using the Sense Hat, the Piface Digital 2, the NFC expansion, and the Raspberry Pi camera 2.  I won't be using the touch screen, since it requires a modified kernel to use, which might break the Codesys runtime (or it might run just fine).  This will basically require 2 more additional Raspberry Pi 3 boards, of which I'm sure most of you out there have 8 or 10 lying around like I do image

 

I will be using the built in Web visualization capability of Codesys, so that you can access and control the system from any browser based device.  This is also how we will utilize the Raspberry Pi camera - with an embedded video window on the GUI control screen.  Here's an example in a robot I built.

image

 

Each Pi will "publish" it's own network variable list, and will "consume" the network variable lists from the other Raspberry Pi's in the system.  This provides a sort of shared memory model, between the various CPUs of the system.  It also allows expansion of the IO, among many different Pi's, and provides a mechanism to distribute programs among the various boards where they make sense.  This can also be used for redundancy in the system, with identical programs running on all Pis, a heartbeat signal can be used to enable a redundant program, if the main CPU goes down.

 

One of the Pi's will utilize a Modbus TCP server, which will provide a centralized hub, for each end node to connect to and transfer data.  Each node will be running a client, and will have several registers dedicated to just that particular node.  This is an easy and clean way to have lots of "nodes" pushing data into the centralized Modbus server repository.  The master controller program running in Pi with the server, will then act on the data provided, and will turn on and off outputs back to those nodes accordingly.

 

One nifty feature we will be using, in using Modbus, is the ability to tie Raspberry Pi python code or other code (like C or NodeJS, or whatever) running outside of Codesys, back into Codesys.  Codesys provides a "framework", to have multiple, independently running programs, each with it's own task run clock.  This allows you to run faster processes quickly, and run slower processes independently of each other. When we have something that we want to run in the underlying linux subsystem, such as that nifty Python code or other sample program generously provided for by Adafruit or some other resource, you simply add a Modbus Client sending and receiving the data from the Python code to local host, at 127.0.0.1, which just so happens to be the Modbus server being run by the Codesys system. A nice and easy way to move data into and out of Codesys.  I have done this very successfully with boards like the Ultimate GPS hat and others.

 

I will set up and demonstrate the use of the wonderful OSCAT libraries in Codesys.  These are three large, open source libraries that are available to install into Codesys, that provide a huge amount of well documented, ST code, which not only can be used as is in most cases, but can be easily modified and ported into your own code for your own use case.  It's truly a wonderful tool.

 

Finally, I will introduce and demonstrate a couple of custom device drivers that I have tested around with, and will show how to use them for use in your own projects.  I have used these custom I2C drivers to talk to everything from Parallax Propeller's to Cypress PSOC4's to Teensy 3.2 chips to Grove sensors, to you name it.  Codesys provides support for the Sense HAT, the GPIO, the Pi camera, the Piface, etc.  It doesn't support the NFC board - but I will attempt to use my two drivers to accomplish this.  Once you see how that is done, you can use them for your own devices as well.

 

Needless to say, all of this is quite easy to configure and set up in Codesys, and I will show and demonstrate everything.

 

To configure and monitor everything, I will go over the setup I use on the Pi, to get everything up and running well, and provide a nice headless interface to the Pi using VNC.

image

 

Feel free to make suggestions on some of the other devices in the kitchen that may be useful.

 

I have attached a quick run through on getting a Pi set up with Codesys and running headless.  It's lean on detail for now, but for folks who may have done these things before, may be adequate for detail.  I'll add more detail over time, but I wanted to get this out early, so perhaps others can follow along as I go.  Feel free to make suggestions to add steps also for clarity.

Attachments:
imageStartup Pi Doc.pdf
  • Sign in to reply

Top Comments

  • genebren
    genebren over 7 years ago +1
    James, Great start. Sounds like you have a plan in place and a direction to go. It will be interesting to see how all of this goes as you progress through your project. Your comment about everyone having…
  • mp2100
    mp2100 over 7 years ago

    Looking forward to seeing details.  Speaking as another PLC user, I was glad to see what codesys can do on the rPi.  Just think of what can done with this concept, just as soon as I have some spare time (when?).  Raspberry Pis all over the house talking to each other.

    Allen

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fixstuff
    fixstuff over 7 years ago in reply to genebren

    Thanks Gene!  I may be a bit of a SBC hoarder actually...  Funny thing is

    none of them have proven as useful as the Pi!

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

    James,

    Great start.  Sounds like you have a plan in place and a direction to go.  It will be interesting to see how all of this goes as you progress through your project.  Your comment about everyone having 8-10 Raspberry Pi boards laying around kind of went over my head.  While I have developed many products (for myself and clients) with embedded micros, CPLDs and a host of other parts, I do not own a single Raspberry Pi or Arudino board.  I guess that I might be a sort of unique member that would rather 'roll their own', but I would guess that there are many out there that do fit your description.

     

    Good luck!

    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