-
1Step 1
The Project Build
Figure 2
The image in Figure 2 shows the solder side of the prototyping PCB having been mounted on a transparent stand with 5mm spacers.
Figure 3
The image in Figure 3 shows both the prototyping PCB and the plastic enclosure of the Nordic Thingy:53 Bluetooth Low Energy Prototyping Platform mounted on a stand. I made two holes on one side of the enclosure in order to mount the Thingy:53 onto the stand.
Figure 4
The image in Figure 3 is a component side of the prototyping PCB with all the components soldered onto the Printed Circuit Board. The red 5mm LED with a 4.7K current limiting resistor indicates power ON of the 12V power adapter with a 2A current which can output 24W of power to the whole project. Even though the Thingy:53 is battery-powered, I also included a 5V fixed-voltage regulator to charge it. The 24W of power is enough to supply the two power-hangry output devices, i.e. 12V relay and 12V selenoid water valve.
Figure 5
Figure 5 shows both the component side of the prototyping PCB and the top side of the open enclosure of the Thingy:53 with a 3.7V Lithium Polymer battery. Connected to the SIL connector on PCB is a 4-way JST cable with black, yellow, green, and red wires. It connects to the I2C Grove port of the Nordic Thingy:52. In this project I used both as General Purpose Input Output pins (pin 4 and pin 5 of Port 0 in the nRF5340 SoC ) to control the PIR motion detector sensor and the 12V relay.
Figure 6
The image in Figure 6 shows 4 way JST cable connected to the enclosed Thingy:53. When the thingy:53 is enclosed like this, the only thing you can on the top side is a programmable user button.
Figure 7
Figure 7 in the above picture shows a PIR motion detector sensor mounted onto a piece of plastic with a conduit pipe attached to it to help install it on the water tap. This motion detector sensor is powered by a 5V fixed voltage regulator with Max output current of 1000mA.
Figure 8
The image in Figure 8 shows the 12V selenoid water valve with the two-wire cable attached to it. It is DC 12V 0.02-0.8Mpa insulated selenoid valve. The only problem I noticed with this 12V water flow selenoid is that it quickly gets hot when it is being switched ON and OFF at a fast speed. However, this is not a big problem in this application because it is normally closed and it is opened only when the PIR motion detector sensor detects motion in front of the water tap.
Figure 9
The image in Figure 9 shows a 12VDC, 2A power adapter that converts 220VAC mains supply voltage into 12VAC and rectifies this 12V alternating current voltage into 12V direct current voltage. The maximum output power of this power adapter is 24 watts.
Figure 10
Figure 10 is a 220mm long Type C USB cable that I have used to charge the 3.7V Lithium Polymer battery of the Thingy:53. This cable is of the right length given the distance from the Type C USB port on the Nordic Thingy:53 and the Type A USB connector on the prototyping PCB.
Figure 11
The above image (Figure 11) shows all the components connected together to make a complete working project with the top cover of the Thingy:53 enclosure removed. The lit red 5mm LED indicates that the project is ON.
Figure 12
The image in Figure 12 shows the fully-functioning Smart Water Tap Leakage Controller IoT project installed on a water tap on the back side view of a small house on a local Non-Profit Organisation Agriculture Training Farm. When there the PIR motion detector sensor does not detect any motion near in front of the water tap, the 12V water flow selenoid remains closed. This means that water does not flow out of the tap. If it happens that you leave it ( water tap) open, the Nordic Thingy:53 will immediately trigger (energize) the 12V relay and close the water.
-
2Step 2
The Programming Part
Figure 13
The above picture (Figure 13) is an nRF Connect for Desktop app with all the apps. In this project, I only used the apps in the below images.
Figure 14
The above image (Figure 14) is a Toolchain Manager app that shows the buttons that are used to open Microsoft Visual Studio Code Integrated Development Environment in which I wrote the main program that runs on the nRF5340 Silicon on Chip Cortex M33 processor.
Figure 15
The image in Figure 15 shows the opened Microsoft VS Code building a whole Zephry RTOS project. The output of the build process can be seen in the Terminal window of the VS Code. The build process takes time because the Zephry RTOS configures the project first and it has many files to include in the system build process. In this project, I used the machine learning sample as my template code I also want to include embedded machine learning and artificial intelligence that work with Edge Impulse Studio.
Figure 16
The image in the above Figure shows the app_signed.hex file loaded in the Programmer app. The programmer app has an MCUBootloarder that is used to program the hex file onto the nRF5340 SoC of the Thingy:53. The write button is disabled when there is no hex or zip loaded. It is enabled immediately after loading the hex/zip file.
Figure 17
The image in Figure 17 shows the successful writing of the app_signed.hex of the program onto the Thingy:53 prototyping platform. The green color in the middle of the image shows the program space occupied by the app_signed.hex in the nRF5340 Cortex M33 processor.
==================================================================================================================================================================================================================================
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.