I started this process by creating flow diagrams to understand what I was wanted the solution to do, considering the things the dogs are used to do every morning so no training is required for them.
After this, attached all the components in the breadboard and I added "//" type of comments in Particle Dev, and filling them out with functions and variables. This turned out to be not the best efficient process, so I got to a point that I had to delete everything and start over again. I unplugged everything from the breadboard and then I started adding and testing every component individually. I believe that doing this was a good thing for my process since I reaffirmed everything was working properly, this is why I added an LED to monitor the functions of every component, although it was not required for the final solution. As shown in the Code, dividing constants & variables, setup, loop and functions was very helpful for me to manage all the information and confirm functionality.
1. It will detect if there is light around, since the dogs are supposed to go to the backyard only during the daytime.
2. It will detect if the dogs are barking (this part was kind of tricky - I had to play with the sensibility of the microphone so it could differentiate very loud from not very loud noises).
3. The Servo Motor acts as a door latch and if the microphone hears the barks (or very loud noises) it will rotate 90.
4. The door will be open, and the dogs will be able to push it so they can go out. A notification will be sent.
5. I included a button so the latch can be closed again.
While I was doing this project I realised that probably the microphone was not the most effective idea to detect if the dogs are ready to go out, since there might be other loud noises around. Therefore, if I was to continue to develop this solution, I would probably try this solution and also a limit switch to react to the dogs' push and see which one works best.
You can upload files of up to 20MB using this form.