I learned of this assignment a bit late into the timeline (due to the fact that I added this course about 5 weeks into the semester), so the story I could only think of telling was how I wanted to approach challenges at the time.
My initial idea had been to use an IR sensor to detect humans and then have my bot move towards it. Unfortunately I was not able to get the IR sensor working accurately enough in time, thus I had to change to a standard distance sensor
It had been a while since I had touched arduino code, but I was able to retrieve enough to fulfill what I needed for this assignment. I was careful to test each component I added because I initially struggled with adding components/making them function.
After some struggling, I decided to try some things that were a bit more attainable. My new motion would be a bot that turned away everytime it was faced with an obstacle. I figured this could be done well and executed cleanly.
- two DC motors
- two H-bridges
- Arduino UNO
- HC-SR04 distance sensor
- jumper wire
After the successful tests with the motors and the sensor, I wanted to be a bit more ambitious and try to see if I could get a solenoid working. The bot would, in theory, sense something within range and approach till it was close enough to poke the subject with a solenoid.
As can be seen in my final code (above), I tried to engage the solenoid. I added another H-bridge to handle the added stress, but as a result ended up having to pull it because I couldn't get it running in time.
I powered my bot by tethering it to a power supply during crit.
In hindsight, I wish I hadn't been so aggressively ambitious when first starting the project. I could have used that time to better deliver my concept; hopefully I'll eventually get my solenoid working.