Use Soil Moisture Sensor With Magicbit [Magicblocks]

by magicbit in Circuits > Sensors

205 Views, 0 Favorites, 0 Comments

Use Soil Moisture Sensor With Magicbit [Magicblocks]

Use Soil Moisture Sensor with Magicbit [Magicblocks]

This tutorial will teach you to use the Soil Moisture Sensor with your Magicbit using Magicblocks. We are using magicbit as the development board in this project which is based on ESP32. Therefore any ESP32 development board can be used in this project.

Supplies

  • Magicbit - Pro

Story

Hello and Welcome, This short tutorial will teach you to use the Soil Moisture Sensor with Magicbit using Magicblocks.

There are 1 main method of achieving this goal;

  • By using Dashboard Gauge.

First of all log into to your Magicblocks account,

Magicblocks is an easy visual programming software for program your magicbit. Anyone can program their micro controller by using magicblocks.io and there is no need of programming knowledge. You can sign up for free.

Start and Open the Playground.

Next make sure your Magicbit is connected to the internet and plugged-in and also linked to your account through Device Manager.

All Done? then scroll down to Method 1

List of Items Required

Magicbit: Magicbit Is an integrated development platform based on ESP32 for learning, prototyping, coding, electronics, robotics, IoT and solution designing.

Setting Up the Analog in Block

screenshot_(164)_5qE3sDGaWE.jpg
screenshot_(166)_R3RSkG7004.jpg
screenshot_(91)_e2s5IXGa0Y.jpg
screenshot_(167)_0GJXINNknw.jpg
screenshot_(168)_bVTOKiTnkQ.jpg

1. Drag & drop the Analog In block from the input nodes section on the left of the screen to the Flow.

2. Double-click on the Analog In block and type or paste your unique Device id from the Device Manager Tab on your Magicblocks account. [ This will link the analog in with the Magicbit ]

3. Choose 'PIN33' from the PIN drop-down menu.(Connects with component connect to the PIN33 on your Magicbit)

4. Select the Method as Interrupt from the drop-down menu.

Setup the Range Block

screenshot_(171)_IaUijHOqAg.jpg
screenshot_(172)_UKfLI31fpY.jpg
screenshot_(173)_Tb0AkmRQU1.jpg

(This Node is used to inverse the input values from the Analog In node)

1. Drag & Drop the Range Block from the function nodes section on the left of the screen to the flow.

2. Type the input range and result range as below;

(Make sure to tick the 'Round result to the nearest integer' check box to avoid decimals)

Setup the Gauge Block

screenshot_(169)_4nedEwv9IX.jpg
screenshot_(170)_DihrurU8iF.jpg
Capture.JPG
screenshot__34__LgAo8klYI3.jpg
screenshot__35__x1BhIXZnSM.jpg
screenshot__37__sCxZ7X5jV4.jpg

1. Drag & drop the Gauge block from the dashboard nodes section to the Flow.

2. Change the Range of the Guage to 0 - 4095.

[Optional] Import Already Setup Nodes

If you had trouble setting up nodes, you can use the import feature in Magicblocks to get the nodes which has been already setup.

  • First copy this code to your clipboard.
  • Click on the options menu on the top right-hand corner of the screen.
  • Next hover your cursor over the Import sub-menu.
  • Then click on Clipboard and paste the code on your clipboard to the text field.
  • Select current flow or new flow and click on Import.

IMPORTANT

Make sure you type your device id on the Analog In node properties.

Finally Deploying the Blocks

screenshot__88__o65645S9to.jpg
screenshot__89__qsXqYHDwdI.jpg
screenshot_(165)_uNTbYl6hRw.jpg
screenshot_(174)_dBQ73ZPST8.jpg
screenshot_(175)_bmnQr4yLfF.jpg

  • Make sure all the blocks are connected.
  • Click on Deploy button on the top right-hand corner of the screen.
  • After deploying go to the dashboard ui by clicking the link to dashboard URL on the top right-hand corner of the screen.
  • Connect the component to the Magicbit physically.
  • Any Moisture change in soil will the displayed on the Dashboard Gauge.

Troubleshooting

  • Check whether your Magicbit is connected to the internet.
  • Check whether the correct PIN is used (e.g. 'PIN 33').