Coder Social home page Coder Social logo

the-floater's People

Contributors

brianhackel avatar

Watchers

 avatar

the-floater's Issues

remember logging details

upon a soft reset, pre-fill-in the existing logging details on the configuration webpage. This way, you don't have to keep looking up the web hooks or API key just because you wanted to change the logging timeout.

put in a standby mode for charging

add a button to the configuration screen which will allow an indefinite sleep. that way it will charge the battery, but not be "on" until you hit the reset button.

add failure counter

if we fail to log or connect or whatever when NOT in config mode, add one to the persistent counter (a LittleFS file) and only reset to factory if we're over the allowed consecutive errors mark.
consider making this a configurable on the webpage which can also add a way to message that we're going offline for good (IFTTT web hook trigger).

add timeout to config mode

not sure how easy/hard this would be, but we don't want to drain the battery by sitting in Config mode. we probably want to go to sleep (indefinitely) in the case where we've been in Config mode for, say, 5 minutes.

configure sketch for low power usage

put everything in the setup() and do a deep sleep for perhaps 30 minutes
consider adding a configurable sleep time via the captive portal configuration described in issue #1

use google sheets web app to do the logging without IFTTT

curl -X POST -H "Content-Type: application/json" -d '{"temp":"77","tilt":"44","battery":"88","sheetName":"Log","spreadsheetId":"1Vm_yyzYJGHxuL6VfqA0Vs1Op3U4c2ru-9uVMdvuiXVs"}' https://script.google.com/macros/s/AKfycbwaDRFxaTrB77QBs42C7wUi7NCoxxAsYd1n5g4Cpo6R-oWpYTpNfPOOwiyXs9RCNHgp/exec

then the fields you need in the configuration is the Deployment ID, spreadsheet ID, and sheet name

tare feature

add a tare button to the configuration mode screen that allows you to, when having placed the floater on its head, zero out the accelerometer values. This will allow for perfect zero readings taking into account how it is placed inside the canister.

read starting angle from AdafruitIO feed

also consider adding wakeup timeout to the configuration feed group and reading both
probably should move them to a new dashboard that is just for configuration so they don't get bumped accidentally

add ability to scan for WiFi networks

probably with a button on wifimanager.html which will query the board, do the scan and return with the list which will then be populated in the form via jquery.

read battery level

Battery tracking
We will also keep track of the battery level by creating a high-resistor-divider on VBat to reduce the voltage of the battery from 220KΩ/1220KΩ = 1/5.5 times. This means a max voltage of the battery (4.2V) is 0.75V, well within the range of the ESP8266's 1.0V-max ADC
Note that even with low-power sleeping, this setup draws about 20mA on average!

  • Pin 16 to RST (this lets us use the low power mode)
  • Pin 13 to one side of door sensor
  • GND to opposite side of door sensor
  • VBat to the battery +
  • GND to battery -
  • GND to one side of the 220kΩ resistor
  • VBat to one side of the 1MΩ resistor
  • Pin A to the opposite side of the 1MΩ resistor and 220kΩ resistor
void battery_level() {

  // read the battery level from the ESP8266 analog in pin.
  // analog read level is 10 bit 0-1023 (0V-1V).
  // our 1M & 220K voltage divider takes the max
  // lipo value of 4.2V and drops it to 0.758V max.
  // this means our min analog read value should be 580 (3.14V)
  // and the max analog read value should be 774 (4.2V).
  int level = analogRead(A0);

  // convert battery level to percent
  level = map(level, 580, 774, 0, 100);
  Serial.print("Battery level: "); Serial.print(level); Serial.println("%");
  connect_AIO();

  // grab the battery feed
  AdafruitIO_Feed *battery = io.feed("battery");
  
  // send battery level to AIO
  battery->save(level);
  io.run();
}

add calibration mode

add a button to the captive portal (that will show no matter what for the first 5 minutes) that will put it into non-low-power mode and allow a web interface to poll for tilt and temperature measurements at some interval

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.