Shop OBEX P1 Docs P2 Docs Learn Events
input voltage to control program parameters — Parallax Forums

input voltage to control program parameters

trazymtrazym Posts: 10
edited 2009-04-10 21:12 in Propeller 1
Hi,

I am new with microcontrollers and i want to know if it is possible to read the voltage applied to one pin and to use this value as a parameter into the program?

If it is possible, how can i do it?

Thank you for your help!!

Fred

Comments

  • virtuPICvirtuPIC Posts: 193
    edited 2009-04-10 17:19
    Hi Fred,

    if you want a digital input it's simple. If levels match that of the controller simply connect - if not add a level converter.

    You mean analog voltage? Search the object exchange for ADC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-10 17:21
    Hi,

    maybe you should tell a bit more. Is your goal to have a input device to control the program or do you really have some kind of device which produces different voltages and you want to attach exactly that to the microcontroller (hopefully a propeller;o) ?

    For a simple analoge input device the delta-sigma ADC would be a good thing to start with. It measures the resistance of a variable resistor with only one additional condensator and one additional (fixed) resistor. You can find it in the propeller educational lab which can be downloaded in the propellers download section.
  • trazymtrazym Posts: 10
    edited 2009-04-10 17:47
    I'm building an engin control system and my goal is to have an input device to control some parameters in the program 'in situ' and without PC.

    Maybe a variable voltage isn't the best solution!
  • virtuPICvirtuPIC Posts: 193
    edited 2009-04-10 17:55
    If you mean to control values manually there are other - better input methods, indeed. For input you can plug together a small keyboard, use an IR receiver and a remote control, wire some touch pads, connect a PS/2 keyboard... For output you can use LED arrays or 7 segment displays, LCD displays, sound output...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • trazymtrazym Posts: 10
    edited 2009-04-10 18:04
    Off course but it is for off road motorbike engine and the best tool for this kind of application is a screwdriver!!
    My first Idea was to change the control parameters using knobs and screwdrivers.
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-10 18:43
    What range do you need?

    So the variable resistor would work. Other possibility would be to use an encoder ( I don't know the english word for it, maybe it's wrong ) You can turn it and it gives you impulses on two pins for each step. With the timing of these impulses you can determine in which direction it's been turned. One COG count's up and down accordingly. But then you wouldn't need a screwdriver;o)
  • trazymtrazym Posts: 10
    edited 2009-04-10 18:54
    Where can i find an encoder? Are you french?
  • LeonLeon Posts: 7,620
    edited 2009-04-10 19:15
    Look for rotary encoders.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-04-10 19:42
    Hello trazym,

    as it is for an offroad motorbike the device should be as robust as EVER possible.
    I wouldn't use an analog potentiometer at all for this purpose. On an offroad motorbike
    everything use shaking around and this will make a potentiometer make fail after 100 km

    Still we need more information.
    Are you doing some finetuning of the motor-ignition ALL the time in realtime when the engine's rpm goes up and down ?

    Are you doing some adjustements BY HAND two or three times a day with 6 steps between min and max ?

    How many steps do you need from min to max ?

    The best solution will depend on what you want to do. S
    o post a detailed description of your project.

    best regards

    Stefan
  • trazymtrazym Posts: 10
    edited 2009-04-10 20:07
    I want to control the engine power depending on grip conditions. Mud or sand riding is different than dry conditions and I need to set it as precise as possible.

    In fact, maybe 6 steps between min and max is enought. I've to try with changing the values with the laptot and then i'll see if that's enought!!

    Which component would you use to do it?

    Thank you for your fast and serious answers! [noparse];)[/noparse]
  • virtuPICvirtuPIC Posts: 193
    edited 2009-04-10 20:49
    Scan the sites of and there are many more offering such devices.

    Oh, if you only need to encode 6 different values you can use up/down keys and count the values in software.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-04-10 21:12
    Hello trazim,

    it's still not clear to me what you want to do exactly.

    Would you like to adjust the engine power while driving.
    I mean you see the mud 100m ahead and want to do a quick switch to the mud-engine-power-mode
    while still riding the bike at full speed or

    one day riding through mud switching to the mud-engine-power-mode
    another day riding on dry and solid ground switching to the dry-engine-power-mode ?

    and how many parameters have to be adjusted ?

    One robust solution could be very robust mechanical switches or inductive proximity sensors
    one for increase the value one for decrease the value. Every press of the button counts the value one up or down
    and a 7-segment display shows the actual value. With two 7segment digits this would give you values from 0 up to 99

    Inductive-proximity-sensors are working WITHOUT any mechanical parts. If something made of iron, steel or aluminium comes close
    to the sensor the sensor switches its output. I think there are even sensors that could be used under water.

    You can drive them from 10V -30V. They are available in a lot of different sizes. 4mm diameter 40mm long up to 30mm diameter 100mm long
    or small boxes in that size. Maybe the specification should say something about how much vibration (accelation and frequency) the sensor can
    deal with without beeing damanged

    best regards

    Stefan
Sign In or Register to comment.