Переглядів 23,311
Growing Strawberries with a Raspberry Pi, on autopilot, EP#2
In this episode, I'll start to add the specific hardware that my automated gardener needs. And the first piece will be the moisture sensor.
00:00 Intro
01:15 What’s the best moisture sensor?
02:13 Wiring
03:53 Rasperry PI via command line
05:17 Installing prerequisites (apt-get update, etc.)
06:45 Installing text editors for coding
08:47 Installing moisture sensor packages and libraries
14:39 Testing the moisture sensor code!
15:36 ERROR!!! (No I2C device at address: 0x26)
16:40 It works!
18:14 Let’s try to understand and modify the code!
22:28 Prototyping the water pump logic with a simple if statement
24:37 Conclusion
THE TOOLS I USE IN THIS VIDEO:
- Raspberry Pi 4 (Model B)
- Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor: www.adafruit.com/product/4026
LINKS AND CODE BASE FOR EACH STEP:
STEP #1 - wiring: learn.adafruit.com/adafruit-s...
STEP #2: Prerequisites:
learn.adafruit.com/circuitpyt...
STEP #3: Installing mcedit and Sublime Text:
sudo apt-get update mc
OR
data36.com/sublime-text-data-...
STEP #4 - Python Installation of seesaw Library:
learn.adafruit.com/adafruit-s...
STEP #5 - Enabling I2C, SPI and installing RPI.GPIO + adafruit-blinka:
IMPORTANT! After I’ve recorded this video, Adafruit changed their tutorial, so you EITHER follow their new stuff, here:
learn.adafruit.com/circuitpyt...
OR you follow the stuff in the video by running these lines:
* sudo apt-get install -y python-smbus
* sudo apt-get install -y i2c-tools
* sudi raspi-config
* sudo reboot
* sudo i2cdetect -y 1
* sudi raspi-config
* sudo reboot
* ls /dev/i2c* /dev/spi*
* pip3 install RPI.GPIO
* pip3 install adafruit-blinka
STEP #6 - Testing Blinka:
learn.adafruit.com/circuitpyt...
STEP #7 - Actually installating the seesaw Library:
learn.adafruit.com/adafruit-s...
STEP #8 - Using the moisture sensor code:
learn.adafruit.com/adafruit-s...
STEP #9 - The modified version of the script that I used at the end of the video:
github.com/tomimester/automat...
OTHER LINKS MENTIONED IN THE EPISODE:
- Newsletter: data36.com/newsletter
- Free mini-course: data36.com/how-to-become-a-da...
ALL EPISODES:
• Building an Automated ...
NEXT EPISODE:
• Moisture Sensor Automa...
IMAGE SOURCES:
- COVER: Photo by Isaac Quesada on Unsplash
-------
Check my website: data36.com
Get access to more data science tutorials, join the inner circle: data36.com/inner-circle
Find me on Twitter: / data36_com