Close
0%
0%

Industry 4.0: An economical SAAS MES part 1

An OpenSource MES that is easily implementable with resources accessible to everyone.

Public Chat
Similar projects worth following
A MES (Manufacturing Execution System) primarily serves to collect real-time production data from a factory or workshop. This gathered information promotes better production management, including real-time monitoring, traceability, quality control, and preventive maintenance. Despite the recognized advantages of MES, its complex integration and high cost can deter investors. Nonetheless, automatic real-time data collection offers significant benefits compared to using paper forms and manual entry into Excel. The Lean-C IOT project aims to create a free, OpenSource MES that is easily implementable with resources accessible to everyone. After a year of research and development, in collaboration with various industrial partners in Brittany, France, we have achieved a stable version offering advanced functionalities competitive with licensed solutions.

In this project, we will explore how to collect data from existing machinery or implement additional sensors capable of digitizing the existing hardware park within an industrial workshop. We are surrounded by sensors of all kinds, positioned all over our production lines. The goal of this project is to enable data collection from these machines simply by using microcontrollers, a MySQL database, and a bit of PHP code. The presentation will be didactic, and the examples provided will be commented on in as much detail as possible. Your feedback is welcome. Lean-C IOT remains an evolving software solution with much room for improvement!

enclosure.stl

Enclosure to protect the ESP32 Wroom ESP-WROOM-32.

Standard Tesselated Geometry - 200.77 kB - 02/23/2024 at 00:31

Download

  • 1 × ESP32 Wroom ESP-WROOM-32
  • 1 × MySQL server
  • 1 × Infrared Diffuse Reflection Photoelectric Switch Sensor

  • 1
    Create the database and a table to store the collected data.

    For readers looking to test the project with a MySQL database without incurring any costs, there are several free MySQL database hosting services available. These services typically offer a limited amount of resources for free, but it will perfect for testing.

    Here are a few options where you can find a free MySQL database hosting plan:

    000Webhost - Offers a free web hosting package that includes MySQL database support. It's a good starting point for beginners to test their projects with PHP and MySQL.

    InfinityFree - Another free hosting service that provides MySQL databases with its free plan. InfinityFree is known for having no ads and offers unlimited hosting, albeit with some limitations on usage.

    Freemysqlhosting.net - Offers a free MySQL hosting plan that includes a database with 5MB of storage. But be sure that even with only 5MB of storage you will have enough storage to test Lean-C IOT.

    These free services are great for learning, testing, and small projects, but for more significant development work or production environments, you may eventually need to look into paid hosting plans that offer more resources and better reliability.


    In this project we’ll use phpMyAdmin, the free and open-source administration tool for MySQL and MariaDB.

    As a portable web application written primarily in PHP, it has become one of the most popular MySQL administration tools, especially for web hosting services.

    phpMyAdmin provides a user-friendly web interface to manage databases, tables, columns, relations, indexes, users, permissions, and much more.

    Through this interface, you can perform various tasks such as executing SQL statements, managing database keys, and exporting data to various formats.

    It simplifies the management of MySQL over the web by allowing us to easily create, modify, or delete databases; execute SQL statements; and manage users and permissions.

    So first step, we are going to create a testing a MySQL database insert a simple table using phpMyAdmin.

  • 2
    Create Your MySQL Database

    The first step is to set up a MySQL database. If you're using a web hosting service that provides phpMyAdmin, you can log into the phpMyAdmin interface from your hosting control panel.

    Once you have your MySQL server set up and running, access phpMyAdmin.

    In phpMyAdmin, you can create a new database by clicking on the "Databases" tab and entering a name for your database. After specifying the name, click the "Create" button.

  • 3
    Create the ACTIVITY Table

    After creating your database, you need to create a table to store your testing data. To do this easily:

    • Select your newly created database from the left pane to open it.
    • Click on “SQL” in the top menu.
    • Paste the following code into the SQL command text area:
    CREATE TABLE ACTIVITY (
      id INT UNSIGNED NOT NULL AUTO_INCREMENT,
      sensor VARCHAR(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
      reading_time DATETIME DEFAULT CURRENT_TIMESTAMP,
      counter VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
      justified TINYINT(1) NULL DEFAULT 0,
      PRIMARY KEY (id)
    ); 

    This table, named ACTIVITY, tracks sensor activities with fields for a unique ID, sensor name, reading time, counter value, and a boolean for justification. The id serves as the primary key and auto-increments. Sensor names are stored as strings, reading_time auto-records the current timestamp, counter is a nullable string, and justified is a boolean defaulting to 0, indicating false.

View all 12 instructions

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