Shop OBEX P1 Docs P2 Docs Learn Events
When I run my code, should it work? - Page 2 — Parallax Forums

When I run my code, should it work?

2

Comments

  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-09 16:54
    I think what I need to put is


    dira[noparse][[/noparse] 1] = 0
    ina[noparse][[/noparse] 1] = 1

    trying to say it's a low side input?


    mpark said...
    You're still assigning to ina ("ina[noparse][[/noparse] 1 ] := 0") which DOES NOT DO ANYTHING.

    You can't set ina[noparse][[/noparse] 1 ], you can only read it. ina[noparse][[/noparse] 1] is 0 if the voltage on input pin 1 is less than approx. 1.6V, and 1 if the voltage is higher.

    What exactly is a "pulsing ground signal"?
  • SamMishalSamMishal Posts: 468
    edited 2009-10-09 16:58
    Hi Turbo,

    This line

    ····ina[noparse][[/noparse]­·1]··:=·0·········'·sets·pin·1·to·be·an·input·for·an·rpm·value

    Is wrong due to assigning a value to an input pin.....But from the comment I THINK you are trying to
    get a value that I THINK is an Analog value???????

    Input Pins can only get 1 or 0.....so if you want an RPM value then this ONE PIN will not do the job.

    You cannot input an Analog voltage directly from a Pin. Pins only see 1 (> 1.6 V) and 0 (< 1.6 V).

    If you want to have a user enter an analog level for the RPM then you must use an RC-Decay
    circuit with a variable resistor. This way the user can turn a Potentiometer and set the RPM
    Level according the value of the resistor. See pages 120 to 126 for how to do this.



    Sam
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-09 17:12
    Ok, I'm going to try and rewrite the code now to see if I understand, sorry I keep screwing this up so much, but thanks to everyone who's helped!

    Questions:

    Can I use my while statements?
    How do I code to say "input pin two is receiving a ground/low side signal" ? I feel like ina[noparse][[/noparse] 2] == 0 means it's not receiving any signal? Or if I set it to dira[noparse][[/noparse] 2] := 0, I'm ok?




    Edit for more info

    How do I write the text part for the 3 repeats, in proper code? I'll be rereading the funlabs pages mentioned in the mean time


    
    
    
    
    
    ' Test circuit for voltage values
    
    
    var
      long x
           
    
    pub Pumptest
    
                                                                             
        dira[noparse][[/noparse]1..7] := %0000000                                                      ' sets pins 1 through 7 to inputs
        dira[noparse][[/noparse] 8] := 1                                                               ' sets pin 8 to an output
        outa[noparse][[/noparse] 8] := 1                                                               ' sets pin 8 as an output of positive voltage
                                                                      
    
      x := 0
    
      repeat
        repeat while x := (ina[noparse][[/noparse] 1] == no pulse) AND (ina[noparse][[/noparse] 2] <> ground signal)      ' while pin 1 is not receiving a pulsing ground signal and pin 2 does not receive a ground signal
               outa[noparse][[/noparse] 8] := %1                                                       ' connect input pin 3 to output pin 8 and repeat until it receives a signal on pin 1
               ctra[noparse][[/noparse] 8] := %00110                                                   ' sets control to single sided
               frqa := 2_147_483_648                                                ' sets the frequency for 1.65v                        
    
        repeat while x := (ina[noparse][[/noparse] 1] > no pulse) AND (ina[noparse][[/noparse] 2] == ground signal)       ' while input pin 1 has a pulsing ground signal and pin 2 has a ground signal
               outa[noparse][[/noparse] 8] := %1                                                       ' repeat until this input is greater than 0 and is receiving a ground
               ctra[noparse][[/noparse] 8] := %00110                                                   ' sets control to single sided
               frqa := 2_407_784_696.24                                             ' sets the frequency for 1.85v  
    
        repeat while x := ina[noparse][[/noparse] 1] > no pulse AND ina[noparse][[/noparse] 2] <> ground signal           ' while pin 1 receives a pulsing ground signal, but pin 2 does not receive a ground signal
          
               outa[noparse][[/noparse] 8] := %1                                                       ' connect output pin 8 to input pin 7 and pass the voltage value
               ctra[noparse][[/noparse] 8] := %00110                                                   ' sets control to single sided
               frqa := 2_069_393_333.527                                            ' sets the frequency for 1.59v      
               waitcnt(clkfreq/2 + cnt)                                             ' keeps outa[noparse][[/noparse] 8] the current frequency value for 500 milli seconds, then repeats endlessly until ina[noparse][[/noparse] 1] = 0 
               
               outa[noparse][[/noparse] 8] := %1                                                       ' connect output pin 8 to input pin 6 and pass the voltage value
               ctra[noparse][[/noparse] 8] := %00110                                                   ' sets control to single sided
               frqa := 1_822_107_337.69                                             ' sets the frequency for 1.4v
               waitcnt(clkfreq/2 + cnt)                                             ' keeps outa[noparse][[/noparse] 8] the current frequency value for 500 milli seconds, then repeats endlessly until ina[noparse][[/noparse] 1] = 0
                  
    
    
    
    

    Post Edited (turbosupra) : 10/9/2009 5:24:35 PM GMT
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-09 17:27
    Sam,

    For clarification, I was *hoping* that I could feed a ground signal to a propeller input pin, and have it count the pulses and equate that to an rpm value, so my logic was that no pulse = 0 and a pulse = 1, and the chip could count all of the "1"s ? I'm guessing that logic is flawed? I thought that was how I read that the Yaris circuit was designed, that's given as an example on the parallax site.

    www.parallax.com/tabid/774/Default.aspx


    SamMishal said...
    Hi Turbo,

    This line

    ina[noparse][[/noparse]* 1] := 0 ' sets pin 1 to be an input for an rpm value


    Is wrong due to assigning a value to an input pin.....But from the comment I THINK you are trying to
    get a value that I THINK is an Analog value???????

    Input Pins can only get 1 or 0.....so if you want an RPM value then this ONE PIN will not do the job.

    You cannot input an Analog voltage directly from a Pin. Pins only see 1 (> 1.6 V) and 0 (< 1.6 V).

    If you want to have a user enter an analog level for the RPM then you must use an RC-Decay
    circuit with a variable resistor. This way the user can turn a Potentiometer and set the RPM
    Level according the value of the resistor. See pages 120 to 126 for how to do this.



    Sam
  • AJMAJM Posts: 171
    edited 2009-10-09 18:01
    Hi Turbo,

    I really must recommend going through the PE labs I suggested in a previous thread. A lot, if not all, of what you are trying to do is accomplished and explained in the Labs.

    By the time you get to the final lab on counters, you will have already covered most of what you need to do. After really absorbing the counters lab, you will have a much better understanding of how the prop can count pulses.

    Not coming from a programing background, I still refer to all of the labs and propeller manual. All have plenty of well written examples.
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-09 18:09
    Hey,

    I did take your advice, I was hoping I could see an example simplistic code for this project congruently, while continuing to do the labs. You are right though, it is covered well in pages 120-135, so I will stay the normal course with the book after seeing that pointed out to me.

    Which car/engine does that tach in your avatar represent?


    AJM said...
    Hi Turbo,

    I really must recommend going through the PE labs I suggested in a previous thread. A lot, if not all, of what you are trying to do is accomplished and explained in the Labs.

    By the time you get to the final lab on counters, you will have already covered most of what you need to do. After really absorbing the counters lab, you will have a much better understanding of how the prop can count pulses.

    Not coming from a programing background, I still refer to all of the labs and propeller manual. All have plenty of well written examples.
  • SamMishalSamMishal Posts: 468
    edited 2009-10-09 18:23
    turbosupra said...

    For clarification, I was *hoping* that I could feed a ground signal to a propeller input pin, and have it count the pulses and equate that to an rpm value, so my logic was that no pulse = 0 and a pulse = 1, and the chip could count all of the "1"s ? I'm guessing that logic is flawed? I thought that was how I read that the Yaris circuit was designed, that's given as an example on the parallax site.
    Turbo,

    See the PEK book pages 151 to 153 for how to do PULSE counting......

    I also recommend VERY MUCH that you go through the ENTIRE PEK book
    from cover to cover.......ALL that you want to do is covered in one place
    or another.....I think after you complete the book with all the exercises
    and try out all the labs you will have ALL YOU NEED to achieve your project...REALLY...


    Sam
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-09 19:00
    Hello Turbo,

    an IO-pin that is configured as an input-pin
    is high-impedance-input-pin - is high-impedance-input-pin - is high-impedance-input-pin

    high-impedance means the resistance of the IO-pin is high. the current flowing into IO-pin is very small

    you can code something like

      ina[noparse][[/noparse] 1] := 1 
    
    



    or

      ina[noparse][[/noparse] 1] := 0
    
    



    or code it not at all

    the IO-pin will behave ALWAYS the same way:

    when-ever a voltage between 0.00V and 1.65V is connected to the IO-pin 1
    the logic state off ina[noparse][[/noparse] 1] is 0

    when-ever a voltage between 1.65V and 3.30V is connected to the IO-pin 1
    the logic state off ina[noparse][[/noparse] 1] is 1

    to draw a analog-picture

    imagine a light-detecting sensor

    whenever you spot enough light on it the sensor will switch on (connect 1.65V to 3.30V to IO-pin)

    if you spot no light or just a small candle the switch will stay switched off (0.00V to 1.65V)

    you can put a glass in front of the sensor or a visbile foil (code something like ina [noparse][[/noparse] 1] := 1
    the sensor will behave still in the EXACT same way as without these things in front of him

    the command ina[noparse][[/noparse] 1] := 1 does NOTHING NOTHING NOTHING NOTHING NOTHING
    there is NO possability to do something like put a red glas in front of the sensor (to filter everything but red light)

    to draw a picture out of th emechanical world:

    imagine you have a special kind of electrical vehicle in mind with some kind of joystick to drive it:

    it's like somebody is telling you if you want to drive a car backwards shift in the backwards gear
    and you are asking: "if I pull the gas-pedal the car drives backwards ?"
    you get the answer no shift in the backwards gear
    and you keep on asking "if I pull the gas-pedal the car drives backwards ?"

    no no push the left pedal an shift to the backwards gear
    "if I pull the gas-pedal the car drives backwards ?"
    NO ! push the left pedal and change to the backwards gear
    etc. etc. etc.

    if it is a gasoline ignition motor you have to throw away your picture of this special electrical joystick-vehicle
    and START NEW to paint a realistic picture of a gasoline-motor-car
    and you seem to refuse to do this

    If you want to check for a voltage to be 0.0V=ground
    there are really only TWO ways to do this
    1) code a condition like ina [noparse][[/noparse] 1] == 0
    examples
    repeat while ina [noparse][[/noparse] 1] == 0
    if ina [noparse][[/noparse] 1] == 0


    2) waitpeq ... (which is a more complicated command)

    to say it VERY CLEAR:
    you have some REALLY wrong pictures about how the propeller works
    and it is really hard for us (forum-members) to wipeout this WRONG pictures
    inside your head

    so please again do us forum-members a favor
    describe what you want to do - NOT in code but in NORMAL words

    example:

    if voltage on cable A is 1.40V do X

    if voltage on cable B is 0.0V do Y

    NO SPIN-codelines at all !!! not even a single word like inputpin or register
    AVOID COMPLETELY to use SPIN-code-lines and propellerhwardware to explain what you want to do
    use NORMAL words !!!

    Believe me you will run up the learning curve of spin-coding much faster if you do it this way

    if you describe what you want to do in NORMAL words
    the forum-members can code a 100% congruent example of what you want to do in SPIN-code

    OK I hope this was not too offensive I'm really willing to help you

    best regards

    Stefan

    Post Edited (StefanL38) : 10/9/2009 7:23:24 PM GMT
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-09 23:45
    Hey Stephan

    Ok, here is what I want it to do in normal words


    I want the chip to sense two inputs, an rpm signal and a ground signal (that is only present at certain times)

    Based on those two input signals, it can output the following correct signals


    ~1.65v output when it senses NO rpm signal
    ~1.85v output when it senses an rpm signal AND a ground signal
    (spikes up to 2.05v when it releases this value)
    ~1.4 - 1.59v when it senses an rpm signal but NO ground signal


    Hopefully that is written and communicated in a way that makes sense, let me know if you have some example code that I can load into my eeprom to try, based on that, if it's reasonably easy to write?

    Thanks!
  • SamMishalSamMishal Posts: 468
    edited 2009-10-10 02:52
    Hi Turbo,

    What is a "ground signal" ???· what do you mean by ????releases signal????

    Your project should be VERY EASY to do:

    Setup the propeller to look at a Pin (say 0) for the square wave (or even sine wave) that
    changes from 0 to 3.3 V......use Positive Edge Detector Counter

    Set Up another Pin (say 1) to look for the "ground signal" (whatever that is??) if it is a
    pulsing wave then again use a counter. If it is a 0 or 1 then use just normal ina[noparse]/noparse

    Set up another Counter that is set for Duty Mode on another Pin (say 2). This will output
    the voltage level required depending on FreqA value. Which is set according to the
    logic you mentioned.

    You enter a loop that checks your logic and sets the Freq accordingly

    here is some PSEUDO CODE
    set CounterA to do Positive edge detection on Pin 0
    Setup an input Pin 1
    Setup counterB to output Duty mode DAC on Pin 2
    repeat forever
        check Phs register to see there is any RPM if there is X = 1 if not then X=0
        Y = Ina[noparse][[/noparse]1]   'ie state of pin1 to see if there is a 0 or 1....this may change if my understanding of "ground signal" is wrong
        if X == 0
            set FreqB to output a 1.65 V on the CounterB Duty mode
        elseif X == 1 and Y == 0  (ground signal is 0 no??)
            set FreqB to output 1.85 v on the counterb duty mode
            ????? releases value???? but spiking to 2.05 again just set the FreqB value
        elseif X == 1 and Y = 1 (ground signal is one means not ground no???)
            set FreqB to 1.4 then next time through the loop to 1.59 ????
        endif
    endrepeat
    
    


    ·sam··


    Post Edited (SamMishal) : 10/10/2009 2:58:14 AM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-10 05:07
    Hello Turbo,

    well done. Your latest description clears up many things. Now we are in the developing process.
    It is quite usual that there come up new questions while developing. So here

    Can you say us what voltage-value your "ground-signal" has. Ground-signal is an uncommon word in electronics
    I guess you mean 0.00Volt. Can you specify the voltage-levels:

    "ground-signal" present: X Volt, "ground-signal" NOT present: Y Volt. Write us BOTH voltage-levels

    specify the timing for the 2.05V spikes

    at time 0,00 seconds detecting rpm and "ground" for the first time

    1) How much time will pass by until the first 2.05V spike appears ?

    2) How long do the spikes appear ?

    a) a short time (how long in seconds)
    b) ALL the time until "ground"-signal disapeared ?

    3) How long ARE the 2.05V spikes ?

    4) What is the frequency with which the voltage should vary between 1.40V and 1.59V ?

    Another question: Do you have an oscillioscope ?
    As the whole system reacts dynamically it might be that the signals are more dynamically as a voltagemeter can show you
    To check this you need an oscillioscope.

    I used your uncommon-term "ground-signal" to stay in contact with you.
    But please specifiy in electronical words what you mean by the word "ground-signal"
    You specify this by writing us the voltage-values you see on your voltagemeter if

    "ground-signal" is present: X Volt
    "ground-signal" NOT present: Y Volt.

    Write us BOTH voltage-values

    With this details we will be able to write an example code that is 100% congruent

    best regards

    Stefan

    Post Edited (StefanL38) : 10/10/2009 5:14:13 AM GMT
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-14 05:51
    Sam,

    A ground signal would be a low side signal, or something to complete the circuit for a device that has a constant supply of positive dc current.

    I will try and tinker with the code tomorrow and see what I come up with, thank you!




    SamMishal said...
    Hi Turbo,






    Your project should be VERY EASY to do:



    Setup the propeller to look at a Pin (say 0) for the square wave (or even sine wave) that


    changes from 0 to 3.3 V......use Positive Edge Detector Counter



    Set Up another Pin (say 1) to look for the "ground signal" (whatever that is??) if it is a
    pulsing wave then again use a counter. If it is a 0 or 1 then use just normal ina[noparse]/noparse



    Set up another Counter that is set for Duty Mode on another Pin (say 2). This will output
    the voltage level required depending on FreqA value. Which is set according to the
    logic you mentioned.



    You enter a loop that checks your logic and sets the Freq accordingly



    here is some <FONT color=red>PSEUDO
    CODE


    
    set CounterA to do Positive edge detection on Pin 0
    Setup an input Pin 1
    Setup counterB to output Duty mode DAC on Pin 2
    repeat forever
        check Phs register to see there is any RPM if there is X = 1 if not then X=0
        Y = Ina   'ie state of pin1 to see if there is a 0 or 1....this may change if my understanding of "ground signal" is wrong
        if X == 0
            set FreqB to output a 1.65 V on the CounterB Duty mode
        elseif X == 1 and Y == 0  (ground signal is 0 no??)
            set FreqB to output 1.85 v on the counterb duty mode
            ????? releases value???? but spiking to 2.05 again just set the FreqB value
        elseif X == 1 and Y = 1 (ground signal is one means not ground no???)
            set FreqB to 1.4 then next time through the loop to 1.59 ????
        endif
    endrepeat 
    
    
    



    sam
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-14 06:10
    Hey Stefan, thanks, good to know I'm getting better at describing! I will try and answer each question chronologically

    A ground signal would be a low side signal that completes a circuit ... what term should I be using?

    I can do that

    The timing for the 2.05v, I don't believe is very crucial in terms of milliseconds. Basically it appears that it checks to see that after the low side signal is not present, that a voltage spike to ~2.05v is detected for ~500 milliseconds and then it falls to oscillate between 1.4 and 1.59v. As you stated, these values may change a bit when developing, but they are ballparks at the moment.


    For final tweaking, I'll oscope it and log what I get. I did this once before, but I can't find the file now.


    1. The 2.05v only appears once, after the low side signal is removed.

    2. The 2.05v appears for approximately 500 milliseconds

    3. Approximately 500 milliseconds

    4. It oscillates to a different voltage value approximately every 500 milliseconds or so



    I will try and oscope this tomorrow evening.

    How do I say that the signal is completed via a closed loop connection on the low side, if the sensor has a constant supply of positive voltage?


    Thank you for the help.



    StefanL38 said...
    Hello Turbo,

    well done. Your latest description clears up many things. Now we are in the developing process.
    It is quite usual that there come up new questions while developing. So here

    Can you say us what voltage-value your "ground-signal" has. Ground-signal is an uncommon word in electronics
    I guess you mean 0.00Volt. Can you specify the voltage-levels:

    "ground-signal" present: X Volt, "ground-signal" NOT present: Y Volt. Write us BOTH voltage-levels

    specify the timing for the 2.05V spikes

    at time 0,00 seconds detecting rpm and "ground" for the first time

    1) How much time will pass by until the first 2.05V spike appears ?

    2) How long do the spikes appear ?

    a) a short time (how long in seconds)
    b) ALL the time until "ground"-signal disapeared ?

    3) How long ARE the 2.05V spikes ?

    4) What is the frequency with which the voltage should vary between 1.40V and 1.59V ?

    Another question: Do you have an oscillioscope ?
    As the whole system reacts dynamically it might be that the signals are more dynamically as a voltagemeter can show you
    To check this you need an oscillioscope.

    I used your uncommon-term "ground-signal" to stay in contact with you.
    But please specifiy in electronical words what you mean by the word "ground-signal"
    You specify this by writing us the voltage-values you see on your voltagemeter if

    "ground-signal" is present: X Volt
    "ground-signal" NOT present: Y Volt.

    Write us BOTH voltage-values

    With this details we will be able to write an example code that is 100% congruent

    best regards

    Stefan
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-14 19:39
    Hello Turbosupra,

    Good. Now I have a much clearer picture about timings.

    I still have a question: voltages are always measured between TWO points.
    For most voltage-measurings one point is ground. (for example the negative-contact of a battery)
    This means for measuring voltages "related" to ground you connect one wire (usually the black one) with the negative-contact of the battery
    and the usually red wire is connected to the point you want to measure.

    To understand your circuit completely I really have to know what voltage do you measure if you connect the black wire of your voltagemeter to
    the negative contact of your power-supply and the red wire of your voltagemeter to the "ground-signal" If your "ground-signal" is present.
    Even if you measure 0.0000V I NEED to know it. Post me an answer that includes a voltage-value regardless of what the value is
    if you measure 0.00V post it
    if you measure 12V post it
    if you measure 5000V post it

    And I need to know the voltage measured the same way if your "ground-signal" is not present.
    I want to clear what does your description "ground-signal" mean electrically.

    In electronics it is an absolutly umcommon phrase to talk of a "ground-signal". It's an UNclear description.
    There is a lot of space for DIFFERENT interpretations left by saying "ground-signal"

    It is the same for your question

    "How do I say that the signal is completed via a closed loop connection on the low side, if the sensor has a constant supply of positive voltage?"

    How can an electrical signal be completed ?

    Please attach pictures, post voltage-measuring-results as these are hard facts. Add whatever you think it might be useful.

    But I can't imagine what you mean by saying "closed loop connection on the low side"

    What is the low side ?

    I could guess into the fog. But then we would play some kind of a quiz

    Write me all the details of the sensor

    what kind of sensor ?
    what is the sensor sensing ? temperature ? pressure ?
    how many wires are comming from the sensor ?

    what voltages do you measure between the negative contact of the power-supply and wire 1 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 2 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 3 of the sensor ?
    etc. etc.

    best regards

    Stefan
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-14 21:40
    Hi again Stefan,

    I recorded this, so this might help a little in descriptiveness

    www.youtube.com/watch?v=UfjOp3295gc

    I'm going to have to put the multimeter onto the wire to make sure I can accurately answer your question about how it reads.

    The sensor is a pressure sensor, it has 3 wires coming from it, I believe 1 to be 5v, one to be a ground and 1 to be a feedback. I will give you details on the sensor tonight when I get home.




    StefanL38 said...
    Hello Turbosupra,

    Good. Now I have a much clearer picture about timings.

    I still have a question: voltages are always measured between TWO points.
    For most voltage-measurings one point is ground. (for example the negative-contact of a battery)
    This means for measuring voltages "related" to ground you connect one wire (usually the black one) with the negative-contact of the battery
    and the usually red wire is connected to the point you want to measure.

    To understand your circuit completely I really have to know what voltage do you measure if you connect the black wire of your voltagemeter to
    the negative contact of your power-supply and the red wire of your voltagemeter to the "ground-signal" If your "ground-signal" is present.
    Even if you measure 0.0000V I NEED to know it. Post me an answer that includes a voltage-value regardless of what the value is
    if you measure 0.00V post it
    if you measure 12V post it
    if you measure 5000V post it

    And I need to know the voltage measured the same way if your "ground-signal" is not present.
    I want to clear what does your description "ground-signal" mean electrically.

    In electronics it is an absolutly umcommon phrase to talk of a "ground-signal". It's an UNclear description.
    There is a lot of space for DIFFERENT interpretations left by saying "ground-signal"




    I'm sure my terminology is wrong, but I say closed loop connection when I'm trying to describe what happens when electrons are allowed to flow from one side of the battery terminal to the other. I thought that the circuit is deescribed as "open", until a connection is wire is connected to one side of the battery and then to the other, allowing the electrons to flow from the negative side to the positive side, such as in the picture below?

    Part of my terminology is coming from this lesson

    www.parallax.com/Portals/0/Downloads/docs/prod/prop/PELabsFunBook-v1.1.pdf (page 47-48)

    closed.jpg


    Let me know what you think, thanks!

    StefanL38 said...

    It is the same for your question

    "How do I say that the signal is completed via a closed loop connection on the low side, if the sensor has a constant supply of positive voltage?"

    How can an electrical signal be completed ?

    Please attach pictures, post voltage-measuring-results as these are hard facts. Add whatever you think it might be useful.

    But I can't imagine what you mean by saying "closed loop connection on the low side"

    What is the low side ?

    I could guess into the fog. But then we would play some kind of a quiz

    Write me all the details of the sensor

    what kind of sensor ?
    what is the sensor sensing ? temperature ? pressure ?
    how many wires are comming from the sensor ?

    what voltages do you measure between the negative contact of the power-supply and wire 1 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 2 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 3 of the sensor ?
    etc. etc.

    best regards

    Stefan
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-14 22:27
    Hello Turbo,

    OK page 47-48 is clear in its language.
    There is ONE sentence that clears up the rest

    Since the other end of the LED circuit is connected to ground (0 V)

    This sentence is the most important on page 47/48 of the PELabsFunBook-v1.1.pdf !!!

    Everything else that is written belongs to the sentence above.


    The video shows a DMM showing a voltage of 1.5 to 1.9V. From the end of the video I can see that your inside a car.

    Turbo please please be much more detailed or I will refuse to help you !

    What did you measure in the video ? The pressure sensor ?
    what was the object that the black wire of your DMM was connected to ?
    what was the object that the red wire of your DMM was connected to ?

    come on is it so hard to write 10 sentences with the details ?

    If that's too much for you to write details - it is too much for me to go on playing this "post a few words ask back-game !!!!"

    Usually I'm a real patient guy. But refusing to provide details in so much cases makes me upset !
    Maybe you have recognized that nobody else but me is answering.
    If I quit the only thing you will get as answers will be sarcasm

    So stop posting a few words. Do all the work that I have asked for and wait with posting again
    until you can answer EVERY DAMMED DETAIL ! If this takes a month it will take a month !

    regards
    Stefan
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-14 23:07
    I was providing what I could while at work, as I couldn't answer all of your questions while at work, but was trying to be as helpful as possible. That explanation is all I will post until I have something that answers the other questions you have asked.

    In the mean time, thank you very much for the diligence and help you have provided.
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-15 01:09
    StefanL38 said...
    Hello Turbosupra,

    Good. Now I have a much clearer picture about timings.

    I still have a question: voltages are always measured between TWO points.
    For most voltage-measurings one point is ground. (for example the negative-contact of a battery)
    This means for measuring voltages "related" to ground you connect one wire (usually the black one) with the negative-contact of the battery
    and the usually red wire is connected to the point you want to measure.

    To understand your circuit completely I really have to know what voltage do you measure if you connect the black wire of your voltagemeter to
    the negative contact of your power-supply and the red wire of your voltagemeter to the "ground-signal" If your "ground-signal" is present.
    Even if you measure 0.0000V I NEED to know it. Post me an answer that includes a voltage-value regardless of what the value is
    if you measure 0.00V post it
    if you measure 12V post it
    if you measure 5000V post it

    Here is a video indicating a measurement of this circuit. I have the positive lead of my multimeter connected to a constant 12vDC (~13.8 when the alternator is spinning) source, and I have the negative probe of my multimeter connected to a signal/trigger wire from my ecu that goes to a solenoid in my car. This trigger wire from the ecu is what I need to use as an input to my circuit to tell it when to do certain things. This video below uses my multimeter to show a circuit of the positive probe seeing a constant 12vDC straight from the battery and the negative probe connected to the ecu which completes the measurement circuit by supplying a ground.

    In this particular situation, the positive voltage source was constant, it's the ground/negative source that is being manipulated.

    StefanL38 said...

    And I need to know the voltage measured the same way if your "ground-signal" is not present.
    I want to clear what does your description "ground-signal" mean electrically.

    In electronics it is an absolutly umcommon phrase to talk of a "ground-signal". It's an UNclear description.
    There is a lot of space for DIFFERENT interpretations left by saying "ground-signal"

    It is the same for your question

    "How do I say that the signal is completed via a closed loop connection on the low side, if the sensor has a constant supply of positive voltage?"


    If you can tell me the correct term to call part of the measurement process where you connect the DMM to the negative post of the battery, I will use that terminology, if chassis ground signal or ground signal is incorrect.
    StefanL38 said...

    How can an electrical signal be completed ?

    What I meant by an electrical signal being completed would be similar to switch being normally open or normally closed, along with the switch that circuit is connected to being normally open or normally closed depending on the switch that circuit used. When there is a constant supply of either positive voltage and no ground for that circuit or a constant supply of a ground and no positive voltage for that circuit, I called it an incomplete circuit or an open circuit and then when both the positive voltage and ground are present, I was calling it a complete circuit. Complete because it's allowing voltage to flow from the negative post of the battery to the positive post like in the picture above. If this terminology is wrong, please let me know the correct terminology.

    StefanL38 said...


    Please attach pictures, post voltage-measuring-results as these are hard facts. Add whatever you think it might be useful.


    Video's along with descriptions

    www.youtube.com/watch?v=UfjOp3295gc - in this video I have the multimeter grounded to the chassis with the negative probe, and the positive probe is connected to a pressure sensor output(green wire in the picture of the sensor below). This sensor is also the sensor that I want to emulate with my microcontroller. It starts off with the car not running, but the ignition on and gives an atmospheric pressure reading in the form of around 1.61x volts. Then I start the car and an air pump is turned on (by the ecu giving a ground signal to a solenoid) and that gives a higher pressure, which the pressure sensor reads and in turn outputs a higher voltage output of around 1.85x volts (to the green wire in the sensor pictured below). Then in the video you will see the pump turn off when the voltage on the multimeter spikes up and reads around 2.05 volts, and this signals the pump turning off. After that you will see the voltage value from the pressure sensor oscillate between 1.4x and 1.5x volts as the car is running, but the pump is off.

    www.youtube.com/watch?v=lXFkBWisUuQ - in this video you see an ecu internally controlled output wire being measured by the negative probe of the multimeter and the positive probe of the multimeter is connected to a constant 12vDC source (or around 13.8 when the alternator is spinning). You'll see the multimeter start to measure when the car is turned off, and at this point you see the auto ranging feature hunting around. Then you will see me start the car, at which point the ecu connects this output wire to the chassis ground (giving it a connection to the negative side of the battery) and allows the multimeter to register a voltage value. After a minute or so, you'll see that the ecu then takes away the chassis ground from the output wire/negative probe of the multimeter and the DMM then goes back to auto ranging, even though the positive probe still has its constant 12vDC source ... because it does not have a ground.



    StefanL38 said...

    But I can't imagine what you mean by saying "closed loop connection on the low side"

    I'm trying to say that the multimeter has a connection to both posts of the battery giving the voltage the ability to flow through the circuit. I will use whatever terminology you say is correct, if the terminology I'm using is wrong.
    StefanL38 said...

    What is the low side ?

    Me trying to figure out the proper terminology for the part of the circuit that is closest to the negative post on the battery

    StefanL38 said...

    I could guess into the fog. But then we would play some kind of a quiz

    Write me all the details of the sensor

    what kind of sensor ?
    what is the sensor sensing ? temperature ? pressure ?
    how many wires are comming from the sensor ?


    It's a pressure sensor, 5vDC, 3 wire. Please see below 3 more quotes, for specifics
    StefanL38 said...

    what voltages do you measure between the negative contact of the power-supply and wire 1 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 2 of the sensor ?
    what voltages do you measure between the negative contact of the power-supply and wire 3 of the sensor ?
    etc. etc.

    best regards

    Stefan

    Wire 1 = Yellow wire (when the key is in the on position, this wire has a constant supply of + 5vDC)
    Wire 2 = Green wire (the voltage value on this wire depends on the pressure going to the sensor, so voltage value varies, from what I've measured 1.4v to 2.05v)
    Wire 3 = Brown wire (this wire has a connection to the negative post of the battery at all times)
    StefanL38 said...
    Hello Turbo,

    OK page 47-48 is clear in its language.
    There is ONE sentence that clears up the rest

    Since the other end of the LED circuit is connected to ground (0 V)

    This sentence is the most important on page 47/48 of the PELabsFunBook-v1.1.pdf !!!

    Everything else that is written belongs to the sentence above.


    I'm not sure what you are saying there, but I was trying to use the same terminology as the book, apparently I was not correct though.


    StefanL38 said...


    The video shows a DMM showing a voltage of 1.5 to 1.9V. From the end of the video I can see that your inside a car.

    Turbo please please be much more detailed or I will refuse to help you !

    What did you measure in the video ? The pressure sensor ?
    what was the object that the black wire of your DMM was connected to ?
    what was the object that the red wire of your DMM was connected to ?


    In that video I was measuring the output voltage of the pressure sensor. The black wire of the multimeter was connected to the chassis ground, the red wire was connected to the sensor output wire (in the pictures, the green wire).

    Here are some pictures and descriptions of the pressure sensor


    pressuresensor1s.jpg

    pressuresensor2s.jpg

    StefanL38 said...

    come on is it so hard to write 10 sentences with the details ?

    If that's too much for you to write details - it is too much for me to go on playing this "post a few words ask back-game !!!!"

    Usually I'm a real patient guy. But refusing to provide details in so much cases makes me upset !
    Maybe you have recognized that nobody else but me is answering.
    If I quit the only thing you will get as answers will be sarcasm

    So stop posting a few words. Do all the work that I have asked for and wait with posting again
    until you can answer EVERY DAMMED DETAIL ! If this takes a month it will take a month !

    regards
    Stefan

    I have tried to answer everything you've requested in the most detail that I can, I hope I did well, thank you for reading.
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-15 09:01
    Hello Turbo,

    Yes that's really good. Well done. Now I have a clear picture of what you have measured.
    Turbo said...

    www.youtube.com/watch?v=lXFkBWisUuQ - in this video you see an ecu internally controlled output wire being measured by the negative probe of the multimeter and the positive probe of the multimeter is connected to a constant 12vDC source (or around 13.8 when the alternator is spinning). You'll see the multimeter start to measure when the car is turned off, and at this point you see the auto ranging feature hunting around. Then you will see me start the car, at which point the ecu connects this output wire to the chassis ground (giving it a connection to the negative side of the battery)

    I'm not too familiar with car-electric. But that's looks strange to me. The ECU-wire get's connected to ground. Usually ALL kind of wires are connected to ground permanently and what changes is the connection to +12V

    What do you measure if you connect the black probe of the DMM to chassis-ground and the red probe to the ECU-wire ?
    I don't need a video. Just the value. clear indicated by a description like this:

    black probe--> chassis-ground
    red probe---> trigger wire from the ecu. Measured voltage: xx.xx V

    Where you replace the xx.xx by the measured voltage.
    If you provide less information than in the example above it is not clear what you have measured !

    We have to find out if there is a different voltage (when the solenoid is turned ON/OFF) between ground and solenoid-wire,
    because if you want to connect the solenoid-wire to a propeller IO-pin you have to connect the propeller-ground with the chassis-ground of your car.

    This connection - propeller-ground with the chassis-ground - is an ABSOLUTLY MUST to get reliable results. Except if we would use potential-free contacts for everything.

    Potential-free means: there is NO connection between ground of device A with ground of device B

    If you would connect car+12 Volt to propeller-ground the propeller would be in a strange connection and beeing in danger of getting damaged

    If you measure the same voltage
    by measuring

    a) solenoid turned OFF:

    black probe --> Chassis-ground
    red probe --> solenoid-wire Measured voltage: xx.xx V

    b) solenoid turned ON:

    black probe --> Chassis-ground
    red probe --> solenoid-wire Measured voltage: xx.xx V


    ONLY if you measure in a) AND b) the SAME voltage:
    we have to connect a small relay parallel to the wires of the solenoid. The contacts of the relay will give us a potential-free contact
    Then a pull-down-resistor of 10kOhm is connected between propeller-ground and IO-PIN. Prop-GND
    10kOhm----Prop-IO-Pin

    The contacts of the relay where connected
    relay-contact A----prop-IO-Pin
    relay-contact B----+3.3V

    As long as the relay-contact is opened the prop-IO-pin "sees" 0.0V logical low

    If the relay-contact is closed the prop-IO-pin "sees" +3.3V logical HIGH




    If I read the words "completed circuit" I think of a electronical device which is ASSEMBLED completly
    To me the word "completed" has nothing to do with opend or closed switches or connected / disconnected wires.

    The common word for something connected to positive voltage AND ground is "connected to positive voltage AND ground"
    I can't think of a shorter expression than this to make everything clear. Maybe for a simple switch you can talk of a closed switch or an opened switch
    But then it is still not clear which wire is connected permanently ? (the wire to the positive voltage or the wire to ground ???)

    replace the word complete by the word close

    example: instead of "this will complete the circuit" write "this will CLOSE the circuit so current can flow from ______ to _______"

    Replace the _________ with a description from where to where the current will flow.

    As we communicate over a written forum. Less information will led us in misunderstandings over and over.

    closest to the negative post of the battery: "connected to ground"

    closest to the positive post of the battery: "connected to +12V" (always add the voltage-VALUE) writing connected to "+" is NOT enough


    So what I have understood so far is

    You want to with the propeller:
    detect if the solonoid is switched on/off
    if switched on create a changeable voltage between 0.0V and 2.05V for different amount of times

    can you again describe the sequence

    1) motor is turned off
    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    and ALWAYS replace the "_____" by a description that makes it clear where the probes are connected to

    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are

    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor measured voltage: xx.xx V


    2) motor gets started
    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are


    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    etc. etc.

    3) any detail that changes

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are

    whenever the greenwire-voltage changes
    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    etc. etc.

    Please do me a favor and describe it in that way.

    best regards

    Stefan

    Post Edited (StefanL38) : 10/15/2009 9:08:48 AM GMT
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-16 04:43
    Hey Stefan,
    Turbo said...

    www.youtube.com/watch?v=lXFkBWisUuQ - in this video you see an ecu internally controlled output wire being measured by the negative probe of the multimeter and the positive probe of the multimeter is connected to a constant 12vDC source (or around 13.8 when the alternator is spinning). You'll see the multimeter start to measure when the car is turned off, and at this point you see the auto ranging feature hunting around. Then you will see me start the car, at which point the ecu connects this output wire to the chassis ground (giving it a connection to the negative side of the battery)
    StefanL38 said...

    I'm not too familiar with car-electric. But that's looks strange to me. The ECU-wire get's connected to ground. Usually ALL kind of wires are connected to ground permanently and what changes is the connection to +12V
    It is my understanding that this is done because of amperage and ease. From what I've read, it's easier to supply a ground to control something like a relay or solenoid, then it is to supply positive voltage.




    StefanL38 said...

    What do you measure if you connect the black probe of the DMM to chassis-ground and the red probe to the ECU-wire ?
    I don't need a video. Just the value. clear indicated by a description like this:

    black probe--> chassis-ground
    red probe---> trigger wire from the ecu. Measured voltage: xx.xx V

    Where you replace the xx.xx by the measured voltage.

    Ok, with black probe to chassis ground and red probe to trigger wire form ecu I get
    12.33v when the key is in the ignition "on" position, but the car is not running
    175.3 millivolts when the car is running and the pump is running
    13.85v when the car is running and pump is NOT running

    I know you said a video was not necessary, but I like videos because they help me keep a log for later viewing. If you want to look at the video, I have one



    StefanL38 said...

    If you provide less information than in the example above it is not clear what you have measured !

    We have to find out if there is a different voltage (when the solenoid is turned ON/OFF) between ground and solenoid-wire,
    because if you want to connect the solenoid-wire to a propeller IO-pin you have to connect the propeller-ground with the chassis-ground of your car.

    This connection - propeller-ground with the chassis-ground - is an ABSOLUTLY MUST to get reliable results. Except if we would use potential-free contacts for everything.

    Potential-free means: there is NO connection between ground of device A with ground of device B

    If you would connect car+12 Volt to propeller-ground the propeller would be in a strange connection and beeing in danger of getting damaged

    If you measure the same voltage
    by measuring

    I'm glad you suggested this, I never would have thought this to be the result



    StefanL38 said...

    a) solenoid (meaning air pump) turned OFF:

    black probe --> Chassis-ground
    red probe --> solenoid-wire Measured voltage: xx.xx V

    Since these wires actually turn the solenoid on and off, I believe you mean the air pump on and off?

    If so, with the air pump off and car running or not running = 12.33-13.85v of positive voltage depending on the alternator, but for a hundredths decimal place value like you requested, it's 12.33 vDC of positive voltage with the car not running and 13.85 vDC of positive voltage with the car running and the probes as you suggested above/pump off



    StefanL38 said...

    b) solenoid (air pump) turned ON:

    black probe --> Chassis-ground
    red probe --> solenoid-wire Measured voltage: xx.xx V

    Since these wires actually turn the solenoid on and off, I believe you mean the air pump on and off?

    If so, with the air pump on and car running = 175.3 millivolts of positive voltage with the car running and the probes as you suggested above/pump on



    StefanL38 said...

    ONLY if you measure in a) AND b) the SAME voltage:
    we have to connect a small relay parallel to the wires of the solenoid. The contacts of the relay will give us a potential-free contact
    Then a pull-down-resistor of 10kOhm is connected between propeller-ground and IO-PIN. Prop-GND
    10kOhm----Prop-IO-Pin

    The contacts of the relay where connected
    relay-contact A----prop-IO-Pin
    relay-contact B----+3.3V

    As long as the relay-contact is opened the prop-IO-pin "sees" 0.0V logical low

    If the relay-contact is closed the prop-IO-pin "sees" +3.3V logical HIGH

    I might have to read this a few times and google some things to make sure I am understanding this part correctly. Either way, I never expected +12v on that wire when the pump wasn't running, I'm impressed you had the foresight to check for that!

    I think I don't need a relay though, cause they are different readings? And the pull down resistor is a dump path for excessive voltage?



    StefanL38 said...

    If I read the words "completed circuit" I think of a electronical device which is ASSEMBLED completly
    To me the word "completed" has nothing to do with opend or closed switches or connected / disconnected wires.

    The common word for something connected to positive voltage AND ground is "connected to positive voltage AND ground"
    I can't think of a shorter expression than this to make everything clear. Maybe for a simple switch you can talk of a closed switch or an opened switch
    But then it is still not clear which wire is connected permanently ? (the wire to the positive voltage or the wire to ground ???)

    replace the word complete by the word close

    example: instead of "this will complete the circuit" write "this will CLOSE the circuit so current can flow from ______ to _______"

    Replace the _________ with a description from where to where the current will flow.

    As we communicate over a written forum. Less information will led us in misunderstandings over and over.

    closest to the negative post of the battery: "connected to ground"

    closest to the positive post of the battery: "connected to +12V" (always add the voltage-VALUE) writing connected to "+" is NOT enough

    Thanks for this explanation, I will try and incorporate these words/phrases into my vocabulary [noparse]:)[/noparse]



    StefanL38 said...

    So what I have understood so far is

    You want to with the propeller:
    detect if the solenoid is switched on/off
    if switched on create a changeable voltage between 0.0V and 2.05V for different amount of times

    StefanL38 said...

    can you again describe the sequence

    1) motor is turned off but key is on
    black probe ----> connected to chassis ground
    red probe ---> connected to ecu trigger wire to solenoid
    measured voltage: 12.33 V

    black probe ----> connected to ecu trigger wire to solenoid
    red probe ---> connected to a constant +12vDC source
    measured voltage: -24.3 millivolts

    and ALWAYS replace the "_____" by a description that makes it clear where the probes are connected to

    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are

    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor measured voltage: xx.xx V

    I've altered the values inside of the quote, the time for the voltage values are entirely dependent on if the pump is running and if the car is running, and not based on a time value (at least that is what I believe at this point)


    StefanL38 said...


    2) motor gets started and pump is running
    black probe ----> connected to chassis ground
    red probe ---> connected to ecu trigger wire to solenoid
    measured voltage: 175.3 millivolts

    black probe ----> connected to ecu trigger wire to solenoid
    red probe ---> connected to a constant +12vDC source
    measured voltage: 13.85 V


    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are



    2b) motor gets started and pump NOT running
    black probe ----> connected to chassis ground
    red probe ---> connected to ecu trigger wire to solenoid
    measured voltage: 13.85 V

    black probe ----> connected to ecu trigger wire to solenoid
    red probe ---> connected to a constant +12vDC source
    measured voltage: 250.2 millivolts



    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    etc. etc.

    I've altered the values inside of the quote, the time for the voltage values are entirely dependent on if the pump is running and if the car is running, and not based on a time value (at least that is what I believe at this point)


    StefanL38 said...

    3) any detail that changes

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    black probe ----> _____
    red probe ---> _____ measured voltage: xx.xx V

    .... add any measurements that are nescessary to detect in which step of the motorstart-sequence we are

    whenever the greenwire-voltage changes
    black probe ----> Chassis-ground
    red probe ---> green wire of pressure sensor

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    amount of time: X.X seconds: measured voltage: xx.xx V

    etc. etc.

    Please do me a favor and describe it in that way.

    best regards

    Stefan

    I believe the info about is complete, I've read it and reread it so I think it's good and understandable [noparse]:)[/noparse]

    Post Edited (turbosupra) : 10/16/2009 5:47:53 AM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-16 09:17
    Hello Turbo,

    well done. I would like to repeat in own words what I have understand:

    1) Your description: 1.65v output when it senses NO rpm signal

    in other words:
    Motor state: OFF (no rpm-signal)
    Pump state: doesn't matter
    pressure-sensor voltage between ground-chassis and green wire of pressure sensor 1.65v


    2) Your description: 1.85v output when it senses an rpm signal AND a ground signal

    in other words:
    Motor state: running (rpm-signal present)
    Pump state: running (voltage between ground-chassis and ECU-wire to pump +0.18V) almost ground = 0.00V
    pressure-sensor voltage between ground-chassis and green wire of pressure sensor 1.85v

    Question:
    pressure-sensor voltage spikes up to 2.05v when motor is running pump and is running ?


    3) Your description: 1.4 - 1.59v when it senses an rpm signal but NO ground signal

    in other words:
    Motor state: running (rpm-signal present)
    Pump state: OFF (voltage between ground-chassis and ECU-wire to pump +13.85V)

    is that correct ?

    You mentioned a rpm-signal. What is the MAXIMUM-voltage of this rpm-signal ?

    We need to know the maximum voltage to prevent the propeller-IO from getting damaged

    ATTENTION the maximum voltage you can connect to propeller-pins DIRECTLY is 3.3V !!

    For higher voltages you MUST HAVE additional components to protect the propeller-chip from getting damaged !

    If you measure a signal that is switched ON/OFF quickly (example 2 times per second or faster) a normal DMM will more or less average the voltage
    So from a normal DMM you DON'T get the maximum voltage. If you have an oscilloscope you can measure the maximum voltage.

    The DMM in the video seems to be quite sophisticated. Does it have an explicit peak-voltage measurement feature ?

    With a normal DMM you could do a first estimation by measuring the voltage at a very low rpm and a high rpm
    the black probe ALWAYS connected to chassis-ground !!

    A safe way to connect this rpm-signal to the propeller is to "insert" a NPN-transistor.
    This means the base of the npn-transistor is connected to a 10kOhm-resistor and the other end of this resistor is connected to the rpm-signal

    rpm-signal
    10kOhm
    base of npn-transistor

    emitter of npn-transistor connected to ground

    collector of npn-transistor connected to
    4,7kOhm
    + 3.3V
    and collector of of npn-transistor----Propeller-IO-pin

    even more safe is an optocoupler

    hm - I think I have to draw everything as a schematic and attach it to a posting
    a picture says more than a thousand words.

    This will take some time even as a quick and dirty hand drawing

    In the meantime give me information about the voltage of the rpm-signal

    best regards

    Stefan
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-16 15:33
    Hi Stefan!

    I have an oscope from Parallax, but I'm not so sure it's actually working correctly so I'm a little hesitant to try and log any data from my ignition system with it, and post it as fact.

    I downloaded some manual files today, and if I'm reading them correctly, I believe they imply that a positive +12 signal is sent to the ignitor/coil when the ecu is telling it to fire the spark plug.

    I've bolded some additional info, next to your comments in the posts below.



    StefanL38 said...
    Hello Turbo,

    well done. I would like to repeat in own words what I have understand:

    1) Your description: 1.65v output when it senses NO rpm signal

    in other words:
    Motor state: OFF (no rpm-signal)
    Pump state: doesn't matter (to be 100% accurate, the pump never runs when the engine is not running)
    pressure-sensor voltage between ground-chassis and green wire of pressure sensor 1.65v (to be 100% accurate, the voltage level varies with pressure a little, so the ability to adjust this value will probably be a good idea)


    2) Your description: 1.85v output when it senses an rpm signal AND a ground signal

    in other words:
    Motor state: running (rpm-signal present)
    Pump state: running (voltage between ground-chassis and ECU-wire to pump +0.18V) almost ground = 0.00V
    pressure-sensor voltage between ground-chassis and green wire of pressure sensor 1.85v (to be 100% accurate, the voltage level varies with pressure a little, so the ability to adjust this value will probably be a good idea)

    Question:
    pressure-sensor voltage spikes up to 2.05v when motor is running pump and is running ? (to be 100% accurate, the voltage level varies with pressure a little, so the ability to adjust this value will probably be a good idea). It appears to go to 2.05vDC right as the pump is shut off as an internal check system for the pump to make sure it can spike the pressure up and register that spike on the pressure sensor output to the ecu, therefore showing there are no leaks in the system. I'm guessing that as you stated, the 2.05vDC is somewhat of an average and the true peak voltage might be a little higher, if I can get my oscope working consistently, I will have an accurate value for this


    3) Your description: 1.4 - 1.59v when it senses an rpm signal but NO ground (meaning the pump is turned off) signal (to be 100% accurate, the voltage level varies with pressure a little, so the ability to adjust this value will probably be a good idea)

    in other words:
    Motor state: running (rpm-signal present)
    Pump state: OFF (voltage between ground-chassis and ECU-wire to pump +13.85V/no ground signal)

    is that correct ?

    Thanks! and yes, those are correct statements, with my caveats added for clarification



    StefanL38 said...

    You mentioned a rpm-signal. What is the MAXIMUM-voltage of this rpm-signal ?

    We need to know the maximum voltage to prevent the propeller-IO from getting damaged

    ATTENTION the maximum voltage you can connect to propeller-pins DIRECTLY is 3.3V !!

    For higher voltages you MUST HAVE additional components to protect the propeller-chip from getting damaged !

    Based on the diagram from the manual pictured at the bottom of this post, I believe the ecu sends a +12.33-13.8vDC signal to the coil telling it to fire. I have a question, since the voltage value is way past the limit of the propeller, could we use a voltage inverter to overcome this?


    StefanL38 said...

    If you measure a signal that is switched ON/OFF quickly (example 2 times per second or faster) a normal DMM will more or less average the voltage
    So from a normal DMM you DON'T get the maximum voltage. If you have an oscilloscope you can measure the maximum voltage.

    The DMM in the video seems to be quite sophisticated. Does it have an explicit peak-voltage measurement feature ?

    With a normal DMM you could do a first estimation by measuring the voltage at a very low rpm and a high rpm
    the black probe ALWAYS connected to chassis-ground !!

    I can try this, I believe the ecu counts the pulses per second to estimate rpm. My DMM does not have a peak voltage function unfortunately


    StefanL38 said...

    A safe way to connect this rpm-signal to the propeller is to "insert" a NPN-transistor.
    This means the base of the npn-transistor is connected to a 10kOhm-resistor and the other end of this resistor is connected to the rpm-signal

    rpm-signal
    10kOhm
    base of npn-transistor

    emitter of npn-transistor connected to ground

    collector of npn-transistor connected to
    4,7kOhm
    + 3.3V
    and collector of of npn-transistor----Propeller-IO-pin

    even more safe is an optocoupler

    With the NPN, are you going to use it like a voltage inverter, by using a fast switching NPN and having +12v to the base and a ground signal triggered from the collector to the emitter pins when the base sees positive voltage?

    StefanL38 said...

    hm - I think I have to draw everything as a schematic and attach it to a posting
    a picture says more than a thousand words.

    This will take some time even as a quick and dirty hand drawing

    In the meantime give me information about the voltage of the rpm-signal

    best regards

    Stefan

    Can't wait to see it!



    In this picture, it appears that the ecu fires IGT1, 2, 3, or 4 to control when the coil provides a spark to the plug. Since it tells you to compare the pulses with the IGT pin and E1 or earth1, I suspect it is a positive voltage value that goes to the IGT pin for that coils rpm, do you agree? Do you want me to try the low rpm/high rpm test?

    ignitersetup1.jpg
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-17 03:54
    I measured voltage tonight on the rpm trigger wire and I decided to make this easier to read/understand with some charts



    Pressure sensor measurements

    pressuresensor2s.jpg



    Solenoid measurements

    solenoidmeasurements1.jpg



    Crank sensor measurements

    cranksensormeasurements.jpg





    A possible start to the propeller circuit?

    airpumpcircuit1.jpg








    Here are some of the OEM circuits that give you schematics that you can infer voltage flow from


    Crank Sensor Sensor Circuit

    cranksensoroemcircuit1.jpg



    Air Pressure Sensor Circuit

    airpumpoemcircuit1.jpg



    VSV Solenoid Circuit

    airpumpvsvoemcircuit1.jpg
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-17 05:32
    Hello Turbo,

    thanks for the pictures and charts.

    first of all your proposed propeller-circuit will probably not work.
    It's not that easy.


    Can you mark the RPM+ and RPM- in the pictures (schematics) ?

    about the green wire of the pressure-sensor:

    you mentioned in a new picture of the pressure-sensor
    "worth nothing when the pressure-sensor is unplugged te green wire reads +5V"

    Does this mean you measure
    black probe chassis-ground
    red probe green wire - coming from the ECU - but with disconnected pressure-sensor constant 5V ?


    If I take a look on the schematic there is some kind of double arrow with a direction from ECU >> pressure-sensor
    The ECU MIGHT use some kind of a CURRENT-sensing circuit as feedback from the sensor

    please measure the voltage between
    black probe chassis-ground
    red probe green wire with connected pressure-sensor

    and at the SAME TIME measure the current flowing through green wire of the pressure-sensor in all situations (engine on/off pump on/off)


    Now at this point I'm not sure if this is good for your car:
    If you disconnect the green wire and start the motor what will happen ?
    what is the air-pump and the pressure-measuring for ?

    If you decide to try it on your own risk:

    Keep the yellow and brown wire connected and only disconnect the green wire from the pressure-sensor

    please measure the voltage between
    black probe chassis-ground
    red probe green wire

    in all situations (engine on/off pump on/off)


    About the oscilloscope
    you always have to connect the ground-clamp with ground and connect the probe to what you want to measure

    if the ground-clamp is not connected the probe measures "everything in the air"

    As an easy test you could measure a propeller-IO-pin that is switched on/off

    ground-clamp of oscilloscope---> propeller-ground
    probe ---> propeller-IO-Pin

    As it is not clear how the pressure-sensor works it makes no sense to talk about interface-circuits to the propeller-chip

    It seems to get difficult somehow. More analysing how the pressure-sensor works
    trying to find out what is the impedance of the pressure-sensor etc.

    At this point I like to ask Is it worth the effort for you ?
    Applyling a simulated voltage to a ECU is not a self-purpose. What want you to do in the end ?



    best regards

    Stefan
  • SapiehaSapieha Posts: 2,964
    edited 2009-10-17 07:14
    Hi Turbo.


    As I know most of vehicle sensor is Variable CURENT - not Variable voltage sensors.
    If I kan see correct from Yours Data You present .... This sensor is that one.

    For posiblity to functioning with Propeller ... You must build CURENT to Voltage circuity betwen that sensor and Propeller pin.

    !! NOT connect it directly to Propeller (12 to 14V can dead Propeller) !!

    That can give YOU 2 POSIBLITES.
    1. wITH CORRECT adjustment You can sense states 1 else 0.
    2. Use ADC posiblites on Propeller and masure correct presure

    Regards
    ChJ

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-17 18:39
    Hi Stefan,

    I checked the manual, here is what it described for the arrows in the pictures, I believe it's a good thing as far as simplicity [noparse]:)[/noparse]

    wiringharnessarrows1.jpg



    StefanL38 said...
    Hello Turbo,

    thanks for the pictures and charts.

    first of all your proposed propeller-circuit will probably not work.
    It's not that easy.


    Can you mark the RPM+ and RPM- in the pictures (schematics) ?



    cranksensoroemcircuit1a.jpg



    StefanL38 said...

    about the green wire of the pressure-sensor:

    you mentioned in a new picture of the pressure-sensor
    "worth nothing when the pressure-sensor is unplugged te green wire reads +5V"

    Does this mean you measure
    black probe chassis-ground
    red probe green wire - coming from the ECU - but with disconnected pressure-sensor constant 5V ?


    If I take a look on the schematic there is some kind of double arrow with a direction from ECU >> pressure-sensor
    The ECU MIGHT use some kind of a CURRENT-sensing circuit as feedback from the sensor

    please measure the voltage between
    black probe chassis-ground
    red probe green wire with connected pressure-sensor

    and at the SAME TIME measure the current flowing through green wire of the pressure-sensor in all situations (engine on/off pump on/off)



    airpressuresensormeasur.jpg




    Here is the pressure sensor circuit in case this helps.

    airpressuresensoroemcir.jpg


    StefanL38 said...

    Now at this point I'm not sure if this is good for your car:
    If you disconnect the green wire and start the motor what will happen ?
    what is the air-pump and the pressure-measuring for ?

    If you decide to try it on your own risk:

    Keep the yellow and brown wire connected and only disconnect the green wire from the pressure-sensor

    please measure the voltage between
    black probe chassis-ground
    red probe green wire

    in all situations (engine on/off pump on/off)


    I tried this and it's included in the chart above, in summary, the voltage value went to 4.91vDC and it threw a check engine light because it knew the voltage shouldn't be that high



    StefanL38 said...

    About the oscilloscope
    you always have to connect the ground-clamp with ground and connect the probe to what you want to measure

    if the ground-clamp is not connected the probe measures "everything in the air"

    As an easy test you could measure a propeller-IO-pin that is switched on/off

    ground-clamp of oscilloscope---> propeller-ground
    probe ---> propeller-IO-Pin

    As it is not clear how the pressure-sensor works it makes no sense to talk about interface-circuits to the propeller-chip

    It seems to get difficult somehow. More analysing how the pressure-sensor works
    trying to find out what is the impedance of the pressure-sensor etc.

    At this point I like to ask Is it worth the effort for you ?
    Applyling a simulated voltage to a ECU is not a self-purpose. What want you to do in the end ?



    best regards

    Stefan


    I will try that with my propeller chip. Is there any way to have the propeller change voltage outputs on a pin, depending on which switch I press (providing a ground to an input pin)?

    That way I could see some code for voltage output and I could try and use my oscilloscope and see if it is working properly.

    The end goal is to simulate this circuit in case it starts failing when I modify the car. It is definitely worth it to me, thank you so much for your help and diligence.

    As a reference, here is how I tested the sensors voltage values.


    sensorpintest1.jpg

    Post Edited (turbosupra) : 10/17/2009 6:48:30 PM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-10-17 21:04
    Hello Turbo,

    OK we go on.

    to test the oscilloscope you can use the code below.

    This is NOT a test for different voltages. But a test if you can configure your oscilloscope

    The code below will switch on/off IO-Pin 14 with a frequency of 15 Hz.
    What kind of propellerboard are you using ?

    If it has LEDs on board you can change the IO-pin-number to one with LED and then you have a visual control
    about the propeller running when you see the LED blink fast.

    To do some further checks with your oscilloscope increase the value of divider up to 2_000_000
    which will make the IO-pin blink faster and faster

    Connect ground-clamp of the oscilloscope to propeller-ground and oscilloscope-probe to the Propeller-IO-Pin

    You should see the voltage jump on/off 0V / 3.3V. If your oscilloscope does that and you can measure
    the frequency and the voltage by reading the oscilloscope-picture you know how to work with that oscilloscope.

    Then you can go further.

    As the pressure-sensor seems to be a CURRENT-sensor we HAVE TO measure the voltage AND the current flowing
    BOTH AT THE SAME TIME. Which requires TWO DMMs or one DMM and the oscilloscope.

    The development will ONLY go on if you measure the CURRENT flowing through the green wire.
    Maybe it is a standard 4mA-20mA-type; maybe not. We have to know how much current when sensor measures athmospheric pressure
    How much current in the different situations engine on/off pump on/off.

    A circuit that simulates a CURRENT-sensor has a COMPLETE DIFFERENT design than a voltage-sensor.

    By measuring voltage and current at the same time we can calculate the resistance R = U / I
    resistance = voltage divided through current (That's the most elemtary physical law that you need in electronics called "Ohm's law")

    If you're not familiar with Ohm's law it's time to learn it RIGHT NOW if your project should be succesful.

    The ECU seems to work like this: The ECU supplies the pressure-sensor with 5V. Depending on the pressure the sensor
    "creates" a CURRENT if the sensor is active. Of course the current causes a voltage-drop when connected to the ECU. That is the voltage that you have
    measured.
    If the sensor is passive the ECU tries to establish a constant current and adjusts the voltage higher and higher
    (up to the limit wich seems to be the measured 4.91V) trying to get the current to the constant "target-value".
    Then the ECU measures the voltage that is nescessary to take the current to the constant value and has then the needed feedback from the sensor


    But you have to measure BOTH ! Voltage and current AT THE SAME TIME ! Measuring voltage change wiring measuring current is NOT precise enough !

    To find out which way the pressure-sensor is working we HAVE TO measure the current !!

    So do it for all situations engine/ pump on/off iand post the results here.

    propeller-code to test the oscilloscope

    CON
      _xinfreq = 5_000_000                      
      _clkmode = xtal1 + pll16x
    
      divider   = 30
      IO_Pin_Nr = 14
    
    PUB IO_Pin_On_Off
    
        dira[noparse][[/noparse]IO_Pin_Nr] := 1
    
        repeat
          outa[noparse][[/noparse]IO_Pin_Nr] := 1
          waitcnt(clkfreq / divider + cnt)
          outa[noparse][[/noparse]IO_Pin_Nr] := 0
          waitcnt(clkfreq / divider + cnt)
    
    



    best regards

    Stefan
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-17 22:50
    Hi ChJ

    To reflect back to you, what I think you are saying ... do you think the ecu measures amperage instead of voltage?

    Can you explain more how that works, or provide links that I might be able to read about this with? I tried googling without much success



    Sapieha said...
    Hi Turbo.


    As I know most of vehicle sensor is Variable CURENT - not Variable voltage sensors.
    If I kan see correct from Yours Data You present .... This sensor is that one.

    For posiblity to functioning with Propeller ... You must build CURENT to Voltage circuity betwen that sensor and Propeller pin.

    !! NOT connect it directly to Propeller (12 to 14V can dead Propeller) !!

    That can give YOU 2 POSIBLITES.
    1. wITH CORRECT adjustment You can sense states 1 else 0.
    2. Use ADC posiblites on Propeller and masure correct presure

    Regards
    ChJ
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-17 23:38
    Hey Stefan,


    StefanL38 said...
    Hello Turbo,

    OK we go on.

    to test the oscilloscope you can use the code below.

    This is NOT a test for different voltages. But a test if you can configure your oscilloscope

    The code below will switch on/off IO-Pin 14 with a frequency of 15 Hz.
    What kind of propellerboard are you using ?

    If it has LEDs on board you can change the IO-pin-number to one with LED and then you have a visual control
    about the propeller running when you see the LED blink fast.

    To do some further checks with your oscilloscope increase the value of divider up to 2_000_000
    which will make the IO-pin blink faster and faster



    I ran your code, my led oscillates really fast, I am using the propeller breadboard that comes un-assembled with the prop education kit and looks like the picture below. When I changed the divider value in either the constants or the public, it kept the LED lit continually (the oscope did not show any fluctuation either)

    32305a-M.jpg



    Here is the log file output from my parallax oscilloscope

    I've also attached the log file, what I don't understand is why there are 1500 entries, when I set it to 250ms and only let it run for 5 seconds (the log file for 10ms is also attached). At 250ms, it should only have 20 lines of logging if I stop it at exactly 5 seconds, correct? Another strange thing is that it took 3 or 4 of those seconds to populate any values on the real time display screen?


    testoscope1.png






    StefanL38 said...

    Connect ground-clamp of the oscilloscope to propeller-ground and oscilloscope-probe to the Propeller-IO-Pin

    You should see the voltage jump on/off 0V / 3.3V. If your oscilloscope does that and you can measure
    the frequency and the voltage by reading the oscilloscope-picture you know how to work with that oscilloscope.

    Then you can go further.

    As the pressure-sensor seems to be a CURRENT-sensor we HAVE TO measure the voltage AND the current flowing
    BOTH AT THE SAME TIME. Which requires TWO DMMs or one DMM and the oscilloscope.


    I may buy another DMM tonight, I'm guessing it needs an amperage function? It's not jumping to 3.3v, but to 0 and .5(3.3v) or ~1.72v.


    StefanL38 said...

    The development will ONLY go on if you measure the CURRENT flowing through the green wire.
    Maybe it is a standard 4mA-20mA-type; maybe not. We have to know how much current when sensor measures athmospheric pressure
    How much current in the different situations engine on/off pump on/off.

    A circuit that simulates a CURRENT-sensor has a COMPLETE DIFFERENT design than a voltage-sensor.

    By measuring voltage and current at the same time we can calculate the resistance R = U / I
    resistance = voltage divided through current (That's the most elemtary physical law that you need in electronics called "Ohm's law")

    If you're not familiar with Ohm's law it's time to learn it RIGHT NOW if your project should be succesful.

    I am familiar with Ohm's law, but I will reread it just to be sure it's all fresh.

    Do you think I can test the sensor off of the car, with a 5v regulator, a breadboard and a few wires, supply 5vdc to at least the yellow wire, if not yellow and green and measure that way? It's easier on a bench the on the car of course.

    StefanL38 said...

    The ECU seems to work like this: The ECU supplies the pressure-sensor with 5V. Depending on the pressure the sensor
    "creates" a CURRENT if the sensor is active. Of course the current causes a voltage-drop when connected to the ECU. That is the voltage that you have
    measured.
    If the sensor is passive the ECU tries to establish a constant current and adjusts the voltage higher and higher
    (up to the limit wich seems to be the measured 4.91V) trying to get the current to the constant "target-value".
    Then the ECU measures the voltage that is nescessary to take the current to the constant value and has then the needed feedback from the sensor


    But you have to measure BOTH ! Voltage and current AT THE SAME TIME ! Measuring voltage change wiring measuring current is NOT precise enough !

    To find out which way the pressure-sensor is working we HAVE TO measure the current !!

    So do it for all situations engine/ pump on/off iand post the results here.

    propeller-code to test the oscilloscope

    CON
      _xinfreq = 5_000_000                      
      _clkmode = xtal1 + pll16x
    
      divider   = 30
      IO_Pin_Nr = 14
    
    PUB IO_Pin_On_Off
    
        dira[noparse][[/noparse]IO_Pin_Nr] := 1
    
        repeat
          outa[noparse][[/noparse]IO_Pin_Nr] := 1
          waitcnt(clkfreq / divider + cnt)
          outa[noparse][[/noparse]IO_Pin_Nr] := 0
          waitcnt(clkfreq / divider + cnt)
    
    



    best regards

    Stefan


    What should I be seeing when I alter the divider value? Should the led be constantly lit, without fluctuation when I set it to 2_000_000 ? I tried to search the net to read up on how Denso pressure sensors worked, but didn't find anything?
  • turbosupraturbosupra Posts: 1,088
    edited 2009-10-18 02:52
    Stefan,

    I hooked up 1 multimeter with the negative probe to the ground of the sensor and the positive probe to the green/ecu feedback wire and I hooked the other multimeter up with the negative probe to the sensor side for measuring current and the positive probe to the harness side for measuring current. See the diagram below for a visual representation.

    Here's the video if you want to see it

    www.youtube.com/watch?v=PHlWsLfkKuk


    voltagecurrentmeasureme.jpg




    I was not able to measure current with the DMM on setting

    dmmsetting1.jpg




    Also, I was only able to use the DMM to measure current when I had it set to the setting pictured below? Did I do that properly? When I had it sent to any other setting, but the one pictured below, it would act as if the circuit was completely disconnected/open?

    dmmsetting2.jpg
Sign In or Register to comment.