1

I’ve recently embarked upon a project that I’ve wanted to do for a while. My overall plan is to have 3 planting shelves; each will have its own soil moisture sensor, water pipe and LED lighting. The basic premise of the project is that the LEDs will turn on for a certain amount of time each day; this is the simple part of the project. However, the second part of the project is to read the soil moisture sensors periodically, and then water each tray if required. Watering will be done via relay activation for an individual tray if the moisture level is too low.

After some research, I learned there is no built in analogue input on the raspberry pi. This led me here - to a device that looks perfect for my project.

I am aware that this project may be better suited for an Arduino, or a device such as the NodeMCU as the computational requirements are not too demanding, it doesn’t require WiFi and is far easier to get analogue inputs. However, I have virtually no experience with programming in C, but have much more experience in Bash scripting. In other words, the availability of a familiar programming language drives the decision to use the Raspberry Pi.

Here are the parts I am going to order:

Below, I have attached a schematic of how I think it should all be wired up at the moment. I would really appreciate it if someone could look over the diagram and let me know if it looks okay. One of my main concerns is whether it will be okay to run 3 moisture sensors off the same 5V out pin.

Wiring diagram

5
  • 1
    Welcome. I removed your "p.s" since invitations to brainstorm on a range of tangential topics do not suit our format. To understand better, please take the tour and read "What types of questions should I avoid asking?".
    – goldilocks
    Jun 26, 2018 at 15:29
  • 1
    Casual note: "an Arduino such as the NodeMCU" -> The latter is not any sort of the former, perhaps you meant "or a" instead of "such as the".
    – goldilocks
    Jun 26, 2018 at 15:31
  • @goldilocks Thanks for your replies and your edits. Apologies for the P.S. section, I wasn’t aware of that but I’ll have a look over the guidelines for future reference. Sorry just assumed the NodeMCU was a type of arduino as it is programmed from the IDE... goes to show my lack of experience with arduinos!
    – Tom
    Jun 26, 2018 at 15:40
  • To clarify NodeMCU a bit: It's actually more firmware than device. The microcontroller it runs on is an ESP8266, which, using the normal firmware, does have an Arduino IDE interface. However, NodeMCU does not; it runs a lua interpreter. Because there are ESP8266 packages with NodeMCU installed sold as NodeMCU boards (to which you can flash any firmware you want), and these tend to be nicer units than a lot of ESP8266 boards, I think there is a some confusion about this online.
    – goldilocks
    Jun 26, 2018 at 16:14
  • 1
    Your diagram would be best portrayed using the "Schematic Tool" provided - it's the icon at the top of your edit box just to the left of the "Ordered List" icon (1---2---3---).
    – Seamus
    Jun 26, 2018 at 18:33

2 Answers 2

1

Wiring looks ok except powering the soil moisture sensors with 5V. Unless there is a good reason to do that, powering analog sensors with the same voltage as ADC (i.e. 3.3V) would be more logical. According to ADS1115 datasheet:

Analog input voltages must never exceed the analog input voltage limits given in the Absolute Maximum Ratings.
If a VDD supply voltage greater than 4 V is used, the ±6.144 V full-scale range allows input voltages to extend up
to the supply. Although in this case (or whenever the supply voltage is less than the full-scale range; for example,
VDD = 3.3 V and full-scale range = ±4.096 V), a full-scale ADC output code cannot be obtained. For example,
with VDD = 3.3 V and FSR = ±4.096 V, only signals up to VIN = ±3.3 V can be measured. The code range that
represents voltages |VIN| > 3.3 V is not used in this case.

This means that if your sensor will output more than 3.3V (which might be the case for an analog sensor powered with 5V), the values won't be measured by the ADC, though ADC will survive. I didn't search for a datasheet for the soil moisture sensor, and the link posted have no information on the output range the sensor has, so make sure it matches your ADC capabilities at given full-scale range (FSR) and VDD.

In addition, it would be good to check power consumption, to make sure that all the peripherals won't draw too much current. (I doubt that it will, but it is difficult to judge without seeing datasheets and knowing which power supply you are using.) This thread and comments and links inside it might be useful to understand the limitations.

0

The proposed wiring appears okay.

I can't comment on the P.S. about the e-ink display as I have no experience of their use.

4
  • Thanks for looking over the wiring! Do you think it would be alright to power the 3 sensors off the same 5v our pin then? (No worries about the display, I’ll do some more research)
    – Tom
    Jun 26, 2018 at 15:36
  • The devices don't declare their current usage so no guarantee. However I'd be surprised if they needed more than a few milliamps each so there should be no problem.
    – joan
    Jun 26, 2018 at 17:16
  • Okay thank you for your help! I’ll do some searching around online to see if other, similar, moisture sensors declare their current usage
    – Tom
    Jun 26, 2018 at 17:22
  • 1
    The proposed Arduino relays have 05VDC markings, and may not work with Pi 3.3V GPIO signal levels. If you experience relay issues, your chosen vendor does have 3.3V relays (see "FeatherWing").
    – OyaMist
    Jun 26, 2018 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.