Arduino: Collegare il display LDC ad un Buzzer – Resoconto attività 10 luglio 2014

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

Today July 10th 2014, we started by exploring a new component named buzzer, which is noise maker component and we searched for how to use it

It works by using the Tone() function.

Example:

tone(<pin>,234);

After that, we explored it and we started to make a project, where we would control the voltage usage of the circuit and make the LCD send a warning so the circuit would turn off.

We had a couple of problems that we are still trying to solve, which includes the relay. With the circuit built, the relay turns ON and OFF repeatedly with no solution found yet. Also, the LCD doesn’t display the text, however it’s not such a big problem as the relay. The problem for both can be either in the circuit or in the code.

We’re planning on fixing them tomorrow.

Alexandre Leitao

Gonçalo Neto

Arduino tutorial: a voltage spike simulation.

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

For this tutorial we are going to simulate a voltage spike using the potitiometer.

The logic is the 0 value returned by the potenciometer is “equal” to 0v and the [1000-1023] is “equal” to 5V and we are going to consider this set of values a voltage spike.

So for this we used:

  • Arduino uno
  • Breadboard
  • 1 Led
  • 1 resistance
  • 2 potentiometer
  • 1 relay SRC-05VDC-SL-C

 

The Relay uses a digital port and we use a analog port to receive and understand if the returned value is equal to a spike.

The code to acheive this is:

int rele=11;
int signal=0;
int volt=3;

void setup()
{
  pinMode(rele,OUTPUT);
  pinMode(signal,INPUT);
  pinMode(volt,INPUT);
  Serial.begin(9600);
}
void loop()
{
  int x=0;
  while(1) 				//keep receiving the "voltage"
  {
  digitalWrite(rele,HIGH);			
  x = analogRead(volt);			//reading the voltage
  Serial.println(x);
  if(x>1000 || x < 5)			//test if it is a pick of tension
  {
   emergency_stop();			//if it is emergency stop
   delay(500);
   continue;
  }
  else
   {
     digitalWrite(rele,HIGH);
     delay(500);
   }
}
}
void emergency_stop()
{
  digitalWrite(rele,LOW);
}
 

 

In this code the logic is having an infinite loop running inside the loop function, with this we can always be receiving the “voltage” simulated by the potentiometer on the right.

The left potentiometer is adjusting the brightness of the led.

 

 The picture of our setup:

 arduino voltage spike

And here is the sketch:

arduino voltage spike

Alexandre Leitao

Gonçalo Neto

 

Arduino tutorial: Light lightness control.

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

In this tutorial, we’re simply going to control the led’s lightness with the following components:

  • Arduino Uno
  • Breadboard
  • 1 Led
  • 1 Resistance
  • 1 Potentiometer
  • 1 Relay SRD-05VDC-SL-C

Firstly we’ll have to do the basics, which is connecting the 5V and the GND in arduino uno with the VCC and GND. From there, we do the same to the relay, VCC with VCC and GND with GND, from the breadboard to the relay. Also, the IN1 in the relay gets connected to the digital port 11 in the arduino uno.

Secondly, the middle entrance on the relay gets connected to the VCC in the bread board and the other one gets connected to the first potentiometer’s entrance .

The third entrance goes to the GND. The second entrance connects a resistance, which is connected to the first led’s entrance and finally the second led’s entrance connects to the ground.

Basically, we simply round the potentiometer left or right depending on the light we want the led to show, from high to low.

In the code, it’s not necessary more than simply “digitalWrite(pinRelay,HIGH);”, this makes the relay turn ON and letting all the system work.

Here is the sketch of this project:

arduino light

These pictures above represent this project working:

arduino light off

arduino_light_2

As you can see, one of the pictures has the led with very low light, while in the second one the led’s light is higher.

 

Alexandre leitao

Gonçalo Neto

Arduino Tutorial: how to build an external power source.

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

For this Tutorial we are going to make an external power source for arduino.

Those are the components we need:

-1 Arduino Uno

-1 Breadboard

-1 Led

-1 Resistance

-1 Diode

-1 Relay ——–SRD-05VDC-SL-C

-1 9V Battery or 6 * 1.5V batteries

 

In this project we have a new component called Diode, which is used for controlling the flux of energy that runs on the circuit.

The schematic symbol is:

arduino diodo

This symbol is easy to understand, it’s a sideways triangle with a barrier at the end. In this symbol we can conclude that the energy flow goes from the part of the triangle opposite to the barrier. If you try to send energy through the end with the barrier to the other and test it, you will see that it is impossible to pass energy that way.

The diode is really important here, because it prevents energy passage directly from the arduino uno to the breadboard. What should happen is the energy passing from the batteries, to the arduino, then to the relay and finally to the breadboard.

So now that we know a little bit more about diodes, we can start our project with the external power source. This process is represented in the sketch below:

arduino external power source sketch

 

arduino external power source

As you can see we have a scheme with 2 electric power sources in parallel, which means if the main power source for arduino fails we have the batteries to maintain the circuit running.

Our code is just activating the relay with :

digitalWrite(rele,HIGH);

The purpose of using this diode is to make the energy flow like this:

batteries->arduino->Relay->circuit

or

Arduino power source->Relay->circuit

The circuit now has 2 power sources in parallel that work together to try to make the system always on.

This serves to show that the light continues ON even after you remove the cable from your computer.

When the relay is ON, the led remains ON. When it’s OFF, the led remains the same.

This was another tutorial made for you to understand better “electronics” with arduino.

 

 

Alexandre Leitao

Gonçalo Neto

Arduino: tre circuiti per tre utilizzi diversi – Resoconto attività 9 luglio

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

Today July 9th 2014, we built 3 different circuits, a sketch and a tutorial for each one.

For the first one, we made an external power source and we used batteries and a new component called diodo, which prevents energy passage directly from the arduino uno to the breadboard. What should happen is the energy passing from the batteries, to the arduino, then to the relay and finally to the breadboard.

For the second one, we managed to control the lightness of a led. We simply round the potentiometer left or right depending on the light we want the led to show, from high to low.

Finally, for the third circuit built we simulated the led’s voltage spike using a potentiometer with the last circuit.

Alexandre Leitao

Gonçalo Neto

Google+