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

Custom dashboard-stepper motor / LCD / servos / 7-Seg / leds

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

  1. herctrap

    herctrap Member

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

    i had some parts enought to make a dashboard

    such as

    a 48 stepper motor as a tacho
    an LCD for the speed ans gear
    a servo for the fuel meter
    some leds as shift lights
    and i also found a 7 segment and i made it a gear indicator

    all of those are controlled by an arduino mega board

    here is an example

    http://www.youtube.com/watch?v=EC8lH-WYE2c

    an another video also

    http://www.youtube.com/watch?v=iJDyM6ZmQqc ( shows into the dashboard )

    i dont have a schematic or something else because i didnt made or read one

    i have the arduino code if you want it
    the tricky part for me was how to read the data from the profiller

    now i am serching a real tacho to conect on a atmega328

    but i have some profiller questions

    what is the setup on the profiller to make a positive output like the speed (0-300) correspond to a 8 bit demical output (+0 to +255) ?

    i cant read negative numbers on the arduino

    and also how to convert the turbo output from (-99, +175) to a positive 8 bit demical output?

    thanks a lot
  2. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    This is pretty awesome. :freu2:
    How do you read the serial input out?

    i am tinkering with this right now.
    Code:
    // Maurice Ribble
    // 4-6-2008
    // http://www.glacialwanderer.com/hobbyrobotics
    
    // This code depends on the Servo Software Library.  You can get
    // this lib from http://www.arduino.cc/playground/ComponentLib/Servo
    
    // To use this app just send the board a number followed by an 's'
    // to set the angle of the servo (0-180 are valid)
    
    #include <Servo.h>
    #include <LiquidCrystal.h>
    // This is the pin you need to attach the servo to
    #define SERVO_1_PIN 2
    #define SERVO_2_PIN 3
    Servo g_servo1;
    Servo g_servo2;
    LiquidCrystal lcd(12, 11, 7, 6, 5, 4);
    void setup()
    {
      pinMode(SERVO_1_PIN, OUTPUT); pinMode(SERVO_2_PIN, OUTPUT);
      g_servo1.attach(SERVO_1_PIN); g_servo2.attach(SERVO_2_PIN);
      Serial.begin(9600);
      lcd.begin(16, 2);
    }
    
    void loop()
    {
      static int val = 0;
    
      if (Serial.available())
      {
        lcd.clear();
        char ch = Serial.read();
    
        switch(ch)
        {
          case '0'...'9':
            val = val * 10 + ch - '0';
            break;
          case 'x':
            g_servo1.write(val);
            Serial.print(Servo1 is set to: );
            Serial.print(val, DEC);
            Serial.println( degrees);
            lcd.print(val, DEC);
            lcd.print(x);
            val = 0;
            break;
            
            case 'y':
            g_servo2.write(val);
            Serial.print(Servo2 is set to: );
            Serial.print(val, DEC);
            Serial.println( degrees);
            lcd.print(val, DEC);
            lcd.print(y);
            val = 0;
            break;        
        }
      }
    
    
    }
    8 bit resolution and decimal output.
    9600 baud 8bit noparity onestopbit
    USO output

    ~a01~x ~a02~y refresh 33ms

    And the servo's are moving, only the lcd part isn't working well.
    Keep in mind that this is my first hardware programming experience. I only have experience with php,mysql and ajax.
    I've also did some research for a off the shelf h-bridge for wiper motors.
    The Devantech MD03 24V 20A Tutorials for arduino available.
    The Polulu MD03A tutorials also available for the arduino.

    I would be very interested in you're code for learning purposes.
  3. herctrap

    herctrap Member

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

    8 bit resolution and decimal output.
    at 9600 - 2ms delays and 60 ms of pause
    at 115200 - 1ms delya ams 30ms pause

    i am sending

    R~a01~S~a02~F~a03~T~a06~G~a05~
  4. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    thanks a lot i will look into this :clap:
  5. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
    so how we will have only a postitive output (0-255) outuput from profiller?


    thanks a lot
  6. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    I don't know yet this is my third day at this.
    I have a question for you how does you're lcd work because of the Serial.print in the lcd section.
  7. herctrap

    herctrap Member

    Joined:
    Apr 5, 2010
    Messages:
    88
    Location:
    Ilion / Pylos
    Balance:
    243Coins
    Ratings:
    +0 / 0 / -0
  8. wimpo`

    wimpo` Member

    Joined:
    Jul 27, 2008
    Messages:
    89
    Occupation:
    metselaar
    Location:
    nederland, twente, vroomshoop
    Balance:
    178Coins
    Ratings:
    +5 / 0 / -0
    So i've got it!!

    I set the math plugin like this.
    I'm using the testtablet on slider 25 and 26.
    both sliders output 1:1 gforce output and calibration offset 0% asymetric(full range)
    gforce settings min value 1 in upper and lower deadzone
    gforce setting max value 2000 upper an lower deadzone (this can be any value you like i guess) .
    testtablet slider 25 and 26 above slider you upper deadzone value en below slider lower deadzone value.

    USO
    value = (value/0*1)+0
    8bit decimal output

    arduino reading serial

    i hope you can do something with this.
    Slowly but steady i'm learning how x-sim works :yippiee:
  9. 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
  10. herctrap

    herctrap Member

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

    herctrap Member

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

    bballjon87 New Member

    Joined:
    Jan 21, 2011
    Messages:
    2
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    how did you manage to read the data from the profiler. i am currently having trouble with that part of my project.