Close

Sparx HUNGRY

A project log for Low cost pi based quadruped "sparx"

My continuing project to build and improve a low cost quadruped robot as an introduction to walking robots.

keaKea 09/15/2019 at 12:310 Comments

So a major point of this project is to eventually turn sparx into an autonomous rover, able to wander around and do its own thing. Currently Sparx has no way to know its own battery level, It will continue to function until the batteries shut off, which is not ideal. 

Since i am trying to give Sparx a basic AI (eventually) it makes sense to give it sensors. So first off I decided to kill two birds with one stone and give Sparx the ability to sense his battery level which will translate to the sensation of hunger.

This was a fairly simple addition, a pair of voltage dividers (one for each battery) with some high value resistors to ensure that the current draw was low (a few mA a day) a small capacitor to smooth out any peaks and connect that to one of the pins on the MCP3008.

The MCP3008 is an SPI ADC, offering 8 channels and is basically perfect to connect to a raspberry pi. If you follow the tutorial here: 

https://learn.adafruit.com/mcp3008-spi-adc/python-circuitpython

You should be able to both hook up the chip and have some basic knowledge of how to talk to it.

I will soon be writing a python script that starts when Sparx is turned on that will check the battery level every few minutes. Measuring the voltage of the battery wont give me a charge percentage or anything like that, but we can use the voltage returned to gauge how empty the battery is, a lipo battery hovers at a little over 4v when fully charged and the charge/boost circuit I have will cut off the batteries around 3v. If i wanted to get a "percentage" of battery remaining I could try and do something with these values but LiPo voltage doesnt drop in a linear fashion across its battery life.

Hopefully all of this will soon tie into the ability for Sparx to search for and find his own charging station. 

Discussions