Introduction: Development of a Board for Home IoT

This project is part of the Internet of Tricks Erasmus+ Project and is a device for controlling some household devices by interfacing with a voice assistant. The board is able to open and close doors by controlling a servomotor, turn on fans with a DC motor and lights by controlling LED lamps. This device has pedagogical purposes; it is designed to increase user awareness of the benefits of IoT in home environments.


In this tutorial, it will be shown how to produce a PCB, and how to make the electrical connections between the board and the actuators (servo, DC motor, and LED) in order to be controlled by Alexa voice commands.


The part of the firmware, web connection by MQTT protocol, and ALEXA connection are described in this tutorial.

Supplies

What do we need?

Surely, you need to get a board as described below in "step 1 PCB".

You then need:

  1. A PWM controllable Servomotor;
  2. 5V DC motor;
  3. Lipo battery;
  4. Led;
  5. 100Ohm resistor;
  6. Cables for wiring;

Optional: a Diode of at least 1W to protect the circuits.

All files you need for producing the PCB are available and attached to this tutorial. First of all, the electronics schema show components and link among them.

Step 1: PCB

We can rely on a professional service to print, assemble, and solder a PCB. In this example, we have reported the procedure carried out with JLCPCB, which has fairly low costs compared to the average.


It is then necessary to create a new project, make upload the production files shown here attached, based on the hardware project presented above.


The JLCPCB service also performs an electrical test to ensure the reliability of the board and components.


After that, you finalize the order and wait for the package to arrive at your home!

Step 2: Board Test

The easiest and most immediate way to test a board is to... USE IT!


Please note: it is possible to test these boards in this easy way because the signals, voltages, and power consumption are relatively low. The risks are definitely negligible. In other contexts, more accurate tests would be necessary to ensure the safe use of the board.


Attached, the schematic explains how to make the connections.


The servo should be connected to 5V voltage and Ground to be powered. Since it is PWM controlled, the signal lead on the fifth input of the right header (on which the firmware will output the control signal) must also be connected.


The DC motor should be connected to the terminal board, in holes A1 and B1. Should the wires be reversed, the effect would be to see the motor turn in the opposite direction. The board provides the ability to control a second DC motor, of course, the firmware would need to be properly verified.


The LED lamp should be connected on the ground of the bottom green terminal block (Cathode) and on the fourth hole (Anode) of the left female header. The GPIO on which the firmware controls the LED is precisely the one used for the anode. Of course, there is the possibility of adding many more LEDs as there are other GPIOs that are not used. It is sufficient to modify the firmware by duplicating the section that deals with the output on the GPIO.

Step 3: Validation

To carry out the testing, a 3D-printed PLA house was assembled as described in this tutorial.


To avoid the risk of power cable reversal, it may be useful to use a diode to be affixed between the positive terminal of the Lipo battery and the positive input of the board. A connection error would cause damage to the board.


After that, the board was turned on by giving it power and was connected to the Internet using wifi. Using the Alexa commands described in this tutorial, all functions were tested.

Step 4:

This tutorial was developed as part of the Internet of Tricks project, co-financed by the Erasmus + program of the European Union. Project n°: 2021-1-SE02-KA220-YOU-000028971


The content of this publication does not reflect the official opinion of the European Union. Responsibility for the information and views expressed therein lies entirely with

The authors.


For more details contact info@horizonlab.eu