viernes, 13 de septiembre de 2013

Arduino in Motorcycle

First at all is that the english doesn't my mother tongle and may be sure I will make a lot of fails, but a one idea is this blog for practice me english, I hope that the reader apologize me those fails, and if you wish, mark this fails in the comments.


I am a proud owner of DAELIM Roadwin FI and now I connect the system  based in arduino for show in one LCD screen based in OLED 0.96" "monochrome"
The base code as drivers of the screen is https://learn.adafruit.com/096-mini-color-oled
Therefore, I should send my greetings to all forumers and his information exposed in http://arduino.cc/forum/


With this system I installed a system that it let me:
  • Temperature oil
  • Temperature enviroment
  • Clock
  • Voltage.
When detected the low or over voltaje, this value blink, and temperature oil happens the same, when it see low or over temperature.


The Arduino used is the Nano V3.0:
The code is beta (it needs any improves):

 The Circuit of system is this:


This is the display in the motorbike:


  

11 comentarios:

  1. hello
    excelent project!!!!!
    we don t mind about your aproximative english (me too i make a lot of mistake!!!!)
    1 st:
    could it be possible to adapt your code to read a ntc sensor?(radiator fan switch or ntc temperature oil sensor alarm)????
    2nd:
    with 1 push button reading - ext temp
    - oil temp
    - water temp
    - voltmeter
    etcc
    one after other not all at the same time ,the oled display is too small when you are riding?
    thanks

    ResponderEliminar
    Respuestas
    1. Thank you for you comment.

      Arduino can read sensors engines, mainly the engine sensors works to 5VDC like arduino.
      If you program the read a push button colud be read other sensors, or if the sensor increase or decrease about a range it could show.

      In my code when temperature is too low or too high, the vaule blink. This is the code lines
      //Temperature Oil
      if(TempOil>100 && Flash==1 || TempOil<30 && Flash==1){
      display.setTextColor(BLACK, WHITE);
      }else{
      display.setTextColor(WHITE);
      }

      About display size I see the values, but you can put other display bigger than this.

      Eliminar
  2. hi joseca

    I try to compile the program and I get the following error:

    ----------------------------------------------------------
    Arduino:1.8.5 (Windows 8.1), Tarjeta:"Arduino/Genuino Uno"

    fatal error: Adafruit_ssd1306syp.h: No such file or directory

    #include

    ^

    compilation terminated.

    exit status 1
    Error compilando para la tarjeta Arduino/Genuino Uno.

    --------------------------------------------------

    Might you help me?
    If you want to speak in Spanish I do not control English very much.

    thank you and best regards

    ResponderEliminar
    Respuestas
    1. You need one library, in this link you can download
      Necesitas una libreria, con este link te la puedes descargar

      You can copy the text and save in one archive with .h extension "Adafruit_ssd1306syp.h" into file library in arduino directory

      Puede copiar el texto y guardarlo en un archivo con la extensión .h "Adafruit_ssd1306syp.h" en la carpeta library en el directorio arduino

      https://github.com/Miyeah/Arduino-Dormitory-Assistant/blob/master/library/Adafruit_ssd1306syp/Adafruit_ssd1306syp.h


      Eliminar
    2. Este comentario ha sido eliminado por el autor.

      Eliminar
    3. Thank you very much Joseca !!

      I had to put the following libraries:

      -RTClib
      -RTC_DS1307
      -Adafruit_ssd1306syp

      And now your program compiles me correctly.

      So now I'm going to buy the necessary material and I have the following doubts:

      - Instead of placing two LM35 temperature sensors, can I put two DS18B20 sensors? (is that these I have seen that they already come with the hose of three cables and I think it is easier to place on the bike, in the metal zones to measure temperature.
      Can you put the DS18B20 without changing anything of your program?

      - Does the yellow line of the 10k variable resistor R9 go to the analogue input AO of the Arduino?
      How do you adjust the variable resistance and what function does it have?

      - How do I set the clock time for I2C?

      Forgive so many silly questions and thanks again.

      ----------------------------------------------
      Muchas gracias Joseca!!

      Tuve que meter las siguientes librerías:

      -RTClib
      -RTC_DS1307
      -Adafruit_ssd1306syp

      Y ahora ya me compila correctamente tu programa.

      Entonces ahora voy a comprar el material necesario y tengo las siguientes dudas:

      - En lugar de colocar dos sensores de temperatura LM35, puedo poner dos sensores DS18B20? ( es que estos he visto que vienen ya con la manguera de tres cables y creo que es más fácil colocar en la moto, en la zonas metálicas a medir temperatura.
      Se pueden poner los DS18B20 sin cambiar nada de tu programa?

      - La línea amarilla de la resistencia variable R9 de 10k va a la entrada analógica AO del arduino?
      Como se ajusta la resistencia variable y que función tiene?

      - Como se hace para ajustar la hora del reloj de I2C?
      Perdona tantas preguntas tontas y gracias de nuevo .
      ----------------------------------------------

      Eliminar
    4. DS18B20 is a i2c sensor, ant this program with wire library, like the clock, therefore need change the program, because the lm35 is analog sensor.

      The A0 measure the voltage, due to analog pin only read 5v, and the motorbike reach +14v need a voltage divisor, this potentiometer for this, in the programa I put 5v is 17.6v, therefore the potentiometer is you measure between ground and A0, the read 10kOhm(5/17.6) kOhm

      -i2c clock in tje examples library, show one program to put the computer our, if you load this program the clock syncronise with you computer, and then when you put the program to read clock, it is the same hour that you computer

      Dont have a silly questions, only silly answers XD

      Eliminar
    5. DS18B20 es un sensor i2c, y este programa con biblioteca wire, como el reloj, por lo tanto, es necesario cambiar el programa, porque el lm35 es un sensor analógico.

      El A0 mide el voltaje, debido a que el pin analógico solo lee 5v, y la motocicleta alcanza + 14v necesita un divisor de tensión, este potenciómetro esta para esto, en el programa que puse 5v es 17.6v, por lo tanto, el potenciómetro mide entre tierra y A0 , la lectura 10kOhm (5 / 17.6) kOhm

      -i2c reloj en la biblioteca de ejemplos, muestra un programa para poner nuestra computadora, si cargas este programa el reloj se sincroniza con tu computadora, y luego cuando pones el programa para leer el reloj, es la misma hora que tu computadora

      No hay preguntas tontas, solo respuestas tontas XD

      Eliminar
    6. I was helped by the clarifications to understand the program a little.

      From what I see is complicated by putting the sensor DS18B20.

      I have been searching the internet and it seems that you can control the two oil and ambient temperatures using two NTC 10K temperature sensors.

      I found an example program, and it would look something like this:

      ----------------------------------------------------
      #include

      void setup() {
      Serial.begin(115200);
      }
      double Thermister(int RawADC) {
      double Temp;
      Temp = log(((10240000/RawADC) - 10000));
      Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
      Temp = Temp - 273.15;
      return Temp;
      }
      void loop() {
      int val;
      double temp;
      val=analogRead(0);
      temp=Thermister(val);
      Serial.println(temp);
      delay(1000);
      }
      //fuente :ElectroCrea.com
      ----------------------------------------------------

      But I do not know how you could include this code in your program to measure the two temperatures, temperature and environment by means of NTC 10k sensors.

      I discovered this world of the Arduino thanks to its excellent idea, But I am learning and it is very complicated at the moment for me.

      Could you modify your programming by replacing the LM35 sensors with the NTC10K?

      In case you want to help me I'll pass on my email if you wish.

      Thanks again.

      Eliminar
    7. Me sirvió de ayuda las aclaraciones para entender un poco el programa.

      Por lo que veo se complica poniendo el sensor DS18B20.

      He estado buscando en internet y parece que se puede controlar las dos temperaturas de aceite y ambiente mediante dos sensores de temperatura NTC 10K.
      He encontrado un ejemplo de programa, y sería algo así:

      ----------------------------------------------------
      #include

      void setup() {
      Serial.begin(115200);
      }
      double Thermister(int RawADC) {
      double Temp;
      Temp = log(((10240000/RawADC) - 10000));
      Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
      Temp = Temp - 273.15;
      return Temp;
      }
      void loop() {
      int val;
      double temp;
      val=analogRead(0);
      temp=Thermister(val);
      Serial.println(temp);
      delay(1000);
      }
      //fuente :ElectroCrea.com
      ---------------------------------------------------

      Pero no sé cómo se podría incluir este código dentro de su programa para medir las dos temperaturas, temperatura y ambiente por medio de sensores NTC 10k.

      He descubierto este mundo del Arduino gracias a su excelente idea, Pero estoy aprendiendo y es muy complicado de momento para mí.

      Podrías modificar tu programación sustituyendo los sensores LM35 por los NTC10K?

      En caso de que quieras ayudarme te paso mi correo electrónico si lo deseas.

      Gracias de nuevo.

      Eliminar
  3. Este comentario ha sido eliminado por el autor.

    ResponderEliminar