Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Getting started with my first project

    Scheduled Pinned Locked Moved Projects
    micropythonmoisture sensorhelpcomments
    5 Posts 2 Posters 1.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Sandking
      last edited by

      Hi,
      My first project is a water sensor on a Sipy

      The sensor that I have doesn't have a serial number, so how would I include it into the main.py code?

      import machine
      from machine import ADC
      adc = ADC()
      apin = adc.channel(pin='P1')
      apin()

      I need the sensor to activate a relay, for that it should be a simple output

      pin = machine.Pin(15, machine.Pin.OUT)

      please comment and let me know where i am making mistakes or where i should improve

      1 Reply Last reply Reply Quote 0
      • sebS Offline
        seb
        last edited by

        Can you explain a little more about this sensor? What interface does it have, is it just an analog voltage that maps to a water level? Is it just an on/off float switch?

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Sandking @seb
          last edited by

          @seb it is a water moisture sensor that reads a voltage between 2 probes.
          below is the link to the site I purchased the sensor from
          https://www.robotics.org.za/SOIL-KIT-PRO?search=Soil Sensor Kit - Pro

          sebS 1 Reply Last reply Reply Quote 0
          • sebS Offline
            seb @Sandking
            last edited by

            @sandking

            Are you using the analog output or the digital one? Also what voltage are you powering the sensor from?

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              Sandking @seb
              last edited by

              @seb I have not attached it yet, was doing the homework on what will work best.
              Will try it on the 3.3V, might go with a digital reading as all I am looking for is a true/ false statement to activate the relay

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom