Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State of Charge #2

Open
3 tasks
dimembermatt opened this issue Jun 12, 2020 · 0 comments
Open
3 tasks

State of Charge #2

dimembermatt opened this issue Jun 12, 2020 · 0 comments

Comments

@dimembermatt
Copy link
Contributor

dimembermatt commented Jun 12, 2020

The new PCB design includes a state of charge circuit (a voltage divider feeding into an ADC).
image

We need to write the accompanying code to incorporate State of Charge functionality for our robot.

  • write a simple state of charge driver to measure the battery capacity.
    • the ADC pin that measures the voltage of the battery is IO4 (5th from the top right, USB facing up and top).
    • we have a voltage divider ratio of 1:2. We have a 5V input into the VReg, which means our effective measurement range is 0 to 2.5 V (approximately) and bounds of [0, 3.3V].
    • the ADC input has 12 bits of precision, so 4096 levels. For 0 - 3.3v, that's about an 8th of a mV resolution.
  • Implement functionality to send robot state of charge to the server.
    • we want to add to the robot config for a Dancebot the state of charge. We should be able to read the struct or class for the Dancebot, and update that SoC every time period (something we need to determine - I'm leaning towards every 2 minutes).
    • we'll represent the SoC as an integer value from 0 - 100, representing percent.
    • in our networking code, we need to send this back to the server in our GET request.
  • finally, we need to modify the HTML to show current state of charge as well.
    • given the existing and planned assets for the Dancebot for the webserverui, we will determine four different battery states that correspond to each image (happy, drowsy, snoring, dead). We will need to determine this. An example of such may be 61-100%, 41 - 60%, 21 - 40%, 0 - 20%.
    • the web UI code will need to update the assets to reflect this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants