Go Down

Topic: Interfacing to circuit which grounds the input (Read 1 time) previous topic - next topic

dc42

While you are leaving the fan connected as well, just connect the ECU output to the Arduino input through a 10K resistor. The fan controller already has a pullup resistor in it. The 10K resistor is to protect the Arduino in case the voltages are a bit different.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

tocpcs

#6
Jan 19, 2013, 07:42 am Last Edit: Jan 19, 2013, 07:44 am by tocpcs Reason: 1
I monitored the output and tested some knowns. When I run the A/C compressor this runs the fans at 50% from previous tests.

I tried to monitor the PWM signal using this line:
 value = pulseIn(pulsepin, HIGH, 1000000);

I got values such as 229, or 99.
What happens tho is when I turn the A/C compressor on, it reads 0!
Not believing that - I metered it and saw 4.9V.

I need a way of doing it such that I can differentiate between line idling high, and line remaining low and allowed to go high.
I know that when the fans are not needed, the wire reads 0V (so I think the ECU continually drives it to 0V when it wants no fan - which makes sense, wiring harness gets damaged then it should remain '5V'...

I like '1' better - any thoughts on a circuit for that design (i.e. smooth the pwm to a voltage and feed to analog in).. This would give me great proportional control.

dc42

Instead of using pulseIn, do a number of digitalRead calls at regular intervals over a period much larger than the PWM period, and compute the ratio of HIGH reading to total readings.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

tocpcs

What I'm concerned about is if the frequency is too fast, then I won't catch the transition I need to.
i.e. if I loop 20 times, reading the pin and for those 20 times I read that the input is low, but what happens is between the read for read 2, and read 3, it transitions and back again i'll potentially miss it?

How do I know what PWM period is to read 'larger' than it?
I think PWM period is a important bit of info - i.e. if the PWM signal was 10%, and the period was 10 seconds, the first 1 second would be low. I don't know what that PWM period is.

dc42

You could connect the input to one of the pins that supports attachInterrupt, set the interrupt mode to CHANGE, and time the low and high periods in the ISR. If you find that you haven't received any interrupts recently, then just read whether the pin is high or low.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up