For the input group project we decided to test two of our inputs for our final projects. The first is a Hall Sensor that has a just digital input and the second is a distace sensor with an I2C input
The Hall sensor looks something like the LED from our probing of the microcontroller earlier. When it is high it just outputs a high value 3.3V and when it is low it just outputs zero.
The distance sensor working in I2C is a bit weirder, for some reason it outputs an indiscernable signal with peaks and valleys. It is nothing like the PWM of the servo that week. I tested both the Data and Clock pins on that and the same output occured.
Seeing this showed me there are simple and complex input devices in these embedded circuits and it can be difficult to discern them. These were also run with no code just using the milled circuit as a power and ground source to run the modules.
So I started this project with the goal of having my robot see someone and react to their presence either by speaking or having some sort of nonverbal communication. The goal was to use an ESP32 SEEED Sense board, with the onboard camera to make decisions with what we are doing. So I started the way any one would, going straight to reddit and asking if the board I purchased would work without using the online sensing demo. And I got one very funny, but very succinct answer:
So I did what any self respecting tinker would do, I thanked the kind passer by, googled furiously for another hour and concluded that they are correct.
Having accepted my fate, I delved in and hunted for another solution when I noticed that I had something in my parts backlog that already MAY solve this problem. A long time ago I was looking to build a robot with my hobby time and my Youtube journeys brought me to this video:
To make a long story short, I never made that robot. But I did have the parts lying about, so I decided to take matters into my own hands and get this chip working for me for this project.
The Mu Vision sensor is a pre trained board that according to the website can detect balls, people, and other objects. So since I just want simple detection I believed that this would work in an excellent way.
To make this sensor work I followed the steps in the video above. The first being, upload the vision sensor library.
The library can be found at this link:
It is easy to install as all you do is download the library and unzip the file. Once you unzip it drop it into the "libraries" folder of your Arduino library. In my case all of this is in documents.
So once you finish installing this library to your Arduino program you have to have some code to run. Luckily, the sensor comes with some example code to make your life easier. When you go into Arduino and go to File>Examples>MuVisionSensorIII you find some great code which in this case I wanted to run the "body" code to find a person.
The code uploaded I was able to compile it and run the default settings for the Mu Vision board. While compiling it does show a note:
I decided to ignore this because sometimes things just work. And when I did a google search nothing came back warning against the use of this board. So in doing this I went ahead and ran the code. Sadly. This was not one of those times when everything just kinda works out...
I was met with this error:
With this I tried ot rewrite the mode, change how it was connected, and a few other things, but in the end nothing worked. I will be trying this on a pure Arduino board to see if that works next. I hope it works but will be sad if that fixes the problem because I cannot use an arduino for my robot the way I want it to work. Will update tomorrow.
Because of the warning I received on the unit I brought out one of my old Arduino to be able to see if it was true and the libraries worked on those chipsets properly. After hastily plugging it in I uploaded the code to the system and crossed my fingers.
I got a very good outcome already in that the system was blinking more than it normally was before where it was a dead chip. Taking this into consideration I crossed my fingers and checked the serial output.
I recorded this video while leaning back and forth putting my face into the location of the sensor and it would read and not read depending if I was in the range of the sensor.
This week I worked on having DAP-r see using a Mu Vision Sensor. I got this system to work but unfortunately it needed a Arduino microcontroller and I do not want to use that so I am back to the drawing board soon.
Unfortunately the Mu Vision sensor you see in this video is only capable of working with the Arduino architecture and its libraries cannot work with the RP2040. So I had to look around and find a person sensor module that can communicate with the RP 2040.
In my searches I stumbled across the "Person Sensor" from sparkfun. This one is capable of speaking with any board and uses the I2C framework to communicate with the system. This one is programmed using the libraries here in the Person Sensor GitHub page.
The system detects almost exactly like the Mu Vision sensor, but it can detect more than one person. It then sets up a bounding box around them. It also has a handy light that goes off when it is detecting a person or not, pictured below.