Skip to content

12. Input devices

Hero Shot

Individual Assignment.

This week’s Individual Assignment is to add a sensor to Microcontroller board that we made and Measure it.

In my case I am going to use esp32 C3 as my Microcontroller board, soil Moisture Sensor and a Voltage Sensor.

Below you can see my esp32C3 pinout.

Soil Moisture Sensor

The Soil Moisture Sensor uses capacitance to measure dielectric permittivity of the surrounding medium. In soil, dielectric permittivity is a function of the water content. The sensor creates a voltage proportional to the dielectric permittivity, and therefore the water content of the soil.

Below is the pinout of the Soil Moisture sensor.

Electronics design and production

Since I dont have an Input board, I decided to design and produce one to cater for my assignment.

Shematic.

Below is a schematic diagrams of my electronics design. As usual I used Kicad software to design my circuit.

PCB Layout

SO, as usual after the Schematic is done, we Update the PCB editor from the schematic and continue to run traces after which I will generate Gerber files for G-code processing.

Below is a 3D view of the PCB.

Then after I go to flatcam to generate G-code ready for milling processes.

Milling the PCB

The upcoming step is milling the board and as you can below you just have to set the necessary parameters to achieve the best results.

Below you can seen how the board came out.

Soldering

Here it is essential to make a list of all the components that will be used according to your design and collect them all together before soldering activity commences.

Below you can observe the final appearance of our board after soldering.

Programming

Now we can start programming our board. You can download Arduino IDE if you dont have but for me I already installed it from my prvious assignment.

I decided to use a Soil Moisture Sensor as my input device because it is the one I am going to utilize in my final project.

Below is the program code where we want the serial monitor to print the moisture content detected by the sensor.

And here we are you can see the output in the serial monitor.

Files

Kicad_files

G-code_files

What went well/what went wrong

Generally, everything went well. Since I am getting used to KiCad as well as programming right now, this made my life a little bit easier. And still, every week, there is a skill that I learn and with this I am very grateful.

However, some hikups were there. For instance, bed alighnment was an issue I ended up doing a second board after the first one was dicarded due to the alignment issue.

But After setting the bed accordingly, everything went well.


Last update: May 4, 2024