Arduino: Consumo elettrico di ogni stanza in una casa, operazioni preliminari – Resoconto attività 16 Luglio 2014

Scritto da Alessandra De Rosa on . Postato in Formazione, Prodotti, Progetto Leonardo da Vinci, Servizi

Today we continued working on our current project, which is about measuring the electrical consumption of each room.

From our logic plan for the code, we’ve been searching on the internet new code, mainly for the XBee component. For this, we found sketches of sending/receiving packets with XBee, using the SoftwareSerial library.

Later we kept searching on the internet, but this time for the Ethernet Shield configuration and we found how to configure the network settings for the Arduino Ethernet Shield and how to test it. For this we need to:

Step one:

In the Arduino Ethernet Shield properties, specify the IP address (4 octet format, example:192.168.0.20.).

Step two:

Specify the MAC address (6 octet format, example: DE:AD:BE:EF:FE:ED).

Step three:

                Finally, to test it we just need to write the code with each IP and MAC addresses and we’re ready to test.

Unfortunately, Alessandro could not make presence for personal reasons, however tomorrow we will be finishing the electrical consumption measure project.

 

16 July 2014

Alexandre Leitao

Gonçalo Neto

Arduino: Mappatura dell’abitazione per il progetto preliminare – Resoconto attività 15 Luglio 2014

Scritto da Alessandra De Rosa on . Postato in Formazione, Prodotti, Progetto Leonardo da Vinci, Servizi

For today, we finished the search for the project and started to build a house plan with five different divisions, on a program online called floorplanner. We also decided where to put the project in each division.

We made the sketch of the circuits and a preliminary explanation to introduce this new project.

In addiction, we made a plan for the code’s logic.

15 July 2014

Alexandre Leitao

Gonçalo Neto

Arduino: Video tutorial e nuove ricerche – Resoconto attività 14 Luglio 2014

Scritto da Alessandra De Rosa on . Postato in Formazione, Prodotti, Progetto Leonardo da Vinci, Servizi

Today July 14th 2014, we started by making a video of the last project working (system energy control) and its tutorial step by step with the code, text, photos of the circuit and sketches.

As soon as we finished, we started the search for our new project, which is about measuring the electrical consumption of each room.

We finished the day by making a preliminary project, where we try to choose the best technics to make it work perfectly. We already made a house sketch with 5 different divisions to use for this project and we already know what components we’re going to need.

We are still searching for how to make all the components work together without problems.

 

Alexandre Leitao

Gonçalo Neto

Tutorial Arduino: How to control system energy usage

Scritto da Alessandra De Rosa on . Postato in Formazione, Prodotti, Servizi, Tutorials Arduino

This project consists on controlling the usage of energy on the system.

It works like the electric entry in your home. It has an emergency kill switch in case of a short circuit.

After a couple of seconds it tries to reconnect the switch.

For the whole project we used:

-1 Arduino uno

-1 Breadboard

-2 Potentiometer

-1 16 pin display

-3 Resistances

-1 Buzzer

-1 Relay srd-05vdc-sl-c

-2 Leds

The first step is connecting and testing the display.

arduino display connection

arduino display connections

As you can see on the sketch and picture above it is quite simple to connect, it takes 3 + 5v cables to power the display, 3 grounds as well and 6 to display the data.

Another important thing is the potentiometer to be able to control the brightness and contrast of the display.

The code we wrote for this was:

lcd.print("Step One:");
lcd.SetCursor(0,1);
lcd.print("Complete!");






The second step after you test all the circuit with the LCD is to connect another potentiometer and a relay.

This time the potentiometer is sending the values towards arduino to let it control the relay ON or OFF.

We will use this potentiometer to simulate the current in the system.

 arduino potentiometer and relay

arrduino potentiometer and relay

The part of the code  that controls what happens in case of 99 % of the charge and 100% represents overcharge in our sketch.

The third part is implementing a LED to the system.

The relay controls the energy on the bottom energy line so the led will be connected to that line, to simulate a light in the room.

The sketch and picture for this are :

 arduino led

arduino led

The code:

  val_sim=analogRead(5);
  val_sim*=100;
  val_sim/=1024;
  val_fin=val_sim; // in percentage
  Serial.println(val_sim);
  lcd.setCursor(0,0);
  lcd.print("Voltage usage   ");
  lcd.setCursor(0,1);
  lcd.print("value : ");
  lcd.print(val_fin);
  lcd.print(" %   ");
  if(val_fin > 90.0 && val_fin < 99.0)
  {
    tone(buzzer,ton_e,1000);
    //noTone(buzzer);
    tone(buzzer,ton_e,1000);
    lcd.setCursor(0,0);
    lcd.print("Warning!!!      ");// atenzione!!!
    lcd.setCursor(0,1);
    lcd.print("High voltage!!! "); 
    delay(2000);
    lcd.setCursor(0,0);
    lcd.print("Reduce Voltage  "); // system off :restart
    lcd.setCursor(0,1);
    lcd.print("Value < 90 %    "); 
    delay(2000);
  }
  if(val_fin > 99.0)
  {
    lcd.setCursor(0,0);
    lcd.print("                ");
    lcd.setCursor(0,1);
    lcd.print("                ");
    lcd.setCursor(0,0);
    lcd.print("Overcharge!     ");
    lcd.setCursor(0,1);
    lcd.print("System : Stop   ");
    digitalWrite(rele,LOW); 
    tone(buzzer,ton_e,2000);
    delay(2500);
    lcd.setCursor(0,0);
    lcd.print("Reduce Voltage  ");
    lcd.setCursor(0,1);
    lcd.print("Value < 90 %    ");
    delay(5000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 5 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    lcd.setCursor(0,0);
    lcd.print("Waiting: 4 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 3 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 2 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 1 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 0 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");
    digitalWrite(rele,HIGH);
  



The last piece of the whole puzzle is adding 2 more components, a buzzer and another led.

The led is controlled by the voltage simulated with the second potentiometer, and the buzzer emits sounds as soon as it has an overcharge.

This is how our final project looks like:

arduino buzzer and led

arduino buzzer and led

The whole code for this is:

#include <LiquidCrystal.h>
 
int buzzer = 12;
int rele = 11;
int ton_e = 1047;
 
LiquidCrystal lcd(7,6,5,4,3,2);
 
void setup()
{
 lcd.begin(16,2);
 
 pinMode(buzzer,OUTPUT);
 pinMode(rele,OUTPUT);
 pinMode(5,INPUT);
 
 
 
 Serial.begin(9600);
}
 
void loop()
{
  float val_sim=0.0;
  float val_fin=0;
  digitalWrite(rele,HIGH);
 
   lcd.setCursor(0,0);
  lcd.print("HydraSolutions  ");
  lcd.setCursor(0,1);
  lcd.print("System: Starting");
  delay(2500);
 
  for(;1;)
  {
  val_sim=analogRead(5);
 
  val_sim*=100;
  val_sim/=1024;
 
  val_fin=val_sim; // in percentage
 
  Serial.println(val_sim);
  lcd.setCursor(0,0);
  lcd.print("Voltage usage   ");
  lcd.setCursor(0,1);
  lcd.print("value : ");
  lcd.print(val_fin);
  lcd.print(" %   ");
 
  if(val_fin > 90.0 && val_fin < 99.0)
  {
    tone(buzzer,ton_e,1000);
    //noTone(buzzer);
    tone(buzzer,ton_e,1000);
    lcd.setCursor(0,0);
    lcd.print("Warning!!!      ");// atenzione!!!
    lcd.setCursor(0,1);
    lcd.print("High voltage!!! "); 
    delay(2000);
    lcd.setCursor(0,0);
    lcd.print("Reduce Voltage  "); // system off :restart
    lcd.setCursor(0,1);
    lcd.print("Value < 90 %    "); 
    delay(2000);
  }
  if(val_fin > 99.0)
  {
    lcd.setCursor(0,0);
    lcd.print("                ");
    lcd.setCursor(0,1);
    lcd.print("                ");
 
    lcd.setCursor(0,0);
    lcd.print("Overcharge!     ");
    lcd.setCursor(0,1);
    lcd.print("System : Stop   "); 
    digitalWrite(rele,LOW); 
   
    tone(buzzer,ton_e,2000);
    delay(2500);
 
 
    lcd.setCursor(0,0);
    lcd.print("Reduce Voltage  ");
    lcd.setCursor(0,1);
    lcd.print("Value < 90 %    "); 
    delay(5000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 5 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 4 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 3 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 2 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 1 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("Waiting: 0 sec  ");
    lcd.setCursor(0,1);
    lcd.print("System : Restart");   
 
    digitalWrite(rele,HIGH);
  }
  }
}




July 14th 2014

Alexandre Leitao

Gonçalo Neto

Arduino: Controllo del voltaggio – Resoconto attività 11 Luglio 2014

Scritto da Alessandra De Rosa on . Postato in Formazione, Prodotti, Progetto Leonardo da Vinci, Servizi

Today July 11th 2014, we’ve been trying to fix the problem from the last project. That project consists on controlling the voltage coming from the arduino uno.

There were two problems, one of them was the relay, which didn’t work correctly. Another problem was the LCD that didn’t display the text we wanted it to show.

Fortunately we managed to fix both problems, despite it taking some time, the circuit is finally working 100% now.

Alexandre Leitao

Gonçalo Neto

Google+