Hello all,
I am using an Arduino Nano (Chinese clone)
A 25kg 180 degree 3 wire DC hobby servo
PWM board to control car fan blower motor.
(2) DS18B20 temperature sensors
In my project, which is modified and added code from an original project by member HWHARDSOFT,
I am using a Nextion 7" touch screen with an Arduino Nano clone and 16 channel relay board to control car HVAC functions. All of the relay and temperature read functions work correctly.
PIN 9 of the Arduino is connected to the input on the PWM board for the blower motor control. (This works correctly and in the code you can see is using the timer1 library.)
PIN 10 of the arduino is connected to the 180 degree DC hobby servo to control the angle of the shaft.
Both the PWM blower motor board and DC hobby servo both have separate power supplies and also separate power supplies from the Arduino. (none currently share power)
The software libraries included are OneWire, timer1, and Servo.
All of the project functionality works correctly, until any change to the fan speed is selected, then the hobby servo for the temperature mix flap ceases to function at all until the Arduino is disconnected from power and reset. Both of the PWM functions work correctly individually.
In the reading I have done, it appears that the servo library also uses the timer1 library.
To note, when selection on, off, or a change of speed for the fan blower motor, the servo for the temperature mix flap (Which is on a different defined pin) moves.
My goal is to determine how to separate these from interfering with each other and to have both PWM functions work in harmony, without disrupting the other.
I am not well versed in multiple PWM outputs at the same time and this is the first project I have worked with of such, so there may be something obvious in my code. To note *** The original project code already had the PWM and timer1 pieces listed for the fan / blower speed controls. All I have added that seems to be of issue, is the separate temp mix flap servo code.
Thanks in advance for your time, thoughts and suggestions. Code is attached.
HVAC_ATMEGA328_6-12.ino (14.3 KB)