New hardware board for Mycodo, RootMaster

Hi everyone,

I’m designing a generic hydroponic control board to monitor and manage a hydroponic growing system. Both the design and code are open source, which means anyone can make their own, join in, or take the project in new directions.

Here’s a little more technical information about the board:

  • Raspberry Pi (Zero) for Mycodo
  • STM32G4 for hardware control
  • pH sensor
  • Water temperature sensor
  • EC sensor
  • Air temperature and humidity sensor
  • Flow meter
  • 3 pump outputs for water and nutrient dosing (supporting both water and peristaltic pumps)
  • 3 valve outputs
  • 3 digital inputs for water level sensors or other inputs
  • CAN-bus for future expansions and additional functionality

I need help to integrate this into Mycodo and will sell these to anyone willing to help out for the price these cost me to produce ($54). Interested? Let me know!

1 Like

1 Like

I’d recommend using a Pi 4 or Pi 5 compute module instead of the Pi Zero 2 W, especially with all the inputs/outputs you have.

Most people don’t use DC water pumps, they use inexpensive and long lasting AC powered submersible fountain pumps controlled with an AC outlet relay connected to the Pi’s GPIO or with a WiFI outlet or power strip like the Kasa brand plugs Mycodo is compatible with, or even with an ESP32 MCU running Tasmota.

You really don’t need an EC sensor, especially if you’re mixing your nutrients correctly in the first place according to the manufacturer’s instructions and you have a pump or valve setup for automatically topping off your nutrient reservoir with fresh water every day to offset any evaporation that would cause the EC to rise. (or just be vigilant about refilling the res by hand once a day)

If you’re properly maintaining the environment in the “grow room” by using heating and air conditioning, you really shouldn’t need a water temp sensor since the water should always stay within a few degrees of the ambient air temp as long as the air temp is kept stable. There’s no use in having a water temp sensor unless you have an output that can change the water temperature (like a water chiller). :wink:

You really don’t need a flow meter either… when you water for hydroponics, you usually flood the grow medium completely during each watering cycle, you don’t need to measure how much water you are pumping to your plants with a flow meter, you simply adjust the on-duration of the pump you are using according to it’s flow rate. Another reason for using reliable submersible fountain pumps… you really don’t need a sensor to tell you if your pump is running :wink:

As far as I know, Mycodo currently does not support CAN-Bus, and neither does the Raspberry Pi for that matter, not without an external hardware module and all the coding that would be needed to make it work… are you saying that your board has an embedded CAN-Bus controller? Is that what the STM32G4 is for? Pretty sure Mycodo does not support that MCU either… so not really sure what your intentions were for the STM32G4 and how you planned on getting Mycodo to communicate with it?

What about air-handling and fan control? One of the most important things about a greenhouse or grow room is ventilation. Whether it’s using computer fans with a small grow tent or industrial in-line vent fans for a commercial greenhouse, most systems use PWM to control fan speeds and air movement in and out of the grow space. Doesn’t look like your board has any provisions for that?

Honestly, when most people are DIYing a hydroponics system, they’re not really going to be helped by a board like this. DIY systems are usually all very different from each other, even thought they are all doing pretty much the same thing. With boards like this you are locked in to what is on the board, you can’t change or expand it… a GPIO you may need to use for something might already be used by something you don’t want. More often than not, a board like this is not going to be useful in most scenarios. And sorry to say it, but it sounds like a total scam when your very first post here says “I need help integrating my (non-Mycodo-compatible) board into Mycodo so I can sell it for $54 a unit”. :roll_eyes:

Thank you for your thorough review, although most of it was negative. :wink:

The design for this board was started before I even knew Mycodo existed so most of it was not done with Mycodo in mind… The number of inputs and outputs was tailored for my strawberry tower.

I’d recommend using a Pi 4 or Pi 5 compute module instead of the Pi Zero 2 W, especially with all the inputs/outputs you have.

Apart from higher speed/more memory, is there another reason for the recommendation? The number of i/o is not critical since they are connected to the STM32G4 (more on this later).

Most people don’t use DC water pumps, they use inexpensive and long lasting AC powered submersible fountain pumps controlled with an AC outlet relay connected to the Pi’s GPIO or with a WiFI outlet or power strip like the Kasa brand plugs Mycodo is compatible with, or even with an ESP32 MCU running Tasmota.

Noted! The pump outputs will output 12V and will be possible to connect to a SSD relay if an AC powered pump is preferred.

You really don’t need an EC sensor, especially if you’re mixing your nutrients correctly in the first place according to the manufacturer’s instructions and you have a pump or valve setup for automatically topping off your nutrient reservoir with fresh water every day to offset any evaporation that would cause the EC to rise. (or just be vigilant about refilling the res by hand once a day)

This is true. Although many users, me included, like to measure this just because it is interesting and want to visualize what is happening. The sensors are fairly inexpensive anyway.

If you’re properly maintaining the environment in the “grow room” by using heating and air conditioning, you really shouldn’t need a water temp sensor since the water should always stay within a few degrees of the ambient air temp as long as the air temp is kept stable.

The primary reason for this is to temperature compensate the EC and pH probes. NTC sensors are cheap and the needed electronics are negligible.

You really don’t need a flow meter either… when you water for hydroponics, you usually flood the grow medium completely during each watering cycle, you don’t need to measure how much water you are pumping to your plants with a flow meter, you simply adjust the on-duration of the pump you are using according to it’s flow rate.

The flow meter are there for two reasons:

  • Control the pump. I am not running my pump on 100% so the flow meter can be used to getting the pump output to the correct level.

  • Monitoring that the water is flowing. If the pump and/or valves is not working this will be indicated on the flow sensor.

Another reason for using reliable submersible fountain pumps… you really don’t need a sensor to tell you if your pump is running :wink:

True, but even a reliable pump may be blocked by debris. :wink:

As far as I know, Mycodo currently does not support CAN-Bus, and neither does the Raspberry Pi for that matter, not without an external hardware module and all the coding that would be needed to make it work… are you saying that your board has an embedded CAN-Bus controller?

Correct, there is a CAN controller for the Raspberry Pi on the board and is working fine! Regarding the Mycodo support I have already managed this part and is getting sensor values reported in Mycodo.

Is that what the STM32G4 is for? Pretty sure Mycodo does not support that MCU either… so not really sure what your intentions were for the STM32G4 and how you planned on getting Mycodo to communicate with it?

This design decision is one that was made long before Mycodo came into the picture. The reason for this need a longer explanation and maybe I should take this in a separate post. But the short/main reasons is:

  • Extensibility. The idea is to have one Raspberry Pi with Mycodo and then one or several smaller secondary boards with the needed functionality. Each of the secondary boards will be connected to the CANbus and may communicate with Mycodo. You can see this board as the Primary board (RPi) and one seconday board combined into one board.

  • Distance. CANbus will allow (reliable) communication at a longer distance than i2c.

What about air-handling and fan control? One of the most important things about a greenhouse or grow room is ventilation. Whether it’s using computer fans with a small grow tent or industrial in-line vent fans for a commercial greenhouse, most systems use PWM to control fan speeds and air movement in and out of the grow space. Doesn’t look like your board has any provisions for that?

The pump or valve outputs are generic 12V output and may be used to control fans if needed as well. I am using this myself for controlling the grow lights. If this is not enough it’s possible to extend this using the CANbus… :wink:

Honestly, when most people are DIYing a hydroponics system, they’re not really going to be helped by a board like this. DIY systems are usually all very different from each other, even thought they are all doing pretty much the same thing. With boards like this you are locked in to what is on the board, you can’t change or expand it… a GPIO you may need to use for something might already be used by something you don’t want. More often than not, a board like this is not going to be useful in most scenarios. And sorry to say it, but it sounds like a total scam when your very first post here says “I need help integrating my (non-Mycodo-compatible) board into Mycodo so I can sell it for $54 a unit”. :roll_eyes:

I am really sorry you interpreted this as a scam. Let me rephrase it to make clearer.

I started this project for building a board for myself. Getting them manufactured (and re-manufactured since you never get it 100% right the first time) costs money, money coming from my own pocket. Although I would love to give the board away for free, I can’t afford that. This is why I offer the spare boards for anyone else that is interested. Just to be clear, I am not making any profit when selling these for $54. This is the actual cost for me to get them manufactured.

Also, making a project with more people than just myself is more fun. So it would be fun to have fellow developers working together.

1 Like

This is test with another seconday board connected to the CANbus. Mycodo is able to read the sensor values from both boards.

As you can see on the seconday board there are two CANbus connectors. This is so you will be able to daisy chain multiple boards to extend the functionality further (if needed).

1 Like

Yes, that was pretty obvious from your post. It sounds like you were designing a product that you expected to be able to sell, and you realized that Mycodo was far better than anything you could have written yourself, so you thought that you could get the devs to write a custom version of Mycodo just for your specialized board which isn’t compatible with Mycodo. This is what I explained, your board is “tailored for your system” which means it’s not going to be useful to most other people’s use-cases or system designs. That’s why boards like this really don’t sell… especially since the hardware on your board isn’t compatible with Mycodo and you would need to make extensive modifications to the Mycodo code to make it compatible with the hardware on your board. Normally how this would be done for someone who is designing a hardware-specific product for sale, is you would setup an account on Github, and then you would fork the main Mycodo repository to your own repository, and then you would begin modifying your repository with the changes needed to run on your specialized product that you plan to sell.

Recent upgrades to the underlying operating systems are geared towards newer SBCs like the Pi 5 and the higher throughput they offer. While the Pi Zero 2 W has a 64-bit cpu… it only has 512MB of RAM, which isn’t much, especially when you start adding a lot of inputs, outputs, and functions in Mycodo. It is also recommended that the OS and Mycodo be installed on an SSD and plugged into one of the USB3 ports which are only available on the Pi 4 or 5. Some users, including myself, have experienced system crashing when using SD cards because even V60 and V90 rated SD cards are now simply too slow to keep up with the I/O throughput of the Pi and the newer operating systems, and the SD card slot on the Pi has a very slow write speed compared to USB3… 10MB/s compared to 500MB/s. Your use of the STM32G4 to control the I/O is completely redundant and unnecessary as Mycodo is designed to have all I/O connected directly to the Pi’s GPIO or through other standard communication means such as WiFi and MQTT.

Complete waste of time for a measurement that tells you absolutely nothing important. Tired of having to explain this to the noobs… “EC” is a measurement of electrical conductivity, that EC measurement can be loosely interpreted as an amount of total dissolved solids (TDS) in an aqueous solution at a specific temperature. All it really tells you is a rather inaccurate measurement of the concentration of everything that is dissolved in the solution… which you can’t do anything about except add more water if the concentration is too high. If it’s too low, you can’t raise it by adding more nutrients, because then you’ve thrown off the delicate nutrient balance that is recommended by the nutrient manufacturer. Pretty much all nutrient manufacturer instructions I’ve used state that you mix your tank with the recommended specific ratios of nutrients, and then you only add water to it for the next week or two until it’s time to flush the tank and mix a new batch of nutrients… you never add more nutrients to an already mixed tank. So really, the only time you might need to measure EC is when you first mix a new tank to make sure you haven’t mixed it too strong… but after that you don’t need to measure it again since you’ll be topping off the tank with only fresh water once a day until you change the tank again. And as you said, the EC can change drastically with just fluctuations in water temperature or pH, so how is that a useful measurement of anything??? It’s not. Focus on maintaining stable temperatures and pH and topping off the tank every day to offset evaporation instead of wasting time with completely meaningless EC readings. :roll_eyes:

Again, if your system is properly designed and built and you are maintaining stable temperatures in the grow space with air conditioning like you should be, then there shouldn’t be any drastic fluctuations in your water temperature that would require a sensor for compensating the pH measurements. By the way, pH probes are expensive, and there are none that are really designed for continuous use. They also require frequent re-calibration. I’ve found that it’s much easier to simply check pH by hand every other day using the pH liquid drops. One bottle of liquid pH testing drops usually lasts longer than most expensive pH probes. If your pH is fluctuating that much that you need to constantly check it, there is something seriously wrong with your system.

I already explained why both your reasons for the flow meter are unnecessary. Most people simply control the water flow from the pump by installing a ball valve at the pump outlet, or even by installing a ball valve at each plant. Pumps all have a listed flow rate. If you really need to control the amount of water, you simply do it by turning on the pump for a specific time duration according to the pump’s flow rate to get the specific amount of water you want. There is no need for a flow meter to accomplish this. And as I said before, in hydroponics, you usually just flood the grow medium completely at each watering cycle, there is no need to measure the amount of water. If you really need a closed-loop-system that tells you if your pumps are running, there are easier ways of doing it than a flow meter.

If there is that much debris in your system, then your system needs to be redesigned or better maintained. If there is enough debris to clog the pump, then the flow meter would be clogged as well. :roll_eyes:

So you have created a new Input module for Mycodo that supports CAN-Bus? I don’t see it in the latest change log on the GitHub repository or in the Input dropdown menu in Mycodo? CAN-Bus would actually be a useful addition to the Mycodo Input modules. However most people find the I2C interface more than adequate for most scenarios. Yes, i2c can be problematic when you need long cable lengths between the pi and the sensor, but there are a few hardware solutions for this, like the active terminator available from ADAfruit, or the i2c extender adapters from Sparkfun. The other solution is to attach your sensors to an ESP32 running Tasmota and send the telemetry to Mycodo via WiFi and MQTT. This is becoming the more commonly used option since it is inexpensive, very reliable, and eliminates any concerns with long i2c cables or any cables at all.

It sounds like you really aren’t familiar with Mycodo or it’s already supported hardware at all. Mycodo already supports “extensibility” through multiple “secondary boards” such as i2c and GPIO expanders that offer more GPIO pins than the Raspberry Pi’s existing 40-pin GPIO header. What you’re proposing is that Mycodo would need to first communicate with your STM32G4, and then through that connect with other “secondary boards”? Why go through the STM32G4 when you can just use the already supported hardware directly connected to the Pi? Your idea really doesn’t make much sense given the range of already supported hardware for Mycodo and the expense of your board.

Again, you’re proposing to “add functionality” that already exists in Mycodo. Mycodo does not currently support CAN-Bus, I don’t recall seeing any fans on the market that support CAN-Bus for speed control either, so not really sure what you are thinking here. Pretty much all fans and lights use simple 10v PWM input signal for dimming or speed control which can be accomplished by using a cheap level shifter that takes the Pi’s 3v PWM and boosts it to the 10V PWM used by most fans and lights. There are even plans for home-built adapters right here in this forum as well as multiple links to $5 PWM adapters on Amazon. So why would someone pay $54 for your board when they can pay $5 to accomplish the same thing? Same thing goes for the CAN-Bus, there have already been multiple requests on the forum and GitHub for a CAN-Bus Input module, but so far no one, including Kyle (the Mycodo inventor), has bothered to write one since there are alternative options available which work just as good as CAN-Bus. If you really want CAN-Bus I’d suggest buying one of the more common CAN-Bus breakout boards like the TJA1050 or the MCP2515 for $10 and writing a Mycodo Input module for it. No one is going to pay you $54 for a board that requires a special version of Mycodo to be written that is compatible with your board… especially when your board offers absolutely no functionality above and beyond what is already available with a Raspberry Pi, Mycodo, and the myriad of already compatible hardware that is readily available, literally for pennies on Amazon. I’m telling you, boards like yours just don’t work for most people’s needs, there have been a few other people here on this forum who have designed such boards, and they pretty much never sell because there is no interest in them when simple breakout boards are so cheap and readily available from global suppliers.

You may want to read a bit more about what Mycodo already supports, you’ll realize that your board is really more of a hindrance than a benefit to anyone wanting to design a custom DIY hydroponics system…

It sounds like you were designing a product that you expected to be able to sell, and you realized that Mycodo was far better than anything you could have written yourself, so you thought that you could get the devs to write a custom version of Mycodo just for your specialized board which isn’t compatible with Mycodo.

That was never my intention. My goal was to extend Mycodo to support this board, not fork it and make a specialized version. And of course I didn’t expect the dev to do all the work for me. As I previously said I already got code working for this, but since I am new to Mycodo the solutions may not be “Mycodo style”. Getting help, from devs knowing the internals of Mycodo, making my changes fit better into the system would be far more faster than for me sitting alone and figuring everything out.

So you have created a new Input module for Mycodo that supports CAN-Bus? I don’t see it in the latest change log on the GitHub repository or in the Input dropdown menu in Mycodo?

Of course you won’t see it in the latest change log. I have not pushed any code yet upstream. It is not ready for that yet, that is why I originally asked for help.

What you’re proposing is that Mycodo would need to first communicate with your STM32G4, and then through that connect with other “secondary boards”?

No, you misunderstood. Mycodo has access to the CANbus and can communicate directly to any board connected on the CANbus, regardless if there is a STM32G4 or not.

I hear you loud and clear. You don’t agree with my choices and there is no interest in this for the Mycodo community. Let’s leave it where it is. I am a bit surprised of the unfriendly atmosphere though…

This looks great! Thanks for sharing your work. I’m sure you know, but I made Mycodo modular for cases like this, to easily add support for new hardware. There are a few guides and a lot of example input, output, function, and widget modules, but it can be especially tricky developing them if there’s nothing similar that currently exists to base your new module off of. I have limited availability, but I help where I can to give development tips and develop modules.

@Lucid3y3, these is not the kind of responses you should be making to new forum members. The accusations of maligned motives is especially troubling, considering you know nothing about this person or their work. You also misunderstood several aspects of his hardware and Mycodo. Rather than being immediately combative, dismissive, and accusatory, you should try to be more welcoming and helpful to people who have obviously put a lot of time and effort into their work and seem to have an earnest desire to be a part of the community here.

@Lucid3y3 is correct about the Pi zero 2 having limited resources. If your board had a female header, you could attach any Pi version. And if the pins extended through the pi zero, you would have access to the remainder of the unused pins for other uses. The Pi zero is the only Pi variant that comes with an unsoldered header for this to be easily done to, so another option, if using other Pis, is breaking out those pins on the main baord.

The only people here making misinterpretations are you and the original poster. It wasn’t my intention to be overtly “unfriendly”, I was simply trying to point out many facts and common mistakes that people who are inexperienced with hydroponics systems often make… all of my comments are factual and only trying to make the original poster understand that boards like this are often unusable unless someone is building a system almost identical to the one the board was originally designed for and how boards like this are too often a limiting factor in designing and building a custom system where many changes are often needed before the builder nails down a system that works for their specific needs. If I “misunderstood” anything, it’s because it wasn’t explained in proper detail to begin with.

Frankly, aside from the CAN-Bus interface, I don’t see where a “man-in-the-middle” board like this would offer anything that a Pi 4 or 5 and Mycodo doesn’t already offer, and without the extra cost. What happens if a user buys one of these boards, builds a system, and the board craps out in the middle of a grow? How are they going to get a replacement? Even if the end-user has all the plans for the board, how long would they have to wait before they could have new boards manufactured and delivered, as opposed to ordering common replacements from Amazon overnight? If they have to order a new board from the OP, what if the new boards are a different revision and the peripherals they are using no longer work with the new board for some unknown reason? I’m sorry you think I’m being negative, but I am talking from many years of experience about real-world scenarios that most people simply don’t think about when buying custom-built specialized “one-off” hardware. Not really what I would call “open source”.

Don’t be foolish, you made many assumptions that were untrue or unknown. These are just a few:

Furthermore,

Wrong.

DC peristaltic pumps are used throughout industry and I and many others use them extensively in hydroponic dosing systems.

All commercial hydroponic systems use EC to dose nutrients and adjust pH.

Right, because I never said you were “unfriendly” (this is your general demenor, and I know this), I said you were “combative, dismissive, and accusatory”.

Or, instead, you ask questions to understand, rather than assuming.

You have no idea what level of source is available, so don’t pretend to. Open source means the user can manufacture their own boards. And it is common practice to have a backup board on hand if the one in use fails.

Do you have documentation for the board and the components? How are the valves and pumps controlled?

Not really what I would call “open source”.

Seems our definition of open source differs. To me it’s not the availability of the board that makes it open source. The availability of boards made by people in their spare time will always be more limited than a standard board from Amazon, I will not deny that.

This board has an OSHWA certification, which mean that a third party has verified that the required parts needed to call it open source is generally available.

This mean that even if I stops making the board, or change it in any way, anyone may still be able to order this version for themselves. Alll files needed to order a set of boards are available on GitLab/GitHub.

Do you have documentation for the board and the components? How are the valves and pumps controlled?

Yes, there is documentation available here:
https://docs.openhydroponics.com/hardware/rootmaster.html

But I think I should start another thread with my development specific questions. What is prefered? GitHub discussions or on the forum? I didn’t find any board on the forum for development related questions so maybe GitHub is more suitable?

But I think I should start another thread with my development specific questions. What is prefered? GitHub discussions or on the forum? I didn’t find any board on the forum for development related questions so maybe GitHub is more suitable?

I have started another thread here:

1 Like