The General idea, which came was using the newly popular and inexpensive use of FPGA in our daily lives. One of them was gardening, as everyone, wants their houses to be smart so why not backyards and parks. So with the newly "Arduino" FPGA board came, I was super excited, hoping it would make my new interest of FPGAs easy. This is the basic plan: Make an Internet-connected device, which takes inputs through its FPGAs, and use FPGA to use HDMI to print the data on a TV or monitor screen in your house. (Although you don't need to run an HDMI cable, to your house, to run it, this just demonstrates FPGA capabilities). The BME280 sensor and Soil Moisture Sensor will be sued to collect some data. If the Soil Moisture is low, then a pump/motor/solenoid will turn on.
- MKR Vidor 4000 // Main MCU with FPGA
- Ethernet Shield // if and only if you want an ethernet connection from to the router
- BME280 // i2c sensor to detect temperature, humidity and air pressure
- MKR Connector Carrier // for less dirty wiring // and power management
- LiPo Battery or PowerBank // for Power
- MOSFET //for motor
- A pump/motor/solenoid
Software to be used:
- Arduino IDE // for programming //web editor //or offline
- Blynk //for server communication (you need to manually install the latest release v0.5.4 for compatibility)
All the Wiring is pretty simple, nothing like biological science!
This project works very simple but works well. Our goal is to make Gardening Interesting with the use of FPGA. To do that we need to monitor different conditions and control the devices according to that. We also want to monitor that data on our smartphones and also send alert emails/SMS. The sensors for this prototype are very basic (uses mentioned above). This sensor will give us the data on the Blynk app, where we will address it. This system can detect Soil Moisture, with Atmospheric Conditions to predict and water the plants. The pump will be controlled in this way.
Coding this new board was quite difficult. Very less resources were available and other problems as mentioned earlier. Even after having Vidor Graphics library it was difficult to figure out its functions and all the timing stuff. The rest of the code was pretty simple. I used the newly came Blynk library (which is not yet directly available in Arduino IDE) which brought the support for boards having the uBlox ESP32 WiFi module. The Rest was pretty safe. All in all, it was a project just using the FPGAs. I also used the "only" one pin mapping I had; i.e., pin 33 to A0 to read data from the sensor(which currently dues not have analogRead functionality). But after examining Vidor Graphics library, they have done an awesome job of using FPGA pins to mimic HDMI. The timing just needed to be taken care of so that monitor refreshing does not disturb it. The code is available here: https://github.com/vimarsh244/Smart-Agriculture-MKR-Freedom orCode here
For the server side, I used the free Blynk service, to which Vidor connects via the WiFi, and publishes the data. Then, the Blynk server with its eventor widget decides about the watering of plants. Quite simple.
The Final Product:
This is my Final Arrangement with all things connected. (not a permanent setup but a working one). I have tested this outdoors in soil and it works fine, but of course, the HDMI thing, I neede to make the below video indoors.
This project taught me a lot about FPGAs, I learned about VHDL and Verilog, and how the backed part works, and how the transistors actually make up the "IC" for the specific function. It was amazing to see the long codes, in Verilog, but a little disappointing, that I could not use VHDL in Intel's own software, because of lack of my programming skill in any sort of assembly and lack of documentation on how to upload it to the Cyclone FPGA. All in all, I liked the result, and hope that Arduino will bring more documentation available, to begin the FPGA trend. After all, the MKR aks Maker boards are ready for production due to use of some advanced tech in a small form factor. FPGAs though do get warm, I mean a lot warmer! In the end, in the current stage, the project is a success and it is truly possible to create anything with the use of FPGA. Once I learn Assembler, I will try to display out in analogue form 😃!!!