DIY low-power LoRa water-meter - Part 3 : Hardware design

Saturday, August 5, 2023

This blog post is part of a series of posts:


Hardware design

Important notice : I’m a software engineer, and I have very limited knowledge and experience in anything related to hardware design and electronics. I can read a datasheet and a schematics, and I can plug components on a breadboard. But I’ve never designed complete electronic boards and PCB so.. bear with me ;-)

The first prototype was very messy, but it allowed me to implement the whole firmware and check that everything was working as expected.

As you can see on the following picture, I’m using a NRF52DK board as a SWD probe (to flash and debug the firmware). I also use the NRF PPKII as power source and power profiler, and a logic analyzer, the Saleae Logic 8 , to probe various signals from the MCU and LoRa module. There’s also a 4600mAh battery (which was replaced later on by a 1000mAh one).

Untitled

Once everything was working properly, I cleaned the setup and used a single breadboard. This allowed me to run longer tests.

Untitled

I was very happy with the software but the hardware setup wasn’t “production ready”. This setup on a breadboard is very fragile and unreliable. Plus, I wanted to use this waterproof case I bought when I thought I would use the Lopy board.

So I decided to try something completely new to me : design a print a PCB! I have never done that, but I remembered that a colleague told me about Fritzing , an open source tool that allows you to draw your circuit on a breadboard and then to design the coresponding PCB. They also run Fritzing Fab a service that builds (prints?) the PCB for you at a affordable price.

So first, I replicated the actual breadboard setup in Fritzing:

pcb_bb.png

Then I switched to the PCB view and tried to route all the traces on 2 layers (top and bottom). It’s a lot more complicated than I expected : traces cannot cross other traces from the same layer! I spent way more time than expected on this step, but I have to say I’m quite happy with the result.

pcb_pcb.png

Before placing the order to print the PCB, I double checked that my measurements were correct by… printing the PCB on a piece of paper, drilling holes for the screws and components and checking that everything fit nicely:

Untitled

And here is the results after a few adjustements:

Untitled

Then, I placed an order to Aisler to build the PCB. The whole process was very easy, even for me! The minium quantity is 3 PCBs, and it cost 24€ (+ shipping) to print them.

I received the PCBs a few days later:

20230720_124544.jpg

Next step : solder everything together!

20230720_212639.jpg

And put everything in the case (the battery is under the PCB):

20230720_224035.jpg

Awesome! Everything fit nicely in the case, and works as expected!

I’ll provide more details on the software implementation in the next part of this series!

Embeddeddiynrf52projectlorattn

JF

I am passionate about IT, (embedded) software development and open source technologies in general. I’m mainly working on the InfiniTime project , an open source firmware for the PineTime smartwatch from Pine64 .

DIY low-power LoRa water-meter - Part 4 : Software

DIY low-power LoRa water-meter - Part 2 : From prototypes to the final product