Author: haroon

  • Assembling Your Project into a Case

    Now we need to consider mounting the project in a case. Your best bet is a case that is not too deep to allow easy access, and lay everything out with a bit of room around them. Remember that the Arduino has a shield on top of it, and perhaps the RTC is standing vertically,…

  • Testing Your Assembled Proto Shield

    First test your shield without the valves or valve power supply. Plug the shield into your Arduino. Make sure the male header on the shield goes into the correct Arduino pins. Look between the two and make sure that no connections from the bottom of the shield are touching anything on the Arduino. If they…

  • Soldering Your Project on the Proto Shield

    For a great tutorial on how to solder, study the “Adafruit Guide to Excellent Soldering.” Now, finally, you’re ready to start soldering! WARNING Don’t rush. Be careful. Remember to breathe and relax. Double-check the schematic for each connection before you solder it. Inspect your work often for bad solder joints or other mistakes. Don’t try to…

  • Laying Out Your Project on the Proto Shield

    The first step is to think about what needs to fit on here, and where they will be. We need to make room for the MOSFETs, relays, LEDs, and screw terminals. The screw terminals should be along a side that is accessible, and it would be nice if the LEDs were near the appropriate screw…

  • The Proto Shield

    As I mentioned earlier, we’ll use the Proto Shield because it provides a secure and easy way to connect a project to Arduino. You can buy this from the Arduino Store. There are many other Proto Shields available. Any will work, but you may have to make changes to the layout to fit your particular shield. Some…

  • Assembling the Circuit

    Finally, we’re done with the sketch and we’ve tested all the components! Are we ready to start soldering? Not quite: we’ve tested the various components separately, but not together. You might think that this step is unnecessary, but integration testing is vital. This step discovers unexpected interactions between components, whether hardware or software. For instance, two components…

  • Putting It All Together

    We’re almost done with the sketch. Just a couple of other minor things to consider, and then we can put this all together. First, what if the user wants to see the current valve schedule? That’s easy, but how does the user tell us? The user could type the letter P for “Print”, but now the sketch…

  • Checking for Rain

    What about checking for rain with the humidity sensor? You can do this at the same time you check the time, but it becomes a very long line. It’s OK to use another if() statement; long-time programmers might tell you this is less efficient, but your garden won’t care if the water comes on a split second…

  • Checking Whether It’s Time to Turn a Valve On or Off

    Next, let’s look at the data from the RTC and figure out how we’ll use this to decide whether it’s time to turn something on or off. If you go back to the RTC example ds1307, you’ll see how the time is printed: Conveniently, this is already a number, so comparing with the hours and minutes…

  • Setting the On and Off Times

    We want to turn the water valves on and off at different times of the day. We’ll need some way to record those values. Because we have three valves, we might use an array, with one entry for each valve. This will also make it easier if we later want to add more water valves. You…