Hi all. This is my first post so excuse my lack of knowledge. I think this would be a fairly simple setup, but I'd like someone to provide some input, good or bad.
I have two ground inputs. These inputs are triggered off a temperature switch.
I need to connect to two PWM output wires
I need to generate three PWM signals, all at 25Hz: One at 5% Duty cycle, one at 15%, and the last at 95%.
The logic should be:
On initial power up, generate a default Duty Cycle of 5% at 25Hz to each of the two output wires.
When the first ground input is active, generate a Duty Cycle of 15% at each output wire.
When the second ground input is active, generate a Duty Cycle of 95% at each output wire.
I am very new to programming language, but based on what I've read in the "Learning" section here, this seems to be quite easy to accomplish.
Thank you for any input.
When you say you have two ground inputs do you mean that the temperature switch connects them to ground at the appropriate temperature? If that is the case, then you can just connect them directly to any digital input pin and set the pin mode to INPUT_PULLUP.
For your PWM, the native analogWrite function doesn't let you change the frequency but you can get a library that will allow you to do it instead.
Correct: At a specified temperature, the switch closes and the wire connected to it is grounded.
This switch actually has 4 pins...two go straight to ground, and the other two are each connected to a temperature switch. Each is effectively grounded when the respective switch is closed. One switch closes at 95C, and the other at about 100C.
Why do you think that a single PWM output is not sufficient?
DrDiettrich:
Why do you think that a single PWM output is not sufficient?
Good question. I thought about that, but I really don't know if both fan controllers (what I'm sending the PWM signal to) can be wired in parallel. It is just a signal going to each controller, and in my limited knowledge of PWM circuits, it shouldn't be affected, but I don't know for sure, so I figured I'd err on the side of caution.
25Hz seems very low for PWM. Perhaps 25KHz?
All fans I have used were not particular about the exact frequency. Try the default Arduino PWM frequency first. It can't hurt to try.
MorganS:
25Hz seems very low for PWM. Perhaps 25KHz?
All fans I have used were not particular about the exact frequency. Try the default Arduino PWM frequency first. It can't hurt to try.
I'll have to double check, but these are the specs right out of the service manual for this vehicle. I'll put a scope on another car and see what's actually going on. Thanks for the suggestion.