Skip to content

Update plant.ino - #1

Open
wmurphy41 wants to merge 9 commits into
jonathanrjpereira:masterfrom
wmurphy41:master
Open

Update plant.ino#1
wmurphy41 wants to merge 9 commits into
jonathanrjpereira:masterfrom
wmurphy41:master

Conversation

@wmurphy41

Copy link
Copy Markdown

This is the code that I used in my version of the automatic plant watering system. Main changes:

  1. Used SoftwareSerial.h library to access the bluetooth module through pins 3 (TX) and 2 (RX). This change fixed a problem where I could not load programs while the module was active. Seemed to be a conflict on the serial bus.

  2. Added a timeout feature so that the pump would turn off after 10 continual seconds so that it would not burn out when the reservoir runs dry.

  3. Added additional commands for controlling the pump. In addition to starting and stopping the pump, you can now adjust the moisture limit up and down, check the moisture limit, pulse the pump for 2 seconds, and reset the pump after the timeout.

  4. Also moved code to C++ from C.

@jonathanrjpereira

Copy link
Copy Markdown
Owner

Hey William,
Thanks for submitting these amazing changes and new features. I will merge this PR as soon as I make the necessary changes to the schematic & PCB files across all mediums.

- Updates to customization values
  o Lowered upper moisture limit to 1000

- Cleaned up use of constants.  They are now used in the initialization of global objects, not in the object definitions themselves

- Changes to control loop:
  o Added logic for when pump is in timeout mode
  o Added logic so that when when the moisture sensor is triggered, it waits an hour before being triggered again

Pump:
- Added function to tell if pump is in timeout mode
- Added function to tell if pump is currently running
-
- Added safeMillis function to Pump to allow for Arduino clock rollover
- Added some more status messages to the Check function to show clock rollovers and to show when moisture sensor is offline.
This version replaced the resistance moisture sensor with a capacitative sensor and added terminal connectors to the board for the moisture sensor, power, and pump.
Changed the timeout code to be based  on stopping the pump once the reservoir is depleted.
@Slats24

Slats24 commented Mar 31, 2020

Copy link
Copy Markdown

Thanks for getting back to me, I since checked on your profile and it seems you have the same project with your updated coding?

If this is the case I can use the code you produced on top of Jonathan’s original work.

@wmurphy41

Copy link
Copy Markdown
Author

That's the case. You're welcome to it. Hope it's useful.

@Slats24

Slats24 commented Apr 1, 2020

Copy link
Copy Markdown

Hi, I am going to be using this code for my own project. However I am using the Arduino UNO. Are they only changes required for the analogue input and TX/RX pins? Thanks

@wmurphy41

wmurphy41 commented Apr 4, 2020 via email

Copy link
Copy Markdown
Author

- Minor cleanups to messages
- Increase baseline resevoir timeout to 90 seconds
New physical design acts as enclosure for electronics and water reservoir for use with any potted plant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants