I've realized that I'm not sufficiently up the learning curve with the PSoC6 and Modus Toolbox to attempt to implement vision processing on the PSoC6 in the timeframe of the design challenge. I have been trying out different "intelligent" camera modules and thought that would be a good backup alternative to add Vision AI to my project. One of the modules that I just tried is the Arduino Portenta H7 with the Ethernet Vision shield: Arduino Portenta - Person Detection .
Eventually, I intend to integrate the Portenta and the Microwave Detector more directly with the PSoC6 using GPIO and UART interfaces. For now, to stay modular and to have some placement flexibility - I'm going to add the Portenta using MQTT and WiFi as I did with the Microwave sensor.
I have a bad habit of expecting things to go smoothly when adding "modular" elements. After all, I had both the PSoC6 and the Portenta running independently with MQTT - what could go wrong? Well, I ended up getting wrapped around the axle because of inexperience with FreeRTOS and the way I had merged the MQTT and EInk Display functionality. When I incorporated the Microwave sensor, I added a message queue between the Subscriber task and the EInk Display task and that all worked as I expected. I thought that since Person detection is asynchronous to Microwave detection that I just needed to add an additional queue for the new topic. However, that broke the existing queue. The queue send operation is happening, but not the queue receive. Not sure why the queues are interfering with each other. I am not familiar with the debug trace in Modus Toolbox and with less than a week left in the challenge - I decided that I needed to move on. It turns out in my project that the Display task does not need to be independent of the Subscriber task, so the simple solution is to merge the two tasks and eliminate the requirement for these two queues (I still have the MQTT queue for the Publish/Subscribe). That's working and I'm moving forward with that. I really want to use this issue as as an opportunity to learn the debugger, so I'll work on it again after the challenge is done.
Current functionality:
- Microwave detection
- First detection
- Turn on LED
- Display "Motion Detected" message
- Play "Motion Detected" track
- Subsequent detection
- If Motion timeout has not occurred - reset timeout counter
- If Motion timeout has occurred - repeat First detection tasks
- Motion timeout (area is considered secure if there is no addition motion detected within a minute)
- Turn off LED
- Display "Area Secure" message
- Play "Area Secure" track
- First detection
- Person detection (only reported if Microwave detection has occurred and not timed out)
- Display "Person Detected" message
- Play "Person Detected" track
- No Person detected (only reported if Microwave detection has occurred and not timed out)
- Display "No Person Detected" message
Below is a demo of the functionality. I haven't figured out how to overlay video inputs that aren't being simultaneously captured on my PC and my PC is still having issues, so this is a capture using my iPhone. I think my Christmas present to myself this year will be a new PC - my current one appears to be dying of old age (I know how it feels).
The "motion detection" occurs when I approach from outside of the field of view of the Portenta. If you watch the reflection on the Ethernet housing, you be able to see when I move behind the iPhone into the field of view and "person detection" occurs. You can also see when I move out of the field of view - first "motion detection" then "no person detected".