# How to use DFRobot sensors with MicroBit
This is a documentation about how to make a sensor work using microbit and doing an easy task with it (like showing the information or switching the led screen).
Also the idiea is work with the Kitronic Robotics board shield.
## Materials needed
* Microbit
* Kitronik Compact All-in-one Robotics Board for bbc microbit
* Analog resistance type soil moisteure sensor dfrobot SEN0114
## Preparation
Check that you're able to upload some programs to the microbit using makecode. This is not covered by this documentation.
## How to install the extension of the kitronik board
:::info
You don't need this extension for the sensor to work but I show because it's relevant for the motors and the project about it.
:::
Once we are in the project

We go to the wheel of settings and click "Extensions"

There we look for "Kitronik robotics"

And we click kitronik-robotics-board
If you have it properly installed you should see this:

## The sensor input
### The sensor itself

https://wiki.dfrobot.com/Moisture_Sensor__SKU_SEN0114_
The sensor has 3 pins, Ground (GND), 3V3 and any reading pin
You can see the pinout here:

From the website:
Power supply: 3.3v or 5v
Output voltage signal: 0~4.2v
Current: 35mA
Pin definition:
Analog output(Blue wire)
GND(Black wire)
Power(Red wire)
Size: 60x20x5mm
Value range:
0 ~300 : dry soil
300~700 : humid soil
700~950 : in water
### The connection
We use the cable that comes and we use solid wire to connect it to the board.

It's easy to do a simple hinge wit the solid wires and that's why I suggest to use for the simple projec rather than a dupont cable.
Here you can see the hinges

Then we have to use Analog Read in our code

### Sample code with microbit
This is a sample code using the specifications from the website, in this case we have the led screen changing
<div style="position:relative;height:calc(300px + 5em);width:100%;overflow:hidden;"><iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="https://makecode.microbit.org/---codeembed#pub:_K5WFfCY733u4" allowfullscreen="allowfullscreen" frameborder="0" sandbox="allow-scripts allow-same-origin"></iframe></div>
In photos
This is alone (dry)

And here when you touch both pads with water in your fingers (humid)

## Yet another moisture sensor
Asair DHT11
https://naylampmechatronics.com/blog/40_tutorial-sensor-de-temperatura-y-humedad-dht11-y-dht22.html