Inspiration

Over the last few weeks, family and friends have turned to gardening to help them get through isolation and social distancing, some taking on very ambitious gardening projects. We thought that using paper or card flags to signify which plant or seed was which was impractical, and thought it would be easier if you could scan the plant pot with your phone, and it would tell you what it was. We also thought that, using calendar integration and API calls, we could give the gardener useful information as to when they should be watering their plants, and what conditions the seed should be planted in, for example full sunlight, or partial shade.

What it does

It's an IOS app. It lets you add plants as you plant them to a list of plants in your garden, and associate a type (species) to this plant by searching the USDA plants database. The app then fetches information about the plant from the database, and you can view useful information about any plant you have added. The app also has a watering mode - as you're watering areas of your garden, you can put the app into a mode where you can scan an RFID tag after watering, and it will add that plant to a list of watered plants, and update the last water date for that plant, so you can keep track of what needs watering when, and not miss out any plants or groups of plants. You can also manage the plant list without RFID using search, ie you can search for a plant instead of scan it. You can build custom groups of plants; these could be areas of the garden, groups of pots or similar plant types.

How I built it

We used XCode to build the app, with the old Storyboarding system instead of SwiftUI. We used REST APIs in Swift to interface with the USDA plant database; parsed and cleaned this data using a Python script, and stored it in the Core Data storage system by parsing a CSV file in Swift.

Challenges I ran into

We initially tried to format RFID chips using Arduino + MFRC522 chips, but this didn't work because the reader / writer shield kept losing connection to the chip mid write operation. We also didn't realise RFID/ NFC scanning was a feature restricted to premium developer accounts on xcode (£80!), which is why the key selling point of this idea isn't actually implemented! This was annoying, but it gives us some more to do for this app in the future. In addition, the original database we planned to use to get plant features (Trefle.io) went down at about 10pm Saturday, so we had to change our plans for the API.

Accomplishments that I'm proud of

How far we got! Starting from no iOS app development experience at all, we're happy with how much we learned and what we managed to build, even if we didn't fully flesh out the implementation. Figuring out XCode and overcoming the relentless crashes with bad exception / error codes was tedious but hugely satisfying, and definitely worth picking through hundreds of stack overflow threads.

What I learned

Neither of us had ever touched XCode or Swift before, or even built front end applications, so we had to learn the entire ecosystem and how storyboarding works. This meant a lot of time was spent figuring out how to make buttons work, and how to pass variables between ViewControllers. However, the instant feedback of GUI building is very satisfying, and XCode does this very well. We also learned a lot about dealing with conflicts over git, and working concurrently on the same document efficiently, including using branches to maximise productivity.

What's next for Digiplant

Keep expanding and adding capabilities - add NFC and RFID systems, and maybe build a physical plant pot system to easily attach the tags to the plants. We could even use moisture sensors to automatically relay soil humidity levels to the application, which could compare those humidity levels with the recommended ones for that species of plants from the API, which would mean you wouldn't even have to think about which ones you needed to water, and would avoid wasting water excessively watering plants that can survive on much dryer soil. If we went in this direction, we'd probably look at setting up a remote server to handle this and other application features. We're probably going to be stuck at home for a while longer with a whole lot of gardening to do, so lots of time to improve!

Share this project:

Updates