This project is for a robotic car like thing that roams around from time to time and then sleeps. I originally wanted a "bug" type robot to just roam around. It is controlled via Cayenne and has 3 drive modes. You can select from manual control, drive1, or drive2. Manual is manual control with momentary buttons. Drive1 makes it roam around and avoid objects when it gets close to them. Drive2 is the same as drive1 but it adds random sleep to the mix. It also has a power save mode that cuts the CPU clock in half and radio tx power also in half. Cayenne is also setup to notify myself when the battery gets low which is very handy.
I designed a case to hold the high torque geared motors & battery. I also made wheels that have bumps along the rim for traction. Yes that is electrical tape also around the wheels... for traction. The MCU is a Adafruit Hazzah ESP8266 that drives a arduino motor shield v2 by I2C. The MCU has control over turning the PIR and IR sensors off such as when in manual mode to further save power. Not that they draw a lot but everything helps! It also makes use of a voltage divider to monitor the battery voltage.
When waking from sleep, if the sleep cycle is enabled, it turns on the PIR and checks for motion. If it detects motion it disables the sleep cycle for a random amount of time and moves around. Then sleeps once the timer is over. It also sleeps from 11pm to 10am everyday automatically.
The code needs to be cleaned up a bit just so its easier to follow. I would also like to add a couple more features and fine turn it further so watch for updates.