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… Continue reading Laying Out Your Project on the Proto Shield
Month: November 2022
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… Continue reading The Proto Shield
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… Continue reading Assembling the Circuit
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… Continue reading Putting It All Together
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… Continue reading Checking for Rain
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… Continue reading Checking Whether It’s Time to Turn a Valve On or Off
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… Continue reading Setting the On and Off Times
Coding
Guess what? Writing code (coding) requires planning as well. You need to think a little about what you are trying to do before you start typing away. Similar to the way you tested the new electronics before doing the whole design, you’ll test each piece of code before going on. The less code there is,… Continue reading Coding
Testing the Temperature and Humidity Sensor
The DHT11 is a popular Temperature and Humidity Sensor. Like the RTC, it is inexpensive and easy to use with Arduino. According to the data sheet, the DHT11 is connected as shown in Figure 8-13. Note the pullup resistor on the data pin. Because we’re adding a component that needs one, let’s add another 10K ohm resistor… Continue reading Testing the Temperature and Humidity Sensor
Electronic Schematic Diagrams
Most electronic circuits are completely defined by two things: 1) which components are used and 2) how they are to be connected. By capturing only this information as clearly as possible, a schematic diagram is the clearest way to visualise and communicate an electronic circuit. A schematic diagram intentionally does not convey the size, shape,… Continue reading Electronic Schematic Diagrams