Giter Site home page Giter Site logo

esp32-adc-voltage-measurement's Introduction

ESP32-ADC-Voltage-Measurement

Using the ADC to measure voltage

The function that corrects for the ESP32 ADC input impedance loading of an attached voltage divder. I have estimated the ESp32 ADC input impedance to be 1.3Mohms

#define constant 5.9;

// 0-5v range example, should be a factor of 5, but loading increases it to 5.9

// defined constant 5.9 // 0-5v range

// #define constant 7.1 // 0-6v range

// #define constant 14.6 // 0-12v range

// #define constant 18.5 // 0-15v range

// #define constant 30.1 // 0-24v range

// #define constant 38.1 // 0-30v range

// #define constant 64.5 // 0-50v range

// #define constant 130.0 // 0-100v range

float readVoltage(){

float ADCvoltage = (float)analogRead(36) / 4095 * constant;

return ADCvoltage * constant; // 0-5v range }

// I cannot fully explain why as input voltage increases and effective load on the voltage divider by the ESP32 decreases that the constant offset increases, it should be the opposite!

esp32-adc-voltage-measurement's People

Contributors

g6ejd avatar

Watchers

 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.