element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
Vertical Farming
  • Challenges & Projects
  • Design Challenges
  • Vertical Farming
  • More
  • Cancel
Vertical Farming
Blog Modular Farm Blog: Post 8 - Database
  • 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: jmbranco76
  • Date Created: 24 Sep 2015 6:22 PM Date Created
  • Views 1387 views
  • Likes 3 likes
  • Comments 8 comments
  • modular_farm
  • hydroponic
  • net_zero_energy_farming
  • database
  • grow_sharp
Related
Recommended

Modular Farm Blog: Post 8 - Database

jmbranco76
jmbranco76
24 Sep 2015

Hi vertical farmers,

 

In the previous post we presented our vision system capable of detecting plant illness, disorders and development stages.

In this post we talk about the database we will use to store measurements, production figures and support decision.

 

Database Requirements

The database should keep track of:

  • Measurements, sensors and boards that originated them.
  • Actuators commands history.
  • Multi-crop records comprising history, productivity, species and location (allotment).
  • Events generated automatically by the system or inserted by system operators (triggers).

 

Database Diagram

Figure 1 presents the database entity–relationship model. It defines allotments as areas in the vertical farm and deals with the different sensors configurations and measurements. Includes trigger relations for reporting and alarm purposes too.

Using this model we also pretend to build our knowledge base to connect to our artificial intelligence virtual observer to fine tune the actuator goal variables.

 

image

Figure 1. Database entity–relationship model. Right click on the image and select open in new tab/window to see in larger size.

 

Database Deployment and Connection

We designed the database with the help of MySQL Workbench and deployed it in a MySQL server.

To test the database, we coded software with Python, Node.js, Socket.IO and Google Chart API to try the insertion of sensor measures into the database and their graphic visualization in real time. The result can be seen on the video below.

We defined a Python node (left bottom on video) to generate random sensor measurements at 2 Hz and insert them into the MySQL database.

We used Node.js for the server-side application and Socket.IO to maintain a bidirectional connection between the client and the server. On the server side, a connection to the database is maintained and, at a rate of 2 Hz (not related to sensor output), we check for any updates on the measured values on a given sensor. We store the last records timestamp and query the database to efficiently retrieve the last updates (upper left on video). Finally we use HTML and JavaScript (+ Google Chart API) for the frontend webpage and, for each event on the Socket.IO instance on the client side, we change the data table of the chart, providing a real time visualization (right side on video).

 

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

 

And that's it for now. Following is a glimpse of the next post.

image

 

As always if you have any questions or comments please feel free to comment this post.

 

Thanks for following and keep connected!

  • Sign in to reply

Top Comments

  • balearicdynamics
    balearicdynamics over 9 years ago +1
    Very good !!! Finally someone else that uses proficiently the MySQL Workbench. It's a great tool, don't you think ? Enrico
  • RWReynolds
    RWReynolds over 9 years ago +1
    Looks great! Are you hosting a LAMP stack , assuming you're using LAMP, locally or using one of the virtual server hosting services?
  • DAB
    DAB over 9 years ago +1
    Good post. Have you a list of the types of parameters you want to monitor on your farm? I think the next big step is learning what information affects what aspects of plant growth and maturity. It might…
Parents
  • DAB
    DAB over 9 years ago

    Good post.

     

    Have you a list of the types of parameters you want to monitor on your farm?

     

    I think the next big step is learning what information affects what aspects of plant growth and maturity.

     

    It might be a good idea to check your local Agriculture Universities to see what information they have collected and analyzed.

     

    They can probably provide you with a wealth of data relating to different crops in different climate conditions.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jmbranco76
    jmbranco76 over 9 years ago in reply to DAB

    Hi DAB,

     

    We are thinking to monitor temperature, relative humidity, ambient light, pH, electrical conductivity, flow measurement and level sensing.

    Good information concerning plant growth and maturity in hydroponics would be very very useful and is a scarce resource. By the way, we take this opportunity to invite all those who have any information to share it if they can.

     

    Cheers,

    José

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago in reply to jmbranco76

    You will probably want to measure both air and fluid temperatures.

     

    If they get too different it an stress the plants.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 9 years ago in reply to jmbranco76

    You will probably want to measure both air and fluid temperatures.

     

    If they get too different it an stress the plants.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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