Skip to the content
PCBKitNew board
2 layers38.1 × 95.3 mmPlaca, the printed circuit board in 3D

Projet that aims to develop LoRa-connected device capable of measuring temperature, soil moisture and air humidity.

Size
38.1 × 95.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
31
Pads
145
Tracks, vias
303, 11
Pours
3
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
4 Sep 2018
Updated
8 Feb 2019

Overview

Placa is an open-source printed circuit board by patricktlo, from the patricktlo/IotSoilSensor repository on GitHub. It is a 2-layer board of 38.1 × 95.3 mm with 40 parts on 31 nets, routed with 303 tracks and 11 vias.

Its parts include 16 capacitors, 12 resistors, 5 connectors, 2 ICs and 2 diodes. It belongs with the radio and wireless boards and the STM32 boards of this library.

README

README.md

IotSoilSensor

This document is under construction!

This project aims to create a cheap LoRa-connected device to measure soil moisture using an embedded capacitive sensor. It also has a temperature sensor (NTC) and an air humidity sensor (HR202).

This project also contains a small simple gateway for LoRa using a LoRa module, a microcontroller and a Raspberry Pi.

Soil moisture sensor

For the geometry of the sensor I chose a fringing field capacitive sensor because it is well documented and used in academic papers, it was also easy to design it in KiCAD, and easy to simulate in FEMM.

To measure the capacitance a simple RC circuit is used, where R is chosen to achieve a good resolution and measuring range. A comparator (which is inside the STM32L051 microcontroller) is connected to the output of the RC circuit, a simple resistive divider giving Vcc/2 is connected to the other pin of the comparator.

A square wave is applied to the RC circuit, once the comparator changes state, the code of the MCU gets the value of the timer (the same one used for the square wave generations), with this value it is possible to measure the RC constant and hence the capacitive value. This circuit works quite well, before testing the capacitive sensor with it I tried it with capacitors and the results were really close to the nominal capacitive values (data here)

Soil moisture sensor calibration

The gravimetric analysis was used to calibrate our sensor, data can be found here.

Temperature sensor

The temperature sensor is an NTC thermistor because it's simple, cheap and doesn't depend on battery voltage (like DHT11 and others). The circuit is a simple resistor divider, where the value of the other resistor was chosen by finding the inflection point (using a double derivative, more information on the [HR202 sensor python notebook](1_Simulations/HR202/RH Simulation.ipynb), where I developed the math), you can find the math and some cool graphs on the NTC sensor python notebook.

Temperature sensor calibration

I used the beta-equation for the NTC, look here for more info.

The value of beta was given in the datasheet but I wanted to get a closer value so I calibrated it, see more details in this spreadsheet.

Air humidity sensor

The air humidity sensor was a tough one, it would've been pretty simple and straightforward to use a DHT11, but it would stop working when battery levels got to 3V (so pretty soon considering I'm using two AA batteries). So, I chose the HR202, there's not much about it but it's basically a resistive sensor, the RH value changes with temperature and you have to apply AC to it.

In order to provide AC voltage, I polarized the output at Vcc/2, using a resistor divider (look into the LTSpice file or the KiCAD schematic for more. The value of the resistor in this resistor divider is crucial because its value (or more precisely, the equivalent value of the two) define the output characteristics. To find the value of the resistors the inflex point was used (more info on the HR202 sensor python notebook).

Also, just a quick note, since the input voltage is a square wave controlled by a timer, and we want to gather data from the ADC in sync with the square wave, it is needed to fire the ADC conversion with a timer as well.

Air humidity calibration

It is difficult to calibrate this sensor, I found that the values in the datasheet weren't close to my results (although it could be some error in the circuit, I later found in another datasheet a somewhat different circuit which could work better). In order to get a fixed relative air humidity, I put the sensor inside a sealed container with a bottle cap of salt and water, that way after a few hours it gets to 75%. I had an air humidity sensor so I could also use it as a reference. Even though the HR202 wasn't giving out exactly what was written on the datasheet, one could see the output voltage had a correlation with the humidity, so I got two known points, the 75% from the salt-water solution and the ambient RH from the other sensor, and fitted my sensor values to this line. It's far from perfect but it does give an idea of the RH.

Battery

LoRa

STM32L051

PCB

Gateway

Database

Parts

40
QtyValueFootprintReferences
5100nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC2, C3, C8, C15, C17
410kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR1, R7, R9, R11
210nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC7, C13
210pCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC11, C14
220pCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC6, C9
222kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR4, R12
2330Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR2, R3
247kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR6, R10
2LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD1, D2
2Screw_Terminal_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1, J3
110uCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC4
11uCapacitor_THT:CP_Radial_D5.0mm_P2.00mmC5
132.768 kHzCrystal:Crystal_Round_D1.0mm_VerticalY2
1390Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR5
1470nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC16
1660nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC10
18 MHzCrystal:Crystal_HC49-U_VerticalY1
1Ai-Thinker-Ra-01TCC:Ai-Thinker-Ra-01-LoRaU2
1C_VariableTCC:Moisture SensorC12
1Conn_01x02_MaleConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5
1Conn_01x04_MaleConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1HR202Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalR8
1STM32L051C8TxPackage_QFP:LQFP-48_7x7mm_P0.5mmU1
1TestPointsConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ4
1ThermistorResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P1.90mm_VerticalTH1

Questions

How big is the Placa PCB?

It measures 38.1 × 95.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Placa use?

40 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Placa KiCad files?

From the patricktlo/IotSoilSensor repository on GitHub, at the commit this page was made from: the board is 2_PCB/placa.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Placa design in my own project?

Its repository states no licence, so its author keeps all rights: ask patricktlo before reusing the design.

Similar boards

  • 2 layers139.7 × 73.7 mm134pin 7-967288-1, the printed circuit board in 3D

    134pin 7-967288-1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    40 parts1.2k
  • 2 layers149.4 × 177.4 mmLightsculpture, the printed circuit board in 3D

    Lightsculpture

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    40 parts915
  • 2 layers150 × 50 mmEleLab v2 Bus150, the printed circuit board in 3D

    EleLab v2 Bus150

    Chrismettal/EleLab_v2

    Cheap DIY lab system for hobbyists and the tinkering folk

    40 parts531GPL-3.0
  • 2 layers66.4 × 48.1 mmRaspberry, the printed circuit board in 3D

    Raspberry

    Chrismettal/flipper-zero-backpacks

    Backpack-style addon boards for the Flipper Zero!

    40 parts456
  • 2 layers44 × 44 mmTrackball, the printed circuit board in 3D

    Trackball

    jfedor2/rp2040-pmw3360

    RP2040+PMW3360 PCB and code

    40 parts432
  • 2 layers90.8 × 53.3 mmABSIS Bus Master, the printed circuit board in 3D

    ABSIS Bus Master

    jrsteensen/OpenHornet

    OpenHornet 1:1 F/A-18C Simulator Repository

    40 parts431
  • 2 layers59.6 × 109.5 mmDrop, the printed circuit board in 3D

    Drop

    ohmtech-rdi/eurorack-blocks

    Software to Hardware Prototyping for Eurorack using C++, Max/Gen~ or Faust

    40 parts410
  • 2 layers123.8 × 73.5 mmAttic, the printed circuit board in 3D

    Attic

    simondlevy/Hackflight

    Minimalist flight-control toolkit for makers

    40 parts334GPL-3.0