Using Nordic's nRF7002, My Dehumidifier Tells Me When It's Full!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
for this project my goal is to turn this normal dehumidifier into an internet thing I want to know when its fillite is on so I can unfill it using a Nordic microcontroller and their Wi-Fi 6 chip I will detect when it is full and then send a message to my phone but I did run into a major issue with my first RF design my name is James let's get [Music] started [Music] for a workbench Wednesday's video the element 14 Community and Nordic sent me some NRF 70002 Hardware these are a Wi-Fi 6 companion IC that work at 2.4 and 5 GHz the Dual Band aspect is what really got my attention since most iot devices are 2.4 GHz only they sent me a development kit an evaluation board and some ic's up until a point this project was going smooth so let's do like the Marvel Universe and hide a poorly thought out plan by playing with the timeline um at this point in the past I'm about halfway through the project I have this evaluation board with the NRF 70002 connected to a Seed Studio sh based on the nrf52 so that tiny board has an arm cortex M4 microcontroller with 256 Koby of Ram uh you know what we need to go back just a little bit farther Grandpa that's too far yeah this seems right the NRF 70002 design kit has the Wi-Fi chip connected to a NRF 53 microcontroller and another microcontroller to support debug and programming using this board I loaded a mqtt example as a starting point and it was pretty easy to get it to send the value of an analog input about once a minute to make that analog value meaningful I attached a photo resistor and shoved an LED next to it by the way if I say photo transistor I meant resistor I keep mixing up the terms that circuit does pretty well for sending a relative brightness value I'm not worried about what the values of the analog input are at the moment because it doesn't matter until I get to the real dehumidifier but for now this mockup is working so now we can skip ahead a little bit into the future seat Studio makes a series of tiny microcontroller Boards called sha this one has an NRF 52840 s so the board only has 11 total IO pins but I think that's enough for this project to make prototyping easier I added extended test headers that way I could plug it into a breadboard and still have pins to connect either Arduino sticks or scope probes I think most people would use the Arduino library to program these boards however the NRF 72s driver is currently only available in Zephyr so my first step was to create a project with the NRF connect SDK and make sure I understand how the board works unlike the design kit the Shia does not have an onboard debugger and programmer which means I need to double tap the reset button to put the board into a bootloader and and from there we can copy a uf2 file to the virtual drive with that we have an LED that blinks next I Incorporated an optimized version of the ADC code from before that way I can read the sensor and I was able to get a reasonable reading from the ADC then I started to copy the mqtt files from before into this project I had to reconfigure the device tree to map the Spy signals to the pinout on the Sha since it does not expose the quadpy port frankly this did take me quite a bit of time but that's only because I wasn't used to this workflow yet for now the code is finally able to compile and now we can fast forward to where we started this journey welcome back to this point which is actually in the future relative to the last scene but it is also still in the past anyway Nordic sent me another board called the EK or evaluation kit for the NRF 7002 it has an NRF 70002 with antenna as an wio Uno Shield form factor it is meant to plug into other NRF development kits to add Wi-Fi its IO however is not 5volt compatible to connect to the Sha I decided to move the surface mount pin headers from the bottom of the board to the top I used a combination of flux and bismuth based solder to reduce the temperatures required to move the headers I really didn't want to damage the little bits of plastic overall it came out pretty nice and it was very easy to connect to the Sha with jumper wires just to branch the timeline again before all of this stuff I designed a custom PCB for the NRF 7002 the schematic mostly followed the reference design from Nordic I matched up the spy and coexistence signals to the shs available pins I left two analog pins free and those two pins are iqu C compatible so I can use them with an analog or digital light sensor the circuit board is a four- layer board signals are on the top and bottom layers one of the inner layers is only ground and the other has the voltage rails ALS Al I did my best to design the RF traces to be 50 ohms I mention all of that because the pin out I am configuring in the device tree and connecting on the breadboard is based on that design before this project I had not worked with the zephra realtime operating system however with the NRF connect SDK I was able to figure out what was going on in just a couple of days using its examples the good news is I can get the code to compile the bad news is I'm not able to connect anything the thread heads that trigger the ADC read and send a message are running however there isn't a wireless connection available WPA fails to connect or it usually just runs out of memory when initializing regardless I still want my wireless LED detector since I'm running out of time I'm just going to use the development board to get something that works the NRF 7002 design kit has an NRF 53 s so and the Shia has an NF 52 the major differences between the two are the core count and their memory the N f53 is far better suited to handling a TCP IP stack in fact looking at the memory report I'm pretty much using all of the RAM available in the NRF 52 and after doing some searches I found some threads on Nordic Dev Zone that made me wish I had done that search before I tried making my own board the in f52 just does not have enough RAM to do what I want I tried disabling WPA at least as a test but that breaks a bunch of other stuff really I just don't have enough experience with the interf connect SDK Zephyr and Wi-Fi to optimize the code as much as I need as for the custom board I made let's come back to that at the end do you like winning free stuff are you an Electronics hobbyist do you like building cool projects and winning prizes for what you build the element 14 Community presents project 14 the member driven destination where you decide on the challenge you enter projects to win monthly prizes and you vote on the winners what are you waiting for join the element 14 community so you too can enter one of our contest or submit an idea for your own join [Music] now first I soldered the resistor and sensor to the design Kit's headers I also added a wire to connect a lipo battery later I mostly revived the code project from earlier in this video but whenever I press the button to to force a reading I get a value in the 8000s it seems like the ADC is always maxed out my mistake was thinking that the two pin rows were the same signals as the socket I missed the note that said the outer row is ground all right so I fixed that by the way I was going for a voltage divider between a 10 kohm resistor and the photo resistor using a DMM I could see that the photo resistor varies between 6 and 8 kilms on the NRF 53 the difference is about 38c steps and that's all I really care about I'm not converting that to a voltage because it doesn't matter I just need the relative difference between on and off with the electronics mostly working I designed and 3D printed a case that has a hole for the sensor and the lid has a holder for the battery I'm using a 2500 mAh battery but how long is that going to last using a power profiler kit I measured the current consumption for 2 minutes which covers two ABC read and mqtt messages overall average is about 4 milliamps so that works out to be about 20 days with my battery and you know what at this point I'm going with it I know I could save a ton more energy by using sleep modes on the NF 53 and the NRF 7002 however that's still an impressive consumption all things considered the last piece of the puzzle is a bit of python magic this script subscribes to the mqtt broker and listens to the same topic as the the LED detector depending on the message it receives it sends a rest call to a Discord web hook Discord is a chat service and that web hook lets messages appear in a special Channel and the reason I wanted that is because it provides a way for me to get logging messages while running on battery and more importantly notifications to my [Music] phone overall the final design came out bigger than I would have liked I added a sticker to know where the sensor is at to make it easier to place over the LED instead of waiting a couple of hours for this to fill up I'll just open the door which creates a full condition and turns on the [Music] LED and there's my notification now obviously this project did not pan out the way I had planned but we got there in the end now before we close let's go back and look at my custom PCB and do a couple of RF [Music] measurements using a VNA I measured S11 or the return loss by the way if you're not familiar with vnas I have a video explaining them in more detail but for now this instrument sweeps a signal across frequency and then measures what comes back on the PCB I added an swf Port this disconnects the IC and lets me measure the antenna's response it is not a port for an external antenna the dips in the frequency sweep are where the antenna emits the most energy the other areas mean the antenna is not as effective for those frequencies this Trace shows the antenna and matching Network dips at 2.4 and 5.6 GHz which is great for Dual Band Wi-Fi one thing to note is that I'm not in an anaco chamber so even the bench setup is going to affect my measurements also where I placed the antenna on the board is a bit of a compromise spot so I made a second board that extends the antenna away from everything else it performs slightly better at 2.4 GHz but it's not a huge Improvement now again this is not the best measurement setup for example just moving the board around causes the response to change based on those measurements both boards are going to probably do fine at 2.4 GHz since they got to 10 DB however for the 5 GHz channels they may not perform as well moving forward I would like to look at another microcontroller option with a bit more RAM I am also considering a feather based design which I might still explore but instead of Designing the NRF 7002 myself I will probably just use the expansion board which has the RF stuff on a PCB with castellated edges overall even though I didn't get to use my first RF PCB I learned a bunch of stuff about making a modern iot device I have a lot of ideas on where to go next but what about you what would you do next let me know over on the element 14 [Music] Community
Info
Channel: element14 presents
Views: 3,405
Rating: undefined out of 5
Keywords: electronics, hardware, hacking, mods, element14, maker, engineering, element14presents, wifi, home automation, home automation project, iot, Internet of Things, mqtt, microcontroller, WIFI6, Printed Circuit Board, Nordic nRF7002
Id: _88b-4CrrOo
Channel Id: undefined
Length: 12min 23sec (743 seconds)
Published: Fri Apr 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.