Kali ini saya akan menjelaskan mengenai bagaimana cara membuat alat untuk memonitoring charging station, object yang akan dijadikan analisa adalah arus dan tegangan yang terdapat di charging station, fungsi charging station adalah untuk mengisi aki mobil listrik, seperti halnya SPBU tapi untuk mobil listrik. sehingga dibutuhkan sumber tegangan dan arus yang lumayan besar untuk sebuah charging station, jika tidak di pantau arus dan tegangannya, itu akan sangat berbahaya, pada contoh kali ini bisa dipantau via internet dan data bisa disimpan di database.
a. POSTER
b. PROCEDING / MAKALAH
c. TAMPILAN INTERFACE WEB DAN DATABASE
d. Arduino Code
#include <SPI.h>
#include <Ethernet.h>
unsigned long start_times[300];
unsigned long stop_times[300];
unsigned long values[300];
// Define various ADC prescaler
const unsigned char PS_16 = (1 << ADPS2);
const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);
const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
void setup() {
Serial.begin(9600);
// set up the ADC
ADCSRA &= ~PS_128; // remove bits set by Arduino library
// you can choose a prescaler from above.
// PS_16, PS_32, PS_64 or PS_128
ADCSRA |= PS_128; // set our own prescaler to 64
}
void loop() {
//tegangan DC =============================
//set point = 0,25
int spanx = 25;
int aReadx = 0;
for (int i = 0; i < spanx; i++) {
aReadx = aReadx+analogRead(A0);
delay(1);
}
aReadx = aReadx / 25;
float voltage0x = aReadx * (4.9 / 1023);
float voltage0= (voltage0x + 0.05 ) / 0.201 ;
//tegangan AC =============================
//set point = 0,1
unsigned int i;
unsigned int z;
z = 0;
// capture the values to memory
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A1);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage1 = (z - 495.00) / 0.443 ;
z = 0;
//================================
// capture the values to memory
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A2);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage2 = (z - 495.00) / 0.443 ;
z = 0;
//arus DC =================================
//SET POINT = 0,1
int span3 = 25;
int aRead3 = 0;
for (int i = 0; i < span3; i++) {
aRead3 = aRead3+analogRead(A3);
delay(1);
}
aRead3 = aRead3 / 25;
float voltage3x = aRead3 * (4.9 / 1023);
float voltage3= (voltage3x - 2.51) / 0.05;
//========================
//SET POINT = 0,1
int span4 = 20;
int aRead4 = 0;
for (int i = 0; i < span4; i++) {
aRead4 = aRead4+analogRead(A4);
delay(20);
}
aRead4 = aRead4 / 20;
float voltage4x = aRead4 * (4.9 / 1023);
float voltage4= (voltage4x - 2.51) / 0.05;
//=========================
//SET POINT = 0,1
int span5 = 20;
int aRead5 = 0;
for (int i = 0; i < span5; i++) {
aRead5 = aRead5+analogRead(A5);
delay(20);
}
aRead5 = aRead5 / 20;
float voltage5x = aRead5 * (4.9 / 1023);
float voltage5= (voltage5x - 2.5) / 0.05 ;
//=========================================
//arus AC =================================
// set point B = 0,1
// set point A = 0,1
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A8);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage8 = (z - 315.50) / 13.02;
z = 0;
//================================
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A9);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage9 = (z - 325.50) / 12.02;
z = 0;
Serial.println(voltage0);
Serial.println(voltage1);
Serial.println(voltage2);
Serial.println(voltage3);
Serial.println(voltage4);
Serial.println(voltage5);
Serial.println(voltage8);
Serial.println(voltage9);
Serial.println(" ");
Serial.println(" ");
delay(3000);
}
#include <Ethernet.h>
unsigned long start_times[300];
unsigned long stop_times[300];
unsigned long values[300];
// Define various ADC prescaler
const unsigned char PS_16 = (1 << ADPS2);
const unsigned char PS_32 = (1 << ADPS2) | (1 << ADPS0);
const unsigned char PS_64 = (1 << ADPS2) | (1 << ADPS1);
const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
void setup() {
Serial.begin(9600);
// set up the ADC
ADCSRA &= ~PS_128; // remove bits set by Arduino library
// you can choose a prescaler from above.
// PS_16, PS_32, PS_64 or PS_128
ADCSRA |= PS_128; // set our own prescaler to 64
}
void loop() {
//tegangan DC =============================
//set point = 0,25
int spanx = 25;
int aReadx = 0;
for (int i = 0; i < spanx; i++) {
aReadx = aReadx+analogRead(A0);
delay(1);
}
aReadx = aReadx / 25;
float voltage0x = aReadx * (4.9 / 1023);
float voltage0= (voltage0x + 0.05 ) / 0.201 ;
//tegangan AC =============================
//set point = 0,1
unsigned int i;
unsigned int z;
z = 0;
// capture the values to memory
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A1);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage1 = (z - 495.00) / 0.443 ;
z = 0;
//================================
// capture the values to memory
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A2);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage2 = (z - 495.00) / 0.443 ;
z = 0;
//arus DC =================================
//SET POINT = 0,1
int span3 = 25;
int aRead3 = 0;
for (int i = 0; i < span3; i++) {
aRead3 = aRead3+analogRead(A3);
delay(1);
}
aRead3 = aRead3 / 25;
float voltage3x = aRead3 * (4.9 / 1023);
float voltage3= (voltage3x - 2.51) / 0.05;
//========================
//SET POINT = 0,1
int span4 = 20;
int aRead4 = 0;
for (int i = 0; i < span4; i++) {
aRead4 = aRead4+analogRead(A4);
delay(20);
}
aRead4 = aRead4 / 20;
float voltage4x = aRead4 * (4.9 / 1023);
float voltage4= (voltage4x - 2.51) / 0.05;
//=========================
//SET POINT = 0,1
int span5 = 20;
int aRead5 = 0;
for (int i = 0; i < span5; i++) {
aRead5 = aRead5+analogRead(A5);
delay(20);
}
aRead5 = aRead5 / 20;
float voltage5x = aRead5 * (4.9 / 1023);
float voltage5= (voltage5x - 2.5) / 0.05 ;
//=========================================
//arus AC =================================
// set point B = 0,1
// set point A = 0,1
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A8);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage8 = (z - 315.50) / 13.02;
z = 0;
//================================
for(i=0;i<300;i++) {
start_times[i] = micros();
values[i] = analogRead(A9);
if (values[i] >= z) {
z = values[i];
}
stop_times[i] = micros();
}
float voltage9 = (z - 325.50) / 12.02;
z = 0;
Serial.println(voltage0);
Serial.println(voltage1);
Serial.println(voltage2);
Serial.println(voltage3);
Serial.println(voltage4);
Serial.println(voltage5);
Serial.println(voltage8);
Serial.println(voltage9);
Serial.println(" ");
Serial.println(" ");
delay(3000);
}
No comments:
Post a Comment