What does a MARSfarm recipe do? What is JSON? (ChatGPT-4 Response)

We use JSON as a method of communicating the environmental settings (via a “Recipe”) to the MARSfarm Version 1. If you are unfamiliar with JSON, but are interested in learning about it and potentially teaching your students some coding concepts - I strongly encourage you to check out this conversation I had with ChatGPT about how to teach students about JSON using the MV1_Tomatosphere recipe. JSON stands for JavaScript Object Notation. It’s a lightweight data-interchange format that’s easy for humans to read and write and easy for machines to parse and generate. JSON is often used to transmit data between a server and a web application or between different parts of an application. It’s like a universal language that both people and computers understand, helping them communicate more efficiently.

The conversation below is from when I used ChatGPT to help me explain JSON to a 7th grader using the MV1_Tomatosphere recipe as an example. To see the complete recipe for yourself, check out this forum post: Tomatosphere Recipe - Using your MV1 to grow tomatoes!.


Peter’s prompt to ChatGPT: Explain JSON to a 7th grader with no understanding of code or programming logic. the context is that they’re school so assume they want to learn but use analogies and make it interesting.


ChatGPT-4: Let’s imagine JSON as a magical backpack that you take to school. This isn’t just any backpack; it’s super organized and helps you find exactly what you need, when you need it. :school_satchel:

The Magical Backpack (JSON Object)

When you open the backpack, you see different pockets and compartments. Each pocket has a label, like “Pencils,” “Notebooks,” or “Snacks.”

Labels and Stuff Inside (Key-Value Pairs)

The label on the pocket is like the “key” in JSON, and the stuff inside the pocket is the “value.” So, if the label says “Pencils,” you’ll find pencils inside that pocket.

Multiple Items (Arrays)

Some pockets might have more than one type of item. Imagine a pocket labeled “Snacks,” and inside, you find an apple, a bag of chips, and a juice box, all neatly arranged in a specific order. That’s like an array in JSON!

Nested Pockets (Nested Objects)

Now, let’s say you have a pocket labeled “Math Supplies,” and inside that pocket, you find a smaller pouch that holds a calculator, ruler, and protractor. That’s a nested object!

The Magical Backpack in Action (JSON Example)

So, if your magical backpack were written in JSON, it might look something like this:

{
  "Pencils": 3,
  "Notebooks": 2,
  "Snacks": ["Apple", "Chips", "Juice Box"],
  "Math Supplies": {
    "Calculator": 1,
    "Ruler": 1,
    "Protractor": 1
  }
}

Isn’t that cool? Just like you can quickly find what you need in your magical backpack, computers use JSON to quickly find and organize information. :star2:

So, the next time you pack your backpack for school, think about how it’s like creating your own JSON object, making your life easier and more organized!


Peter: great! now use the same analogy to explain how this JSON file works. My goal is that they could then try to “read” this file to tell me what some of the settings are. For context, this JSON will be used to provide settings for the lights, temperature, irrigation, and airflow in a countertop-sized smart greenhouse…[copied text from MV1_Tomatosphere recipe]


ChatGPT-4: Absolutely, let’s dive into this magical greenhouse backpack! :seedling::school_satchel:

The Magical Greenhouse Backpack (JSON Object)

Imagine this JSON file is like a super-detailed magical backpack for your smart greenhouse. This backpack has pockets for lights, temperature, irrigation, and airflow. Each pocket has specific settings to make sure your plants grow perfectly!

Labels and Stuff Inside (Key-Value Pairs)

  • _id: Think of this as the backpack’s unique ID tag.
  • model_name: This is the type of backpack; it’s a “TemplateRecipe.”
  • recipe_name: This is the name of the plant-growing plan, called “MV1_Tomatosphere.”

Multiple Items (Arrays)

  • phases: This is like a big pocket that has different sections for each growing phase of the plant. Right now, it has a “vegetative” phase.

Nested Pockets (Nested Objects)

Inside the “vegetative” phase, you have smaller pockets for:

  • circulation_fan: This pocket tells the fan to start at 0 hours and 1 minute with setting 1.
  • temperature: This pocket sets the temperature to 60°F at 0 hours and 1 minute, changes it to 75°F at 6 hours and 5 minutes, and back to 60°F at 20 hours and 5 minutes.
  • pump_amount: This pocket tells the irrigation system to pump 80ml of water at different times starting at 9 hours and 5 minutes.
  • light_intensity: This pocket sets the light intensity. For example, at 9 hours and 5 minutes, all the light colors (white, blue, green, red) are at their maximum (255).

Reading the Magical Greenhouse Backpack

So, if you were to “read” this backpack, you’d know that:

  • The fan starts at 0 hours and 1 minute with a setting of 1.
  • The temperature is 60°F but changes to 75°F at 6 hours and 5 minutes and back to 60°F at 20 hours and 5 minutes.
  • The irrigation system pumps 80ml of water four times, starting at 9 hours and 5 minutes.
  • The lights are off but turn on to full intensity at 9 hours and 5 minutes and turn off again at 23 hours and 5 minutes.

Isn’t it cool how organized this magical greenhouse backpack is? Just like this backpack helps your plants grow, the JSON file helps your smart greenhouse know exactly what to do! :star2::seedling:

1 Like

Such an awesome application of using ChatGPT to help with teaching something that could otherwise be very difficult to put into context for a student. I think it is a really smart idea to open with this analogy, get students to read the JSON file, and then take shots at modifying the file to generate their own custom recipes. Well done :clap:t3:

1 Like

I realize now that I didn’t share a link to the ChatGPT conversation, here that is if anyone else is interested in trying it out. All you need to do is click “continue conversation” and it should already be primed with the context of understanding what a recipe is: so just click this link, login/create an account real quick, and then ask it to help you create a new recipe.

I’ve added over a dozen new recipes for MV1 users to use! They range across five categories, each of which I’ve created three recipes for. For example, within the Light Spectrum category I created “Red”, “Blue” and “White” recipes - each of which provides exactly 150 umol of light for 24 hours consistently. Those three recipes also provide the same amount of water, temperature, control, etc. - so that the outcome is actually attributable to the variable the student chose.

@cregini @speck_c @NateReyes @DrDonnaJ @Surendra @hmw @jeremy.hall @jodlowskik

  1. Light Spectrum :rainbow:
  2. Light - Photoperiod :sun_with_face: :crescent_moon:
  3. Light Intensity :bulb:
  4. Temperature :thermometer:
  5. Irrigation💧

Default Recipes - Comparison Table


Recipe Name Circulation Fan :wind_face: Temperature :thermometer: Pump Amount :droplet: Light Intensity :bulb:
MV1_One_Phase_Bok_Choy_Spring_2023 ON at 00:01 80°F at 09:05 80ml x 4 starting at 09:01 [0, 207, 150, 209] PWM at 09:05
Spectrum: Blue (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 0, 150, 107] PWM at 00:01
Spectrum: Red (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 105, 0, 107] PWM at 00:01
Spectrum: All (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 105, 150, 56] PWM at 00:01
DLI: 30 (2400ML, hydro) ON at 00:01 60°F at 00:01 80ml x 24 starting at 00:01 [0, 207, 150, 209] PWM at 00:01
DLI: 30 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 209] PWM at 00:01
DLI: 21 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 107] PWM at 00:01
DLI: 17 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 105, 0, 107] PWM at 00:01
Photoperiod: 18 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 56] PWM at 00:01 and off at 18:01
Photoperiod: 14 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 107] PWM at 00:01 and OFF at 14:01
Photoperiod: 10 (240ML) ON at 00:01 60°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 209] PWM at 00:01 and off at 10:01
Temp: Max (2400ML, hydro) ON at 00:01 90°F at 00:01 80ml x 24 starting at 00:01 [0, 207, 150, 56] PWM at 00:01 and off at 18:01
Temp: Max (240ML) ON at 00:01 90°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 56] PWM at 00:01 and off at 18:01
Irrigation: 250ML ON at 00:01 60F at 00:01 80ml x 3 starting at 00:01 [0, 207, 150, 56] PWM and off at 18:01
Temp: Controlled (240ML) ON at 00:01 82°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 56] PWM at 00:01 and off at 18:01

This is a list of the default template recipes created in Fall of 2023 for use by MV1 users (at the initial suggestion of Chris Regini) these are all accessible for use by any MV1 users when creating a new trial through the MARSfarm web application.

*initially created at the request of at the request of @regini

Custom Recipes - Comparison Table*


Recipe Name Circulation Fan :wind_face: Temperature :thermometer: Pump Amount :droplet: Light Intensity :bulb:
Irrigation: 250ML ON at 00:01 60F at 00:01 80ml x 3 starting at 00:01 [0, 207, 150, 56] PWM and off at 18:01
Temp: Controlled (240ML) ON at 00:01 82°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 56] PWM at 00:01 and off at 18:01
MV1_Fast_Plants ON at 00:01 78°F at 00:01 80ml x 4 starting at 09:01 [0, 207, 150, 209] PWM at 00:01
MV1_Tomatosphere ON at 00:01 75°F at 06:05 80ml x 4 starting at 09:01 [0, 207, 150, 209] PWM at 09:01
Max_Light_16hr_No_Water_90F ON at 00:01 90°F at 07:01 0ml x 1 starting at 09:01 [0, 207, 150, 209] PWM at 07:00
Max_Light_18hr_No_Water_70F ON at 00:01 70°F at 00:01 0ml x 1 starting at 09:01 [0, 207, 150, 209] PWM at 07:00
Max_Light_16hr_No_Water_60F ON at 00:01 60°F at 00:01 0ml x 1 starting at 09:01 [0, 207, 150, 209] PWM at 07:00

This is a list of the custom recipes created in Fall of 2023 for use by MV1 users (at the request of @regini @cspeck, @nate, and @jeremy) these are all accessible for use by any MV1 users when creating a new trial through the MARSfarm web application.

Recipes Avaiable by Request*


Recipe Name Circulation Fan :wind_face: Temperature :thermometer: Pump Amount :droplet: Light Intensity :bulb:
Temp: Thermoperiod ON at 00:01 90°F at 00:01 and 60F at 18:01 80ml x 4 starting at 09:01 [0, 207, 150, 56] PWM and off at 18:01
Irrigation: 1L ON at 00:01 60F at 00:01 80ml x 12 starting at 00:01 [0, 207, 150, 56] PWM and off at 18:01
Irrigation: 500ML ON at 00:01 60F at 00:01 80ml x 6 starting at 00:01 [0, 207, 150, 56] PWM and off at 18:01
Irrigation: 250ML ON at 00:01 60F at 00:01 80ml x 3 starting at 00:01 [0, 207, 150, 56] PWM and off at 18:01

*these are currently disabled, but can be added back to your recipe list upon request

Appendix:


Variable Spectrum: Red Spectrum: Blue Spectrum: All
Light (mol/hr) Intensity: Combined 0.54 0.54 0.54
Light (mol/hr) Spectrum: Red 0.18 0.00 0.18
Light (mol/hr) Spectrum: Blue 0.00 0.18 0.18
Light (mol/hr) Spectrum: White 0.36 0.36 0.18
Light (actual umol/sec) Intensity: Combined 150.00 150.00 150.00
Light (actual umol/sec) Spectrum: Red 50 0 50
Light (actual umol/sec) Spectrum: Blue 0 50 50
Light (actual umol/sec) Spectrum: White 100 100 50
Light (actual PWM) Spectrum: Far-red 0 0 0
Light (actual PWM) Spectrum: Red 105 0 105
Light (actual PWM) Spectrum: Blue 0 150 150
Light (actual PWM) Spectrum: White 107 107 56
Light (hours) Duration 24 24 24
Light (HH:MM) Day Start Time [0,1] [0,1] [0,1]
Light (HH:MM) Night Start Time [0,1] [0,1] [0,1]
Light (mol per day) Day Light Integral 12.96 12.96 12.96

For anyone who has access to ChatGPT plus, they can use this ‘GPT’ created by MARSfarm to now configure JSON recipes for the MV1: https://chat.openai.com/g/g-ff82bTcZL-recipe-builder

It’s our intention to embed this ‘GPT’ application into our own web app, because this will allow for the use of natural language - which is the ideal user interface - to configure climate recipes for use with the MV1. Here are some examples:

P.S. If you do NOT have ChatGPT plus, all you have to do is make a request on this thread and myself or another member of the forums will be more than happy to create the recipe for you.
P.S.S. By the end of the year, any user will be able to upload a .JSON recipe through the web app - this allows for individuals to configure and immediately assign recipes on their own.

FYI - here is what JSON is ‘literally’ (I recognize I covered this at a high level previously but here it is as an actual set of rules/requirements) - so you can ensure (manually) that a recipe will actually work on an MV1.

JSON should follow these rules

Citations: 1, 2

  • Data is in name/value pairs
  • Data is separated by commas
  • Objects are encapsulated within the opening and closing curly brackets
  • Arrays are encapsulated within opening and closing square brackets
  • A member is represented by a key-value pair, contained in double quotes
  • Each member should have a unique key within an object structure
  • The value of a member must be contained in double quotes, if it’s a string
  • Boolean values are represented using the true or false literals in lower case
  • Number values are represented using double-precision floating-point format and shouldn’t have leading zeroes
  • “Offensive” characters in a string need to be escaped using the backslash character \
  • Null values are represented by the null literal in lower case
  • Dates, and similar object types, aren’t adequately supported and should be converted to strings
  • Each member of an object or array value must be followed by a comma, except for the last one
  • The standard extension for the JSON file is ‘.json’
  • The mime type for JSON files is ‘application/json’

I would appreciate feedback from anyone with a ChatGPT Plus membership (@Surendra, @cregini @wxazygy @hmw @drew) to please try and use the Recipe Builder GPT to create custom recipes for the MV1. Share your conversations to this thread so we can begin to build this together.

Here is a demonstration of how to use Recipe Builder:

Example of a three-prompt conversation to create a recipe for growing Lettuce based on average climate conditions in November for Yuma Arizona.

  • I used this location/time because I know that in the winter a lot of leafy greens are produced here.
  • I have not ‘fact-checked’ this output yet - curious to know the result if anyone does.

Example of longer conversation, where I convert St. Louis May precipitation and day length averages into irrigation and lighting settings for the MV1.

  • The first time it did the calculation for irrigation it was completely wrong.
  • The MV1 max light setting is 450 umol (measured at the pot level) - so even though 40 DLI was recommended, only a 30 DLI could be achieved in the given photoperiod.
  • The only thing I forgot to do was ask it to format the file (easy for it) as .json at the end.

Also for any of you other MV1 users that are interested in custom recipes (@InnovationCenter @NateReyes @speck_c) if you don’t have a ChatGPT recipe - check out this earlier post in the thread.

Recipe builder has been linked to 24+ times from ‘GPT Store’ clone websites - most of which come up before our forums in search :rofl: @drew @hmw

@Surendra @cregini @jeremy.hall FYI this list should be fully up-to-date.

Here is an example of how dynamic light recipes (similar to the ones above) can be used to influence the amount of antioxidants created by leafy greens.

https://www.producegrower.com/article/fixed-vs-dynamic-light-quality-for-indoor-hydroponic-lettuce/