Connecting 8 soil moisture sensors with Arduino Mega 2560

Hello. My group and I are kinda new to using the Arduino system. We are planning to connect and use a total of eight soil moisture sensors to Arduino Mega 2650 but we are having a hard time doing it. How do we connect it properly to the microcontroller? Do we need to buy a sensor shield or a multiplexer as well? Please do help us.

Our whole project is a smart irrigation system with 8 soil moisture sensors and 1 DH22 temperature and humidity sensor. We will be using this as our project in one of our courses. This will involve using a solenoid valve as well. Please give us some advice. Thank you so much.

Arduino Mega 2560 has enough pins for 20 such sensors
how sensor is connected and used - look videos and read tutorials it is very simple.
if need more current as 20mA - use MOSFET,
if something contain coil it need flyback diode.

Hello fkdlakfm

Welcome to the world's best Arduino forum ever.

Please post the data sheet of soil moisture sensors used to see how we can help.

(post deleted by author)

We are gonna be using this type of soil moisture sensor but 8 of this. The tutorials on YouTube only show 1 of them being used so we are kind of confused about how can we connect 8 of them to the microcontroller.

The tutorials in Youtube only use one sensor so we are having a hard time.

do you ready to give up ?

Not at all. :smile:

A quick google with 'Arduino using multiple DH22 sensors'
gave me this first hit:

https://forum.arduino.cc/t/taking-readings-from-multiple-dht22-sensors-how-to-get-the-mac-address-of-each/211962

which has some helpful suggestions.

At a glance I'd say you'll be allocating each to its own pin. And using ready-made code from a library, such as Rob Tillart's.

1 Like

This is a great start. Thank you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.