Programming Arduino with Python - Internet of Things - ثاني ثانوي

Lesson 2: Programming Arduino with Python

Smart Garden with an Arduino

Lesson 2: Programming Arduino with Python

Loading the components:

Lesson 2: Programming Arduino with Python

Now you will connect the Arduino to the breadboard.

Lesson 2: Programming Arduino with Python

Now you will connect the DC motor to a digital port in the Arduino.

Lesson 2: Programming Arduino with Python

Now you will connect the Temperature sensor to an analog port in the Arduino.

Lesson 2: Programming Arduino with Python

Finally you will connect the Soil Moisture Sensor to an analog port in the Arduino.

Lesson 2: Programming Arduino with Python

Complete Circuit

Lesson 2: Programming Arduino with Python

Physical Circuit

Lesson 2: Programming Arduino with Python

Programming the Arduino Smart Garden Sensors and Motor

Lesson 2: Programming Arduino with Python

Create an infinite loop under which we will write our code.

Lesson 2: Programming Arduino with Python

Insert the temperature and moisture conditions for the watering of the plant.

Complete Code1

Lesson 2: Programming Arduino with Python

Complete Code2

Lesson 2: Programming Arduino with Python

Consider whether an analog output with Pulse Width Modulation would be a more efficient output to control a DC motor. Present your ideas below.

Considering the number of I/O pins of an Arduino and a micro:bit which one is a better microcontroller for a smart garden system. Present your ideas below.

Explain why the sensor input values taken from the analog pins have to be processed with a different mathematical formula depending on the sensor.

Lesson 2: Programming Arduino with Python

Describe why it is important to perform checks on the collected data to see whether the sensors send null or corrupt data.

Consider whether a servo motor would water the plants more precisely and effectively. Present your ideas below.

Expand the Python program with print commands to generate a report of the environment readings every 30 seconds.