Hi,
I'm having a hard time making my first project work and i've encountered a few remarkable and confusing things which i cannot figure out.
The soldering and the programming are done, and i'm currently in the testing phase.
The project is an arduino fan controller with an LCD display which is built-in in my PC's DVD Bay.
It monitors the current(and thus power in watts) from the wall outlet to the PSU, the 12 and 5V voltages, the (3)fan speeds, and 2 temps, and prints these values to the LCD and the Serial monitor along with other info.
Based on the temps, it regulates the fans. There's also a possibility for manual fan control and a switch which toggles the lighting which is built-in in the case.
There's a piëzo buzzer attached which gives a warning when voltages or temps exceed their limits. There's two buttons for additional user input, and a separately manually controlled sidefan.
To manually control the case fans and the sidefan, i've used a construction of two switches for both of them, shown in the picture attached below.
This way these two constructions return 00, 01, 10, or 11 to the arduino.
I've first tested my code with the arduino hooked on usb with only the lcd attached.
Because nothing was attached the values were floating and made no sense, but it worked fine.
So i built it in and powered it on but i got the following problems right away:
-Fans were blazing at full speed
-Lighting went on while the switch was off
-Arduino doesn't react to any attached switch or button input.
So i started to troubleshoot the thing, and i measured 5V on each digital pin (also on input configured pins) and on one analog pin.
Except for pins 6 and 7 these are 0V, pin 10 is 1.2V, pin 1 fluctuates between 5 and 3V.
I used the AVS712 for current measuring but i found out it doesnt work well with AC current without some extra circuitry.
This is the only thing i can think of that could have damaged the arduino.
While these voltages on the pins could be signs that the arduino is damaged, it still works quite well;
I do have correct temperature and voltage readings on the lcd as well as on the serial, and i can still upload stuff to the arduino.
I have used pull ups and downs always where necessary i believe, i've tied all grounds together, and i have checked all the mosfet's, resistors, and diods before placing them.
What could possibly be going wrong here? And how can i solve this problem?
A very big thanks and kudos to anyone who can help me with this.
The schematic and the code (370 lines) are attached below.
Couldn't post the code within this post due to charachter limit.
controller_simpleForum.ino (13.8 KB)