Git Product home page Git Product logo

esp32-current-logger's Introduction

esp32-current-logger

This is just a small project of mine designed to run on an ESP32. It will monitor the current flow over time and display a graph on its web interface.

Its preliminary purpose is to be used in electrolysis to count the number of electrons having passed through the medium. (Unit is Moles of Electrons)

Used libraries

Wiring

This software was tested on an ESP32-WROOM-32.

Required Modules:

  • A current sensor based on the ACS712-chip. (Or similar)
    • The sensor must be bidirectional and have its zero-point at half of VCC.
  • A SPI SD-Card module such as the HW-125.

SPI Pinout of the ESP32:

SPI PIN ESP32 PIN
MOSI GPIO 23
MISO GPIO 19
SCK/CLK GPIO 18
CS/SS GPIO 5 was used

Note: In my experience the HW-125 has to be powered by 5V in order to properly work.

Current Sensor Pin: GPIO35

Usage

The contents of the SdCard folder have to be at the root directory of the inserted sdcard.

After flashing your ESP32 it should be ready. Serial communication happens at 115200 baud. Line terminator is just a newline character \n.

The first thing necessary is to setup wifi using the wifi command:

wifi <SSID> <Password>

Referance of all available commands

(Also printable from the ESP32 using the command help)

Command Action
help Displays this help
wifi <SSID> <pwd> Sets WIFI SSID and password
printwifi Display Wifi settings
wifistatus Display Wifi status
setmes <interval> Set Graph measurement interval (in seconds)
getmes Display Graph measurement interval
setoff <voltage> Set current sensor output offset
setmul <factor> Set current sensor output coefficient
getcalib Display current sensor calibration values (offset and coefficient)
startcalib1 <count> <aref> Calibrate Offset (aref is applied current)
startcalib2 <count> <aref> Calibrate Coefficient (aref is applied current)

Calibration procedure

Use an external power supply which can be current limited. Supply a known amount of current through the current sensor.

Then use the startcalib commands to calibrate. Generally each of them only has to be performed once.

For example:

startcalib1 100 0

This will calibrate the offset when no current is applied. It will take record of 100 measurements and average them out. Afterwards a fitting offset will be calculated to bring the measured values closer the the real current that has been flowing (in this case 0).

startcalib2 100 5

This will find the correct multiplier so that the read value becomes the applied current (in this case 5 amps). Before the calibration has not finished do not change the applied current.

Screenshots

Start-Page

Startpage

Graph of a run

Graph

esp32-current-logger's People

Contributors

fabyr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.