Coder Social home page Coder Social logo

electrical-measurements's Introduction

Códigos referentes ao sistema de medição de corrente elétrica (Project SaIoT)

Autor: Iran Macedo Bezerra Neto (IranNeto)

libraries

#include <Time.h>
#include <TimeLib.h>
#include <Ticker.h>

Are required to the interruption and to work with time formats

See oficial documentation (https://github.com/esp8266/Arduino).

All the libraries' functions are in the libraries/library_you_are_searching/library.properties. See allow field.

How the code works ?

void setup()

It will set the interruption and do the webSocket connection.

void loop()

It works as a sampling routine

  • Take the sampling time
  • Get the sensor's value, square it and accumule
  • Count the number of samples
  • Calcule the load power and send to post it.
sensorValueI = map(sensorValueI, 1, 722, 1, 512);
sensorValueI -= 511;

The current sensor will output a range voltage from 0 to 5 V but the ESP's analogic pin only takes until 3.3 V so it's necessary to map those ranges

(when there's no current in the sensor it will output 2.5 V and the ADC will show 3.3V ----- 1023 2.5V ------- X X = 775 But it should be confirmated by pratical experiments. 775 is the real zero signal's center where it will oscilate. Map this value to a virtual zero simulating an 5V ADC (to 2.5 V = 512). Then, to do the rms calculations it's necessary to center the signal in a zero x-axis correcting the offset.) Calculate the rms value in the sampling time and post the loadPower. :sunglasses:

electrical-measurements's People

Contributors

iranneto avatar judsonc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wesleywagner

electrical-measurements's Issues

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.