Using an op amp as a voltage comparator

avr_fred:
LED3 and LED4 are wired incorrectly, you cannot mix your 12 volt and 5 volt supplies in that way. The LED’s need to be powered from the 12volt rail with the appropriately higher value resistor. You’ve also omitted the very necessary free wheeling diodes across the relay coils. The PNP transistors may/will fail in short order, depending upon the device type.

PS: please don’t promote bad schematic habits with Fritizing, like drawing diodes and ground symbols upside down. That software is a waste of everybody’s time and energy. Either use a real schematic editor or draw them by hand which highly preferable over fritzzy silliness.

I forgot to include the diodes in the schematic they are in the circuit though. About the led's though, that brings up the question of I am powering the arduino directly off of the 12v batteries through the 2.5mm jack. You mentioned I shouldnt mix the voltages like that, is that just for the positive side, the reason I ask is because everything goes to the ground rail on the breadboard (no matter if its being fed from the +5 or +12 supplies). Even though the led's work the way I have them wired, I want to follow best practices. So if I figiure 12v starting voltage down to 5v at about 20 ma Id need about a 350ohm resistor?

No problem about the schematic. Ill look around for something better.