domingo, 24 de junho de 2018

Arduíno circuit of the crossingB project

Circuit made using the Tinkercad site to simulate the operation of the project before using the real Arduino


Below we have a video of the circuit running. We can see the components and the connections.





This is the final code used in Arduino for the operation of the CrossingB project


#include <Ultrasonic.h>

 //Importamos a Biblioteca do sensor ao projeto.

  int verde= 11; //Pino 11 será saída do sensor 2(carro parado)
  int red1 = 12; //Pino 12 será saída do sensor 3(sem carro)
  int red2 = 13; //Pino 13 será saída do botão pressionado
  int buzzer = 21;
  long tempoInicialSensor2 = millis();
  long tempoInicialSensor3 = millis();
  
  Ultrasonic ultrasonic2(3,2); //Instanciamos a biblioteca, 3 <- Trigger e 2 <- Echo
  Ultrasonic ultrasonic3(15,14); //Instanciamos a biblioteca, 15 <- Trigger e 14 <- Echo
  
  unsigned long contSensor2;
  unsigned long contSensor3;

  long microSegundos = 0;
  float distanciaCentimetrosSensor2 = 0;
  float distanciaCentimetrosSensor3 = 0; 

//função do botão pressionado
  boolean botaoPressionado(){
    return digitalRead(8)== HIGH;
  }

void setup() {

  Serial.begin(9600);
  Serial.begin(9600); //Iniciamos a porta serial com Baud Rate de 9600B (velocidade de trasnferência)
  
  pinMode(verde, OUTPUT);
  pinMode(red1, OUTPUT); 
  pinMode(red2, OUTPUT); 
  pinMode(buzzer, OUTPUT);
  pinMode(8, INPUT_PULLUP); //Botão
}

void loop() {
  
   digitalWrite(verde, LOW); 
   digitalWrite(red1, LOW); 
   digitalWrite(red2, LOW); 
   digitalWrite(buzzer,LOW);
   distanciaCentimetrosSensor2 = 0;
   distanciaCentimetrosSensor3 = 0;
   
 //Converte de segundos para centimetros. 
  microSegundos = ultrasonic2.timing(); 
  distanciaCentimetrosSensor2 = ultrasonic2.convert(microSegundos, Ultrasonic::CM); 

  microSegundos = ultrasonic3.timing();
  distanciaCentimetrosSensor3 = ultrasonic3.convert(microSegundos, Ultrasonic::CM); 

  
 //Liga o led vermelho enquanto o botão estiver pressionado   
  if(botaoPressionado()){  
    digitalWrite(red2, HIGH);
  }
  
//inicia as contagens
  contSensor2=millis();
  contSensor3=millis();

    
//Se algo ficar menos de 5 segundos parado e sair da frente do sensor, a contagem reinicia
    if(distanciaCentimetrosSensor2 > 5 || !botaoPressionado()){ //Distância tem que ser maior doq cinco(não tem ninguém) ou se o botão não tiver pressionado a contagem reinicia 
        tempoInicialSensor2 = contSensor2;
    } 
  
//sensor 2,  carro parado por 5 segundos ativa o buzzer e a luz verde
    if(distanciaCentimetrosSensor2 < 5 && contSensor2 > (tempoInicialSensor2 + 4000 )){ 
   
       digitalWrite(verde, HIGH); //Liga o LED verde 
       tone(buzzer, 1000, 1000); //ativa o buzzer
       delay(1000);

    tempoInicialSensor2 = contSensor2;
     
  }
// Se passar um carro a contagem do sensor 3 reinicia
    if(distanciaCentimetrosSensor3 < 5 || !botaoPressionado()){ //Distância tem que ser menor doq cinco(tem alguém passando) ou se o botão não tiver pressionado a contagem reinicia 
       tempoInicialSensor3 = contSensor3;
  }
  
//sensor 3, se não passar carro em 10 segundos ativa o buzzer
    else if(distanciaCentimetrosSensor3 > 5 && contSensor3 > (tempoInicialSensor3 + 5000 ) && distanciaCentimetrosSensor2 > 5){
   
      digitalWrite(red1, HIGH); //Liga o LED Vermelho
      tone(buzzer, 3000, 2000); //ativa o buzzer
      delay(1000);

      tempoInicialSensor3 = contSensor3;

  }

   
    Serial.print(distanciaCentimetrosSensor2); //Imprime na porta serial qual é atual distância 
    Serial.println(" CM"); //Imprime espaço e CM, não podemos concatenar com o valor acima.

    Serial.print(distanciaCentimetrosSensor3); //Imprime na porta serial qual é atual distânciao
    Serial.println(" CM"); //Imprime espaço e CM, não podemos concatenar com o valor acima.
    
    delay(500);  //Aguarda um meio segundo para finalizar o método
}

quinta-feira, 7 de junho de 2018

Diary


  • 5/14 First Week
   In the first week, there are two Arduino classes, simple assembly, lessons, code , and the material we could use assemble the project.
  • 5/12 Second Week
    In this week , we had access to the arduino kit, and we started to see models of arduino.
then we started to thinker with a site called tinkercad to make a project template, until then the whole room had somenthing in mind and we were very uncertain about somenthing to do , we were thinking of several possibilities until we decided what to actually do.
During this second week ,Rafael began to make a 3D video with a demonstration of how we wanted the gadget to work.
  • 06/12 Third Week
    Earlier this week, member Lorrane set up the 3D model on tinkercad.
today friday is ready the prototype using the Arduino and we are creating the code for the Arduino to do what we want.



  • 06/08 Friday


    Our project is to establish a crossing system and help people and the visually impaired to cross more safely.

we discussed the idea and decided which pieces would be needed for the project, which are:
- 1 Mega Arduino;
- 1 Protoboard;
- several jumpers;
- 1 passive buzzer;
- 2 ultrasonic sensor;
- 1 presence sensor (PIR);
- 2 red LEDs;
- 1 Green Led;
- 4 resistors;

    To do the assembly of the project, we need 2 ultrasonic sensors in  arduino kit,  have one 1, we ask student Claudia to check for stock and that luckily had.
For next week we intend to finish the product code and the commercial product, the script is ready, we just need to learn how to use the video program better and if time is left the team is thinking about putting together a project mockup.



  • 4th Week

      06/11 - Monday

       We're testing the code on Arduino.


     The member Lorranny was having complications in the addition of the arduino library and we asked Claudia for help.

        We were having trouble making the range adjustment on the presence sensor.

    First impediment

      We found that one of the two ultrasonic sensors we have is not working and that delayed the implementation of the code, but we requested another one for the teacher's assistant (Diana).


     We were having trouble at a code counter so we asked for help from the teacher's assistant (Claudia) who tried to give us a support to solve the problem.

    06/13 Wednesday

        The member Lorranny took the Arduino kit to try to solve the conflicts of the code. However, it failed to make the presence sensor work, so it was changed by a button. Anyway, the code worked the way you wanted it to.

      Lorranny- First: the code was analyzed to find out how to make the counter run, because the milles function did not work correctly, then a counter was made to activate the whistle. with all this occurred it was discovered that the presence sensor was not working the way we needed in our project and with the short time to wax the project was decided that instead of using the presence sensor we could put a button to activate the code . So even with these adversities the code was ready, finalizing the project.

    06/14 Wednesday

       Already with the code ready and the circuit set up, the member Lorranny set up a model for a test.

06/15 Friday

    With the project in hand, Professor Marcelo Hatugai came to our group to fix some sentences from the blog.
    The member Rafael brought a video that he did, but we needed to change some things of the video, but the program that he used did not have on the computer of the college, that left us without what to do to solve, and the member Rafael decided that he would try to fix the video in his house.

06/16 Saturday

     Arriving in the room the student Diana told us to make a model of the "final" product. We took some last minute boxes and we're putting together a very simple replica of what we want. The member Rafael finished the video to present.

terça-feira, 5 de junho de 2018

Components needed to mount the prototype CrossingB




1Un. Arduino Mega


1Un. Protoboard

Jumpers


1Un.Buzzer passivo


2Un.Sensor Ultrassonico

1Un. Sensor Presença(PIR)


2Un.Led Vermelhos


1Un.Led Verde


4Un. Resistores

segunda-feira, 28 de maio de 2018

"CROSSINGB"

Safe crossing for the visually impaired

          The project uses sensors that will be placed before pedestrian lanes on avenues, streets and highways where there aren't traffic lights. The sensors will detect the presence of cars and in case of being safe for the pedestrian crossing will be emitted a sound signal near the lane. Our project aims to assist blind people and people with visual impairment.


Operation of the Project:

Step 1 - Detecting the User


       Next to the pedestrian lane, we will place a short pillar with a loudspeaker and a sensor. This first sensor will be responsible for triggering the other sensors whenever it detects if there is a person standing within its area. This scene takes place whenever the person is trying to cross the street. In case there is a person standing in the lane, the first sensor will start the process along with the other two sensors, and as a system, they will identify whether or not the street is safe to cross.

Step 2 - Verifying if Vehicle is Stopped

      Just behind the pedestrian lane, there is a white line signalling where cars must stop for giving way for pedestrians to cross. This is the place where the second sensor is positioned, just before this white line on the sidewalk. This second sensor will detect the presence of vehicles and, in case the vehicle is stading still for longer than 4 seconds, an alarm goes off. This alarm sound lets the pedestrian know it is safe to cross the street. But in case the car quickly stops for less than 4 seconds, the alarm does not go off and the countdown is reset to zero.

Step 3 - Verifying if there is no Vehicle

      In addition to the first and second sensors, a third sensor will be place 20 meters away from the pedestration lane - a safe distance to avoid accidents. This third sensor makes sure there is no car in moviment towards the crosswalk, in which case an alarm goes off to let the pedestrian know it is safe to cross because there isn't any car running along the street. However, the alarm only goes off 10 seconds after the pedestrian approaches the crosswalk, a fundamental safety requirement to avoid an ultimate blind spot - an eventual car moving between the second and third sensors.
The beep of the speaker will have a time of 15 seconds and will be faster as time goes by, to inform the pedestrian that it must cross fast.

segunda-feira, 21 de maio de 2018

ABOUT US


Rafael Candido 

Student of Computer System Analyses and Development at IFSP in Caraguatatuba. 
He's responsible for the development of ideas, for the creation and edition of the blog and for making the final video.




Miguel

Student of Computer System Analyses and Development at IFSP in Caraguatatuba.
  He's responsible for developing ideas and for recording the project development process in the diary.




José Marcelo

Student of Computer System Analyses and Development at IFSP in Caraguatatuba. 
He's responsible for the development of ideas, for the Arduino's Logical Programming and the translation of documentation.




Lorranny Havellyn

Student of Computer System Analyses and Development at IFSP in Caraguatatuba. She's responsible for the development of ideas, for the Arduino's circuit mounting, and for helping José Marcelo with Arduino's Logical Progamming.