about amperage-circuits
google for powersupply with adjustable current-limitation
about the oscilloscope:
did you measure ground-clamp on propeller-ground, probe DIRECTLY on the propeller-IO-PIN
or did you measure "across" the LED ?
If you measured "across" the LED 1.72V seems to be correct.
If you measured propeller-ground and DIRECTLY nearest to the propeller-IO-Pin
it is not correct then you should see 0V, 3,3V
The timing measurement seems to be correct. I don't care about how many samples per second it does
If the timeperiod of the signal matches with the frequency I expect it is OK for me.
maybe you set the divider to 40 to get 20Hz. then the timeperiod is 50 milliseconds so four periods should fit exactly between two dotted lines on the oscilloscope at 200msecs/DIV
With a divider-value 30 the LED blinks with 15 Hz
with a divider of 10 the LED blinks with 5Hz
with a divider of 20 the LED blinks with 10Hz
with a divider of 40 the LED blinks with 20Hz
with a divider of 80 the LED blinks with 40Hz which you can't see anymore but your oscilloscope
etc. ezc.
oops a divider of 2_000_000 is too high
with a divider of 200_000 the LED blinks with 100.000Hz which you can't see anymore but your oscilloscope
About measuring current:
the circuit you posted is correct. But the grey DMM has NO CURRENT-measuring feature
The symbols mean:
one above OFF: DC-voltage
two above OFF: AC-voltage
three above OFF: resistance
four above OFF: beeping when contact is there
five above OFF: (the diode-symbol) measure if current can flow and show voltage-drop across the black and red probe)
the yellow DMM has a current-measuring feature
there are two additions red "whole" named with "mA" and "10A" for current-measuring you have to use these
ATTENTION the "mA" function has a fuse inside of the DMM. If you measure too much current the fuse will blow to protect the DMM
then you have to replace the fuse before you can measure again.
For basic tests you can put the pressure-sensor on a bench and supply it with 5V.
ATTENTION Don't use a cheap "wal-mart" a cheap wal-mart outputs more than 5V at low currents !
The supply has to be STABILIZED to exactly 5.0V and has to deliver the amount of current the sensor needs
For further tests you need the real pressure-values from your car.
best regards
Stefan
Post Edited (StefanL38) : 10/18/2009 6:34:21 AM GMT
I have no had a chance to pull the sensor off of the car, but I think this is a better measurement anyway, so I'll wait to do that until I hear further from you.
As for my oscope, I measured voltage on the pin side of the led circuit, so it looked like this
pin ---> oscope ---> anode of led ---> led itself ---> cathode ---> ground
I still received the measurements that I attached in the log file. I will try it without the led if you'd like, do I still need to give that pin a path to ground through a resistor? I'll wait to hear from you on that, before I try that experiment too.
Thanks so much!
StefanL38 said...
Hello TurboSupra,
about amperage-circuits
google for powersupply with adjustable current-limitation
about the oscilloscope:
did you measure ground-clamp on propeller-ground, probe DIRECTLY on the propeller-IO-PIN
or did you measure "across" the LED ?
If you measured "across" the LED 1.72V seems to be correct.
If you measured propeller-ground and DIRECTLY nearest to the propeller-IO-Pin
it is not correct then you should see 0V, 3,3V
The timing measurement seems to be correct. I don't care about how many samples per second it does
If the timeperiod of the signal matches with the frequency I expect it is OK for me.
maybe you set the divider to 40 to get 20Hz. then the timeperiod is 50 milliseconds so four periods should fit exactly between two dotted lines on the oscilloscope at 200msecs/DIV
With a divider-value 30 the LED blinks with 15 Hz
with a divider of 10 the LED blinks with 5Hz
with a divider of 20 the LED blinks with 10Hz
with a divider of 40 the LED blinks with 20Hz
with a divider of 80 the LED blinks with 40Hz which you can't see anymore but your oscilloscope
etc. ezc.
oops a divider of 2_000_000 is too high
with a divider of 200_000 the LED blinks with 100.000Hz which you can't see anymore but your oscilloscope
About measuring current:
the circuit you posted is correct. But the grey DMM has NO CURRENT-measuring feature
The symbols mean:
one above OFF: DC-voltage
two above OFF: AC-voltage
three above OFF: resistance
four above OFF: beeping when contact is there
five above OFF: (the diode-symbol) measure if current can flow and show voltage-drop across the black and red probe)
the yellow DMM has a current-measuring feature
there are two additions red "whole" named with "mA" and "10A" for current-measuring you have to use these
ATTENTION the "mA" function has a fuse inside of the DMM. If you measure too much current the fuse will blow to protect the DMM
then you have to replace the fuse before you can measure again.
For basic tests you can put the pressure-sensor on a bench and supply it with 5V.
ATTENTION Don't use a cheap "wal-mart" a cheap wal-mart outputs more than 5V at low currents !
The supply has to be STABILIZED to exactly 5.0V and has to deliver the amount of current the sensor needs
For further tests you need the real pressure-values from your car.
best regards
Stefan
Post Edited (turbosupra) : 10/18/2009 9:15:00 PM GMT
OK I understand why you measure just 1.72V. The propeller-chip is supplied by 3.3V
If you disconnect the LED you will measure 3.3V. If connect the LED without a current-limiting resistor the voltage breaks down
to the forward-voltage of the LED. You pulled a lot of current out of the IO-Pin. LEDs can be overdriven for some time and shine really bright.
If the current is over the nominal current of the LED the voltage will be a little bit above the forward-voltage.
Depending on the nominal LED current you need a current-limiting resistor.
Standard LEDs have a forward-voltage around 1.5V 20 mA. So if you want to drive such an LED with 3.3V you need a resistor
of R = (3.3 - 1.5) / 0.02A = 90 Ohm. Next available value 100 Ohm.
If it is a low current-LED of 2mA you need a resistor of R = (3.3 - 1.5) / 0.002A = 900 Ohm.
17 microampere is a quite low current. With this low current I don't believe that the pressure-sensor is a "current-sensor"
Can you measure the current with the 200 microampere-position.
In the 20 mA-position you get a value of 0.02 which is close to zero and for this unprecise.
The resistance is 1.8V / 0.00000172A = 104.651 Ohm. Around 100kOhm.
I guess but I do not know for sure it is a voltage sensor.
Somehow it get's like CSI to find out how this sensor works (Or maybe my knowledge about electronics is not good enough.
OK. Please measure the voltage between brown wire (ground) and green wire of the pressure sensor while the brown wire (ground)
and the yellow wire (+5V) are STILL connected to the ECU.
I measured the sensor off of the car, and here are the results.
The picture at the bottom is also a photograph of the setting I chose on the DMM. With the 200m setting (and the 20m/10A as well), I still did not have the resolution to measure, but when I put it on 200µ, I was able to get the results in the chart below.
200 µA current is 0.2 mA or .0002A, from a little research, so if I understand that correctly, these values are 0.000093 - 0.000031 amps?
I tested it without the resistor and led, and it gave the following (see the txt attachment testoscope5.txt) ~3.3v
With the resistor, it gave the following measurements (see the txt attachment testoscope4.txt) 2.97v
Here is the current test, I don't think it's a current sensor, as there was very little change, but I'll let you be the final judge on thatthe grey DMM was measuring the voltage output of the green wire. The yellow DMM was measuring current at the micro milliamp ( 200µ ) setting and it showed from 16.5 to 18.8 micro milliamps or µA (if micro milliamps is the correct terminology?).
OK so the pressure-sensor seems to be a voltage-sensor
If you measured the pressure-sensor outside the car the current you measured is the current flowing through the DMM
example: 3.0V / 5.9 µA = 508kOhms. This is the inner resistance of the DMM. As there was nothing else then the DMM
between green wire and brown wire
The oscillioscope seems to be OK too.
Do several measurings with the oscilloscope
pressure-sensor connected to car
ground-clamp of osci-probe connected to the brown wire
probe of the osci connected to green wire
measure with different timebases
5000 milliseconds/DIV
2000 milliseconds/DIV
1000 milliseconds/DIV
500 milliseconds/DIV
100 milliseconds/DIV
50 milliseconds/DIV
10 milliseconds/DIV
to see how the voltage might go up and down through the start of the engine
What I still not know what is the air-pump doing. Where does the pressured air go to ?
What happens if the pressure-sensor is disconnected and you try to start the car ?
As you want the propeller to simulate the pressure-sensor I would like to know
how exact the simulation has to be.
To create a voltage-signal you can create a PWM-signal on a propeller-pin and then
the signal will be transformed into a analog voltage by a R-C-circuit connected to an OP-Amp
voltage-follower with another capacitor between output of the OP-Amp and ground.
The capacitors "flatens" the ON/OFF rectangle PWM-signal to an averaged voltage.
You should measure how big the ripple-voltage is at the output of the OP-Amp
osci measuring AC (not DC) to get a higher solution
For the voltage measurements, the pump only kicks on when the car is dead cold and hasn't been started in a while, so it might take me a while to get 10, 50, 100, 500, 1000, 2000 and 5000 measurements. The other thing about this oscope is that parallax says
parallax engineers and tech support said...
"is not designed to take samples over large periods of time, as you need"
when I asked them how I could record over a 90 second time window. To me that almost makes this thing useless, especially since it fills all 1500 lines of logging no matter what, but I don't know, maybe there is a work around?
Which capacitor and resistance values would you use? 10k and .1uf? Which op-amp do you like for this project? I'll get an oscope of the op amp as soon as that part of the breadboard circuit is done [noparse]:)[/noparse]
The air pump helps with cold starts, a check engine light is triggered if the voltage values it detects are not within the voltage values it sees. I do not need this item for starting. If it's disconnected, it does not cause any harm to the vehicle, it starts and runs fine, just trips a check engine light.
Thanks for all of your time and help!
StefanL38 said...
Hello Turbo,
OK so the pressure-sensor seems to be a voltage-sensor
If you measured the pressure-sensor outside the car the current you measured is the current flowing through the DMM
example: 3.0V / 5.9 µA = 508kOhms. This is the inner resistance of the DMM. As there was nothing else then the DMM
between green wire and brown wire
The oscillioscope seems to be OK too.
Do several measurings with the oscilloscope
pressure-sensor connected to car
ground-clamp of osci-probe connected to the brown wire
probe of the osci connected to green wire
measure with different timebases
5000 milliseconds/DIV
2000 milliseconds/DIV
1000 milliseconds/DIV
500 milliseconds/DIV
100 milliseconds/DIV
50 milliseconds/DIV
10 milliseconds/DIV
to see how the voltage might go up and down through the start of the engine
What I still not know what is the air-pump doing. Where does the pressured air go to ?
What happens if the pressure-sensor is disconnected and you try to start the car ?
As you want the propeller to simulate the pressure-sensor I would like to know
how exact the simulation has to be.
To create a voltage-signal you can create a PWM-signal on a propeller-pin and then
the signal will be transformed into a analog voltage by a R-C-circuit connected to an OP-Amp
voltage-follower with another capacitor between output of the OP-Amp and ground.
The capacitors "flatens" the ON/OFF rectangle PWM-signal to an averaged voltage.
You should measure how big the ripple-voltage is at the output of the OP-Amp
osci measuring AC (not DC) to get a higher solution
so what is the slowest time/DIV-rate you can choose ?
It's only that I'm curiuos about the voltage jumping between 1,4V and 1,6V
One workaround could be to use Autohotkey
This is a tool which you can make sending keystrokes and mous-clicks to ANY application
The software can store measured values to textfiles. So one method could be write a autohotkey-script
to store the values to a textfile and repeat this again and again.
Hey if I remember right you worked with AutoIt which I think of is similar to Autohotkey
If AutoIt can send keystrokes and mouseclicks to definded GUI-controls or positions on the screen
AutoIt can do it too.
About OP-amps:
For this application we don't need a super high-perfomance OP-Amp.
I prefer the LM358. There are two OP-Amps inside a 8-DIP-package.
And the specs are a little bit better than the LM324 which has 4 OP-Amps in a 14-DIP-package.
They should be supplied by 5V
I think the values can vary. For optimizing I would have to do tests too. 10kOhm and 1µF will do for the inputside of the OP-Amp
at the outputside try 1µF, 10µF and 100µF to see on which value the ripple-voltage will go down to 50 millivolts or something like that.
Here is part of the information you asked for. I can log the 1.4-1.6v scenario in a few minutes, as that happens continually after the car is warmed up, it's the part before that, that would take me a long time to gather on each cold start.
I am looking into writing an app that logs much better than the software that the parallax oscilloscope comes with, but I'm sure it'll be some time before I can figure out how they are reading the streaming oscope date from the usb port.
Once we get some code together, I'll look into flattening the voltage with the hardware components you suggested.
In this post are the first 5 values that I took measurements with on the oscope, 1ms, 2ms, 5ms, 10ms and 20ms. Since there are only 5 attachments per post, I'll reply again with the remaining attachments/log files.
Thanks!
StefanL38 said...
Hello Turbo,
so what is the slowest time/DIV-rate you can choose ?
It's only that I'm curiuos about the voltage jumping between 1,4V and 1,6V
One workaround could be to use Autohotkey
This is a tool which you can make sending keystrokes and mous-clicks to ANY application
The software can store measured values to textfiles. So one method could be write a autohotkey-script
to store the values to a textfile and repeat this again and again.
Hey if I remember right you worked with AutoIt which I think of is similar to Autohotkey
If AutoIt can send keystrokes and mouseclicks to definded GUI-controls or positions on the screen
AutoIt can do it too.
About OP-amps:
For this application we don't need a super high-perfomance OP-Amp.
I prefer the LM358. There are two OP-Amps inside a 8-DIP-package.
And the specs are a little bit better than the LM324 which has 4 OP-Amps in a 14-DIP-package.
They should be supplied by 5V
I think the values can vary. For optimizing I would have to do tests too. 10kOhm and 1µF will do for the inputside of the OP-Amp
at the outputside try 1µF, 10µF and 100µF to see on which value the ripple-voltage will go down to 50 millivolts or something like that.
I took a look into the measuring three files of slow middle and fast measuring to get an overview.
It seems that the jumpings of the values between value 1.48 and 1.56 are random.
I couldn't see a pattern in it.
If it takes so much effort to get these values start motor when cold) measure once. stop motor wait for an hour until motor is cold again
it is not worth to do it except you have a lot of fun to do so.
It is NOT nescessary to measure more values to develop the simulation circuit.
From the values above I can see the value stays on one value with this small deviation of 0.08V
So next thing to do is to build the DAC with the OP-AMp voltage-follower.
Se attached pictures.
To get familiar with this kind of circuit you can play around with the values
R going down to 100 Ohm and stepwise going up to 1MegaOhm,
C on inputside going down to 1pico-farrad and up to 1000µF
C on outputside going down to 1 nanofarrad and up to 1000µF
On the Inputside this will change the reaction-time how fast a new voltage-value will be reached if you switch between a low voltage (small PWM-duty-cycle)
and a high voltage (big PWM-duty-cycle)
bigger capacitors on the outputside result in a smaller ripple-voltage but there are saturational effects
Another thing to analyse is how will the ripple-voltage go up again if you connect a load to the output with a low resistance = big current
All these analysing is for you to learn more about electronics.
From a point of view like "hurry up to get that thing running !" you could use the values I suggested and you are done.
I am going to play with those resistor and capacitor values!
Since I am not familiar with the lm358 (this may be a dumb question) but which lm358 should I use? The LM358P Dual Operation Amplifier (TI), LM358N Low Power Dual Operational Amplifier (ST), LM358AN Low Power Dual Operational Amplifier (National), LM358A SMD Low Power Dual Op Amp (Phillips) or the LM358 SMD Dual Operational Amplifier?
I'll order some today online. Thanks Stefan!
StefanL38 said...
Hello Turbo,
I took a look into the measuring three files of slow middle and fast measuring to get an overview.
It seems that the jumpings of the values between value 1.48 and 1.56 are random.
I couldn't see a pattern in it.
If it takes so much effort to get these values start motor when cold) measure once. stop motor wait for an hour until motor is cold again
it is not worth to do it except you have a lot of fun to do so.
It is NOT nescessary to measure more values to develop the simulation circuit.
From the values above I can see the value stays on one value with this small deviation of 0.08V
So next thing to do is to build the DAC with the OP-AMp voltage-follower.
Se attached pictures.
To get familiar with this kind of circuit you can play around with the values
R going down to 100 Ohm and stepwise going up to 1MegaOhm,
C on inputside going down to 1pico-farrad and up to 1000µF
C on outputside going down to 1 nanofarrad and up to 1000µF
On the Inputside this will change the reaction-time how fast a new voltage-value will be reached if you switch between a low voltage (small PWM-duty-cycle)
and a high voltage (big PWM-duty-cycle)
bigger capacitors on the outputside result in a smaller ripple-voltage but there are saturational effects
Another thing to analyse is how will the ripple-voltage go up again if you connect a load to the output with a low resistance = big current
All these analysing is for you to learn more about electronics.
From a point of view like "hurry up to get that thing running !" you could use the values I suggested and you are done.
they vary in their specifications. But as this is no high-perfomance-application it doesn't matter.
If I rethink about it - as you would like to use it in your car you should use one for a bigger temperature range -40°C up to 85°C.
This type has number LM2904
For first experiments on the bench it doesn't matters at all. Except you should take a 8-DIP housing.
SMD, QFP or what ever else have too small distances between the pins and are not usable with breadboard at all
Order some professional DIP-sockets too. (See the attached picture. These IC-pins are so easy to bend and break in breadboards
Hope you did not order already SMD-parts. Or take it as a solder-andventure to solder a SMD-chip.
I did not order yet, I decided to wait for your response and am glad that I did [noparse]:)[/noparse]
Do you have some code that I can play around with on this, once it's built, I'm going to try and source the parts locally tonight.
StefanL38 said...
Hello Turbo,
they vary in their specifications. But as this is no high-perfomance-application it doesn't matter.
If I rethink about it - as you would like to use it in your car you should use one for a bigger temperature range -40°C up to 85°C.
This type has number LM2904
For first experiments on the bench it doesn't matters at all. Except you should take a 8-DIP housing.
SMD, QFP or what ever else have too small distances between the pins and are not usable with breadboard at all
Order some professional DIP-sockets too. (See the attached picture. These IC-pins are so easy to bend and break in breadboards
Hope you did not order already SMD-parts. Or take it as a solder-andventure to solder a SMD-chip.
Here is a simple demo that does all the pwm complete in software .
It will slowly increase the on-time of the PWM-signal. Watch the PWM-signal with the oscilloscope.
For the PWM-signal you need no additional components.
The additional components RC and Op-Amp transform the 0V/3.3V Signal into an "always on" analog voltage
CON
_xinfreq = 5_000_000
_clkmode = xtal1 + pll16x
IO_Pin_Nr = 4
MinimumDelay = 385 'needed to wait minimum time that the SPIN-overhead needs to reach PASM-waitcnt-command (385 clockticks)
PWM_Freq = 100
VAR
long Duty
long period
long DelayOn
long DelayOff
long IncSpeed
PUB Simple_PWM_Demo 'realised completely with software
dira[noparse][[/noparse]IO_Pin_Nr] := 1
period := ClkFreq / PWM_Freq 'number of Clockticks to get a PWM-frequency of PWM_Freq Hz
IncSpeed := 100 * (PWM_Freq / 100)
if IncSpeed =< 0
IncSpeed := 100
repeat
repeat Duty from 0 to 100
DelayOn := MinimumDelay + Period * Duty / 100
DelayOff := MinimumDelay + Period * (100 - Duty) / 100
repeat IncSpeed 'repeat to delay increasing of duty-time
outa[noparse][[/noparse]IO_Pin_Nr] := 1
waitcnt(DelayOn + cnt)
outa[noparse][[/noparse]IO_Pin_Nr] := 0
waitcnt(DelayOff + cnt)
If you increase PWM_Freq the minimum-delay will be more and more that you can't reach 100% ontime
If you use the counter-module it is possible to get any ontime-percentage from 0% to 100%
You can read how the counters work in the PE Kit Labs fundamentals (one Option of the help-item in the propellertool main-menu
I did not look at all the details of the discussion you had with Stefan....great stuff from Stefan.......
But from what I understand the hardest thing that you might encounter in doing the code is to get
the DAC and RPM counter to work.
So I made a simple Demo for you to look at that allows you to set a desired voltage level
using the DUTY mode of the counters in the Propeller (as I explained in earlier postings)
Also the same code allows you to monitor an oscillating signal on another pin and it will report
to you the RPM count (actually RPS).
The method DAC_And_RPM_Counter() can be used as a tool if you need to. The Main program
demonstrates how to use the method and uses the FullDuplexSerial object to communicate
with the Propeller Serial Terminal. We use the PST so that you can enter values to set the DAC
and to see the RPM count easily.
You can measure the DAC output using DMM (voltmeter).
To put an oscillating signal you can use a Square Wave or SineWave generator but MAKE SURE that it goes 0 to 3.3 V (no negative or > 3.3) The Propeller pins cannot accept negative
voltages nor > 3.3V.
A lot less troublesome way to create an RPM without too much equipment is to use a normally
open Push Button with a Pull-Up or Pull-Down resistor. Then that way you can just push the
button a few times while entering the DAC value into the PST and once the DAC value is
sent to the Propeller it will show you the RPM count too....
Remember the use of the PST and FullDuplexSerial are ONLY FOR DEMO PURPOSES.....the main
thing that you need to STUDY WELL is the DAC_And_RPM_Counter() method.
The attached ARCHIVE file has all the source code you need. The program is VERY WELL commented
so you should find it easy to follow.
As you saw in the Pseudo code I posted earlier...the most important parts are the DAC generator
and the RPM counters and the DAC_And_RPM_Counter() method shows how to do this. The other
parts of the pseudo code can be accomplished with jut Ina[noparse][[/noparse]...] or Outa[noparse][[/noparse]...] statements and some
if-else or repeat loops.
Comments
about amperage-circuits
google for powersupply with adjustable current-limitation
about the oscilloscope:
did you measure ground-clamp on propeller-ground, probe DIRECTLY on the propeller-IO-PIN
or did you measure "across" the LED ?
If you measured "across" the LED 1.72V seems to be correct.
If you measured propeller-ground and DIRECTLY nearest to the propeller-IO-Pin
it is not correct then you should see 0V, 3,3V
The timing measurement seems to be correct. I don't care about how many samples per second it does
If the timeperiod of the signal matches with the frequency I expect it is OK for me.
maybe you set the divider to 40 to get 20Hz. then the timeperiod is 50 milliseconds so four periods should fit exactly between two dotted lines on the oscilloscope at 200msecs/DIV
With a divider-value 30 the LED blinks with 15 Hz
with a divider of 10 the LED blinks with 5Hz
with a divider of 20 the LED blinks with 10Hz
with a divider of 40 the LED blinks with 20Hz
with a divider of 80 the LED blinks with 40Hz which you can't see anymore but your oscilloscope
etc. ezc.
oops a divider of 2_000_000 is too high
with a divider of 200_000 the LED blinks with 100.000Hz which you can't see anymore but your oscilloscope
About measuring current:
the circuit you posted is correct. But the grey DMM has NO CURRENT-measuring feature
The symbols mean:
one above OFF: DC-voltage
two above OFF: AC-voltage
three above OFF: resistance
four above OFF: beeping when contact is there
five above OFF: (the diode-symbol) measure if current can flow and show voltage-drop across the black and red probe)
the yellow DMM has a current-measuring feature
there are two additions red "whole" named with "mA" and "10A" for current-measuring you have to use these
ATTENTION the "mA" function has a fuse inside of the DMM. If you measure too much current the fuse will blow to protect the DMM
then you have to replace the fuse before you can measure again.
For basic tests you can put the pressure-sensor on a bench and supply it with 5V.
ATTENTION Don't use a cheap "wal-mart" a cheap wal-mart outputs more than 5V at low currents !
The supply has to be STABILIZED to exactly 5.0V and has to deliver the amount of current the sensor needs
For further tests you need the real pressure-values from your car.
best regards
Stefan
Post Edited (StefanL38) : 10/18/2009 6:34:21 AM GMT
Ok, here are the two videos, one using the 10A current measurement setting and the other using the mA setting.
When I used the 10amp current measurement setting, it didn't register anything on the setting.
www.youtube.com/watch?v=hTYMCtsktE8
When I used the mA current measurement setting, it registered .2 and sometimes .1, but mostly .2
www.youtube.com/watch?v=toudh3is9wA
Let me know if this is what you need.
I have no had a chance to pull the sensor off of the car, but I think this is a better measurement anyway, so I'll wait to do that until I hear further from you.
As for my oscope, I measured voltage on the pin side of the led circuit, so it looked like this
pin ---> oscope ---> anode of led ---> led itself ---> cathode ---> ground
I still received the measurements that I attached in the log file. I will try it without the led if you'd like, do I still need to give that pin a path to ground through a resistor? I'll wait to hear from you on that, before I try that experiment too.
Thanks so much!
Post Edited (turbosupra) : 10/18/2009 9:15:00 PM GMT
OK I understand why you measure just 1.72V. The propeller-chip is supplied by 3.3V
If you disconnect the LED you will measure 3.3V. If connect the LED without a current-limiting resistor the voltage breaks down
to the forward-voltage of the LED. You pulled a lot of current out of the IO-Pin. LEDs can be overdriven for some time and shine really bright.
If the current is over the nominal current of the LED the voltage will be a little bit above the forward-voltage.
Depending on the nominal LED current you need a current-limiting resistor.
Standard LEDs have a forward-voltage around 1.5V 20 mA. So if you want to drive such an LED with 3.3V you need a resistor
of R = (3.3 - 1.5) / 0.02A = 90 Ohm. Next available value 100 Ohm.
If it is a low current-LED of 2mA you need a resistor of R = (3.3 - 1.5) / 0.002A = 900 Ohm.
17 microampere is a quite low current. With this low current I don't believe that the pressure-sensor is a "current-sensor"
Can you measure the current with the 200 microampere-position.
In the 20 mA-position you get a value of 0.02 which is close to zero and for this unprecise.
The resistance is 1.8V / 0.00000172A = 104.651 Ohm. Around 100kOhm.
I guess but I do not know for sure it is a voltage sensor.
Somehow it get's like CSI to find out how this sensor works (Or maybe my knowledge about electronics is not good enough.
OK. Please measure the voltage between brown wire (ground) and green wire of the pressure sensor while the brown wire (ground)
and the yellow wire (+5V) are STILL connected to the ECU.
best regards
Stefan
I measured the sensor off of the car, and here are the results.
The picture at the bottom is also a photograph of the setting I chose on the DMM. With the 200m setting (and the 20m/10A as well), I still did not have the resolution to measure, but when I put it on 200µ, I was able to get the results in the chart below.
200 µA current is 0.2 mA or .0002A, from a little research, so if I understand that correctly, these values are 0.000093 - 0.000031 amps?
I tested it without the resistor and led, and it gave the following (see the txt attachment testoscope5.txt) ~3.3v
With the resistor, it gave the following measurements (see the txt attachment testoscope4.txt) 2.97v
Here is the current test, I don't think it's a current sensor, as there was very little change, but I'll let you be the final judge on thatthe grey DMM was measuring the voltage output of the green wire. The yellow DMM was measuring current at the micro milliamp ( 200µ ) setting and it showed from 16.5 to 18.8 micro milliamps or µA (if micro milliamps is the correct terminology?).
www.youtube.com/watch?v=1Cd9xskKQXo
OK so the pressure-sensor seems to be a voltage-sensor
If you measured the pressure-sensor outside the car the current you measured is the current flowing through the DMM
example: 3.0V / 5.9 µA = 508kOhms. This is the inner resistance of the DMM. As there was nothing else then the DMM
between green wire and brown wire
The oscillioscope seems to be OK too.
Do several measurings with the oscilloscope
pressure-sensor connected to car
ground-clamp of osci-probe connected to the brown wire
probe of the osci connected to green wire
measure with different timebases
5000 milliseconds/DIV
2000 milliseconds/DIV
1000 milliseconds/DIV
500 milliseconds/DIV
100 milliseconds/DIV
50 milliseconds/DIV
10 milliseconds/DIV
to see how the voltage might go up and down through the start of the engine
What I still not know what is the air-pump doing. Where does the pressured air go to ?
What happens if the pressure-sensor is disconnected and you try to start the car ?
As you want the propeller to simulate the pressure-sensor I would like to know
how exact the simulation has to be.
To create a voltage-signal you can create a PWM-signal on a propeller-pin and then
the signal will be transformed into a analog voltage by a R-C-circuit connected to an OP-Amp
voltage-follower with another capacitor between output of the OP-Amp and ground.
The capacitors "flatens" the ON/OFF rectangle PWM-signal to an averaged voltage.
You should measure how big the ripple-voltage is at the output of the OP-Amp
osci measuring AC (not DC) to get a higher solution
best regards
Stefan
For the voltage measurements, the pump only kicks on when the car is dead cold and hasn't been started in a while, so it might take me a while to get 10, 50, 100, 500, 1000, 2000 and 5000 measurements. The other thing about this oscope is that parallax says
when I asked them how I could record over a 90 second time window. To me that almost makes this thing useless, especially since it fills all 1500 lines of logging no matter what, but I don't know, maybe there is a work around?
Which capacitor and resistance values would you use? 10k and .1uf? Which op-amp do you like for this project? I'll get an oscope of the op amp as soon as that part of the breadboard circuit is done [noparse]:)[/noparse]
The air pump helps with cold starts, a check engine light is triggered if the voltage values it detects are not within the voltage values it sees. I do not need this item for starting. If it's disconnected, it does not cause any harm to the vehicle, it starts and runs fine, just trips a check engine light.
Thanks for all of your time and help!
so what is the slowest time/DIV-rate you can choose ?
It's only that I'm curiuos about the voltage jumping between 1,4V and 1,6V
One workaround could be to use Autohotkey
This is a tool which you can make sending keystrokes and mous-clicks to ANY application
The software can store measured values to textfiles. So one method could be write a autohotkey-script
to store the values to a textfile and repeat this again and again.
Hey if I remember right you worked with AutoIt which I think of is similar to Autohotkey
If AutoIt can send keystrokes and mouseclicks to definded GUI-controls or positions on the screen
AutoIt can do it too.
About OP-amps:
For this application we don't need a super high-perfomance OP-Amp.
I prefer the LM358. There are two OP-Amps inside a 8-DIP-package.
And the specs are a little bit better than the LM324 which has 4 OP-Amps in a 14-DIP-package.
They should be supplied by 5V
I think the values can vary. For optimizing I would have to do tests too. 10kOhm and 1µF will do for the inputside of the OP-Amp
at the outputside try 1µF, 10µF and 100µF to see on which value the ripple-voltage will go down to 50 millivolts or something like that.
best regards
Stefan
Here is part of the information you asked for. I can log the 1.4-1.6v scenario in a few minutes, as that happens continually after the car is warmed up, it's the part before that, that would take me a long time to gather on each cold start.
I am looking into writing an app that logs much better than the software that the parallax oscilloscope comes with, but I'm sure it'll be some time before I can figure out how they are reading the streaming oscope date from the usb port.
Once we get some code together, I'll look into flattening the voltage with the hardware components you suggested.
In this post are the first 5 values that I took measurements with on the oscope, 1ms, 2ms, 5ms, 10ms and 20ms. Since there are only 5 attachments per post, I'll reply again with the remaining attachments/log files.
Thanks!
I took a look into the measuring three files of slow middle and fast measuring to get an overview.
It seems that the jumpings of the values between value 1.48 and 1.56 are random.
I couldn't see a pattern in it.
If it takes so much effort to get these values start motor when cold) measure once. stop motor wait for an hour until motor is cold again
it is not worth to do it except you have a lot of fun to do so.
It is NOT nescessary to measure more values to develop the simulation circuit.
From the values above I can see the value stays on one value with this small deviation of 0.08V
So next thing to do is to build the DAC with the OP-AMp voltage-follower.
Se attached pictures.
To get familiar with this kind of circuit you can play around with the values
R going down to 100 Ohm and stepwise going up to 1MegaOhm,
C on inputside going down to 1pico-farrad and up to 1000µF
C on outputside going down to 1 nanofarrad and up to 1000µF
On the Inputside this will change the reaction-time how fast a new voltage-value will be reached if you switch between a low voltage (small PWM-duty-cycle)
and a high voltage (big PWM-duty-cycle)
bigger capacitors on the outputside result in a smaller ripple-voltage but there are saturational effects
Another thing to analyse is how will the ripple-voltage go up again if you connect a load to the output with a low resistance = big current
All these analysing is for you to learn more about electronics.
From a point of view like "hurry up to get that thing running !" you could use the values I suggested and you are done.
best regards
Stefan
I am going to play with those resistor and capacitor values!
Since I am not familiar with the lm358 (this may be a dumb question) but which lm358 should I use? The LM358P Dual Operation Amplifier (TI), LM358N Low Power Dual Operational Amplifier (ST), LM358AN Low Power Dual Operational Amplifier (National), LM358A SMD Low Power Dual Op Amp (Phillips) or the LM358 SMD Dual Operational Amplifier?
I'll order some today online. Thanks Stefan!
they vary in their specifications. But as this is no high-perfomance-application it doesn't matter.
If I rethink about it - as you would like to use it in your car you should use one for a bigger temperature range -40°C up to 85°C.
This type has number LM2904
For first experiments on the bench it doesn't matters at all. Except you should take a 8-DIP housing.
SMD, QFP or what ever else have too small distances between the pins and are not usable with breadboard at all
Order some professional DIP-sockets too. (See the attached picture. These IC-pins are so easy to bend and break in breadboards
Hope you did not order already SMD-parts. Or take it as a solder-andventure to solder a SMD-chip.
best regards
Stefan
I did not order yet, I decided to wait for your response and am glad that I did [noparse]:)[/noparse]
Do you have some code that I can play around with on this, once it's built, I'm going to try and source the parts locally tonight.
It will slowly increase the on-time of the PWM-signal. Watch the PWM-signal with the oscilloscope.
For the PWM-signal you need no additional components.
The additional components RC and Op-Amp transform the 0V/3.3V Signal into an "always on" analog voltage
If you increase PWM_Freq the minimum-delay will be more and more that you can't reach 100% ontime
If you use the counter-module it is possible to get any ontime-percentage from 0% to 100%
You can read how the counters work in the PE Kit Labs fundamentals (one Option of the help-item in the propellertool main-menu
best regards
Stefan
It'll be go time this week and we'll see how it goes!!
I did not look at all the details of the discussion you had with Stefan....great stuff from Stefan.......
But from what I understand the hardest thing that you might encounter in doing the code is to get
the DAC and RPM counter to work.
So I made a simple Demo for you to look at that allows you to set a desired voltage level
using the DUTY mode of the counters in the Propeller (as I explained in earlier postings)
Also the same code allows you to monitor an oscillating signal on another pin and it will report
to you the RPM count (actually RPS).
The method DAC_And_RPM_Counter() can be used as a tool if you need to. The Main program
demonstrates how to use the method and uses the FullDuplexSerial object to communicate
with the Propeller Serial Terminal. We use the PST so that you can enter values to set the DAC
and to see the RPM count easily.
You can measure the DAC output using DMM (voltmeter).
To put an oscillating signal you can use a Square Wave or SineWave generator but MAKE SURE
that it goes 0 to 3.3 V (no negative or > 3.3) The Propeller pins cannot accept negative
voltages nor > 3.3V.
A lot less troublesome way to create an RPM without too much equipment is to use a normally
open Push Button with a Pull-Up or Pull-Down resistor. Then that way you can just push the
button a few times while entering the DAC value into the PST and once the DAC value is
sent to the Propeller it will show you the RPM count too....
Remember the use of the PST and FullDuplexSerial are ONLY FOR DEMO PURPOSES.....the main
thing that you need to STUDY WELL is the DAC_And_RPM_Counter() method.
The attached ARCHIVE file has all the source code you need. The program is VERY WELL commented
so you should find it easy to follow.
As you saw in the Pseudo code I posted earlier...the most important parts are the DAC generator
and the RPM counters and the DAC_And_RPM_Counter() method shows how to do this. The other
parts of the pseudo code can be accomplished with jut Ina[noparse][[/noparse]...] or Outa[noparse][[/noparse]...] statements and some
if-else or repeat loops.
I hope this helps....
Samuel
·
I just saw this, thanks so much, I will check it out now!