1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Aircores & Ardurino Controller

Discussion in 'DIY peripherals' started by wimpo`, Jun 15, 2010.

  1. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    you cant avoid delay with serial read in arduino

    in 115200 you need 1ms on each byte

    i just got an opel corsa only speedometer tacho and i am working on it write now
  2. Frakk

    Frakk Active Member

    Joined:
    Apr 15, 2009
    Messages:
    1,144
    Balance:
    328Coins
    Ratings:
    +4 / 0 / -0
    Then prepare to waste about 95% of the processing time.
  3. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    I'm using 9600 baud speed because of the lcd refreshing to fast :p
    maybe that I will implement a delay in the lcd subroutine, so I can use higher baud speed.

    i've got my 2 Devantech MD03
    And i'm playing with them right know, it was very easy to set up and the code was as simple as the blink sketch :rofl:
    it builds up speed in both directions and then switch.
    Code:
    /*
     Fading
     
     This example shows how to fade an LED using the analogWrite() function.
     
     The circuit:
     * LED attached from digital pin 9 to ground.
     
     Created 1 Nov 2008
     By David A. Mellis
     Modified 17 June 2009
     By Tom Igoe
     
     http://arduino.cc/en/Tutorial/Fading
     
     */
    
    
    int pwmPin = 2; int pwmPin2 = 3;    // LED connected to digital pin 9
    int dirPin = 52; int dirPin2 = 53;
    
    void setup()  { 
         pinMode(pwmPin, OUTPUT);   pinMode(pwmPin2, OUTPUT);     
         pinMode(dirPin, OUTPUT);   pinMode(dirPin2, OUTPUT);         
    } 
    
    void loop()  { 
         digitalWrite(dirPin, LOW);   // set the LED on
       digitalWrite(dirPin2, HIGH);   // set the LED on
      // fade in from min to max in increments of 5 points:
      for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
        // sets the value (range from 0 to 255):
        analogWrite(pwmPin, fadeValue); 
        analogWrite(pwmPin2, fadeValue);      
        // wait for 30 milliseconds to see the dimming effect    
        delay(30);                            
      } 
    
      
       digitalWrite(dirPin, HIGH);   // set the LED on
       digitalWrite(dirPin2, LOW);   // set the LED on
      
      
        // fade in from min to max in increments of 5 points:
      for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
        // sets the value (range from 0 to 255):
        analogWrite(pwmPin, fadeValue); 
        analogWrite(pwmPin2, fadeValue);      
        // wait for 30 milliseconds to see the dimming effect    
        delay(30);                            
      } 
                         
      }
    
    So now I'm figuring out how to put the potentiometers on the motors so i can start with positioning them, maybe i will use the servos that I have.
  4. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    which is the the frequency for a pwm speedometer for 0kmh and wich for 200kmh?

    thanks
  5. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    http://www.youtube.com/watch?v=uz9uxnqRG0c

    i paid 50€ for this

    very expencive
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    With frequencies?? 0-300 hz?? How did you find the original power inputs?

    I have a nissan Primera P11 cluster and I can't find anything online about the back connection harness... I traced some pins and spotted GND and possible some power inputs... didn't dare yet to fire it up... lol
  7. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    it haw symbols
    + and -

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

    how my output should be

    ????/


    i cant drive it
  8. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    i mean

    i have to set a standart pmw frequency

    and then change tha duty cycle?

    for each speed?


    thnaks
  9. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I believe your Corsa cluster works with frequency (old technology) not with CAN-network like new ones. The meters may be aircore driven with dedicated chips in the cluster.
    So what you need to position it correctly, is to use a timer that outputs certain frequency from 0Hz to 300 Hz... I still experimenting with timers but for now you can try using the tone command library: http://arduino.cc/en/Reference/Tone

    On the video you apply PWM to the inputs of the cluster or directly on the meters? I ask because I also see the odometer increasing that means it counts pulses like from the real car axle!

    Thanos
  10. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    i give a pwm at the input of the cluster

    so the old tecnoliogy requires a 50% duty cylce pwm with variable pwm?
  11. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    or maybe 3.000 Hz?
  12. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    now its working on 0-1000

    i hate the opel
  13. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    Re: Custom dashboard-stepper motor / LCD / servos / 7-Seg / leds


    Sry but you dont have 12 pwm


    run the fade example code

    on pin 12

    and check the led on pin 13
  14. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    http://www.youtube.com/watch?v=0ZA4JEYDL6I

    ok no more hand PWM

    the pwm pulses are from 0Hz to 1KHz 50% duty cycle

    i can set it from 7km/h to 200+ km/h

    It does not have a low fuel lamp

    who made it?
  15. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    actual every pwm pin en digital pin can be used as pwm with the inbuilt timer.
    and every pwm pin can be used as digital output.

    Code:
    void setup()
    {
      pinMode(13, OUTPUT);
    }
    
    void loop()
    {
      digitalWrite(13, HIGH);
      delayMicroseconds(100); // Approximately 10% duty cycle @ 1KHz
      digitalWrite(13, LOW);
      delayMicroseconds(900);
    }
    
    a bit dirty, but it works
  16. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    yes i had done the same to test the speedometer

    for a reason it was not as good as the tone

    but with the above you can have a pwm for limmited time

    for example (A copy paste code that i have write on the arduino forum)

    Ok lets feef a led on pin 50 on mega with 2.5V

    void loop{

    digitalWirte(50,HIGH);
    delay(2);
    digitalWrite(50,LOW);
    delay(2);

    //do other things here


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

    so we feed the led only once for each loop

    we will have 5V on pin 50 for 2ms and then nothing untill the loop ends and starts over again

    but if you write analogWrite(3,127);

    then you can do other things and the led run on 2.5V
  17. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    yeah the duty cycle will not work then.
  18. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    http://www.youtube.com/watch?v=1ZozGny2BRc
  19. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    awesome :yourock:

    did you use the l293d
  20. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    nop only npn transistors