Creating a Talking Plant with Arduino

Creating a Talking Plant with Arduino

MAKER: Husham Samir/Translated by: Qu Wujin

Nowadays, many households have a few pots of pothos or other beloved plants. But as a beginner, do you know when is the best time to water your plants? Do you really understand your plants?

In today’s tutorial, we will learn how to use an Arduino Nano with an MP3 player module to solve this problem – making your potted plant “talk”. Once you have a chatty plant, you will often receive its morning greetings, environmental condition evaluations, understand its mood, and even reminders to water it…

We will use these three sensors and connect them to the Arduino: LDR sensor, capacitive soil moisture sensor, DHT22 temperature and humidity sensor.

Creating a Talking Plant with Arduino

How does it work? We will read the sensor values in the Arduino, and when the values exceed the limits we define, the Arduino will send a play command to the MP3 module.

As for how to do it? In this tutorial, we won’t need to write any code scripts; we will use the XOD IDE software.

Huh? Not familiar with what XOD is? XOD is a free, open-source, and powerful visual microcontroller programming software. It represents hardware and computing elements as connectable nodes in a window, allowing data to flow between objects.

You can download the software from the link below: https://xod.io/

Materials List (Hardware)

Creating a Talking Plant with Arduino

Arduino Nano, YX5300 Catalex Serial MP3 module, capacitive soil moisture sensor V1.2, DHT22, LDR, 10 KOhm resistor, experiment breadboard, wires, speaker with auxiliary input.

Circuit Diagram

Creating a Talking Plant with Arduino

Communication between the Arduino and the MP3 module will be completed via software serial UART. Pin D5 in the Arduino will be defined as software RX and connected to the TX pin of the MP3 module. Pin D6 in the Arduino will be defined as software TX and connected to the RX pin of the MP3 module.

Creating a Talking Plant with Arduino

Temperature sensor – A0, LDR sensor – A1, DHT22 – D13.

All VCCs should connect to a 5V voltage, and GND should be grounded.

Creating a Talking Plant with Arduino

I will first connect all sensors to the breadboard for testing, and then solder them onto the PCB.

Preparing the SD Card

1. Format the Micro SD or Micro SDHC card to FAT16 or FAT32.

2. Create folders “01” and “02”.

3. Copy the MP3 files one after another into folder “01”. Remember! The MP3 module does not rely on file names to select files, so be sure to note which file you copied first.

To avoid forgetting, I choose to use an index record. So, the first file you copy will be number “1”, the second will be number “2”, and so on.

4. Insert the Micro SD card into the TF card slot of the Serial MP3 player.

Generating MP3 Files

Creating a Talking Plant with Arduino

Creating a Talking Plant with Arduino

For this step, I chose to use Amazon Polly Text to generate MP3 files. If you also plan to use Amazon Polly Text to generate MP3 files, you need to register an account first.

The MP3 files used in this tutorial can be downloaded from the project file library: https://make.quwj.com/project/386

Programming with XOD

Creating a Talking Plant with Arduino

Creating a Talking Plant with Arduino

Then, please follow the steps in the video.

1. Add the MP3 library: Open file – Add library – Search for Catalex MP3 – Download.

2. Add the monitoring node: Press “I” or double-click anywhere – Search for clock – Select the clock point. Once set, the clock point will send a pulse every second based on the IVAL value.

3. Add the analog sensor node: Change the port to A1 (LDR sensor connected to pin A1).

4. Add another analog sensor node: Soil sensor needs to be connected to this node via port A0.

5. Add DHT2X node: Change the port to D13 (connect the DHT-22 sensor to pin D13).

6. Change the descriptions of these nodes to show that the hardware is connected to these pins.

7. Add mapping (Map) node: The mapping node will be used to change the sensor’s range.

The range of the LDR sensor is 0-1 Smin-Smax; after mapping, this will change to 100-0 Tmin-Tmax. Similarly, the mapping node in the soil sensor will be configured to 0.39-0.6 Smin-Smax.

8. Add greater and lesser nodes from the search node. For the Greater node, if IN1 is greater than IN2, it outputs true; otherwise, it outputs false. For the Less node, if IN1 is less than IN2, it outputs true; otherwise, it outputs false.

9. Add Pulse-On-True node.

10. Repeat the same steps on the DHT22 node.

11. Add a monitoring node on all sensors to achieve real-time data monitoring via computer. This node is used for troubleshooting, testing, and calibration, and can be removed after monitoring.

12. Add MP3-Play-Song-Number node.

When a signal is received from the initiate pin, this node will play music.

Also, pin D5 will be defined as software RX and connected to the TX pin of the MP3 module. Pin D6 will be defined as software TX and connected to the RX pin of the MP3 module. Set the baud rate to 9600.

As I mentioned earlier, since the MP3 module does not rely on file names to select files, I will use index records here. Therefore, the first MP3 file we copied to the SD card will be song ID 1, and so on.

Again, please pay attention to the order of files on the SD card.

13. Go to deploy – upload to Arduino. Please ensure you have selected the correct hardware and port, and make sure you have checked “Upload after debugging” (if this box is not checked, the monitoring node will not run).

14. After successful upload, you can monitor the sensor values in the monitoring node, and you can also define the sensor’s range and set points based on these values.

I hope you enjoy this tutorial.

The code used in this project can be downloaded from the project file library: https://make.quwj.com/project/386

via instructables.com/Let-Your-Plant-Talk/

Links in the text can be clicked to read the original text at the end

Creating a Talking Plant with Arduino

More exciting content

Make a motorcycle dashboard with Raspberry Pi

Make a smart pet feeder with Raspberry Pi

Build a smart planetary observer based on Raspberry Pi

Handmade metal wireframe X-wing clock

Arduino + 280 LEDs DIY music spectrum light

DIY Stanford Pupper 12 DOF Quadruped Robot Dog

Barrier: PC and Raspberry Pi keyboard and mouse sharing solution

Creating a Talking Plant with Arduino

Leave a Comment

×