Hi, I am new to Arduino - and electronics to some degree, but I have some experience with programming. I spent this weekend learning the Arduino board and the programming code and would like to get my hands dirty on this first project. It is based on the MPGuino project I saw on the web, however, it is for a boat, and is going to be a digital guage cluster for the boat. The MPGuino project uses all Digital inputs, I am trying to use all Analog inputs. Not only that, I would like to use the exisiting temp,oil pressure and trim sensors on the boat. I will use new sensors for air and water temp, since I currenlty have no sensors reading those. The code should be pretty simple to write starting with the MPGuino code and modifing it for this project. What I am concerned about is if I am correctly wiring the sensors to the Arduino board. I have attached my Circuit diagram, and a parts list to go along with it. I am using diodes to protect/seperate the 5V circiut for the Arduino, from the exisiting 12V circuit that the Analog guages use. Keep in mind I want to have this digital guage as a secondary guage - so I need to keep all the Analog guages intact. Any help is appreciated - I am going to tinker with the resistors and code to get the calibration right, but I do not want to fry the Arduino board the first time I plug it all up.
Spent one evening to go through the tutorial section and the playground to see what the Arduino can/ cant do - you will pick up a lot of ideas there that can be used in your project.
I look at you schematic. And .... if you construct that schematic, it will not work ,you may damage the Arduino, because of D1, D2, and D3. The 12 V will not go into the 5 V ( Arduino ) , but the 5 V will goes toward the sensors, if the sensors are low resistance, well it wil draw a lot of current. The LCD is badly wires.
Please read Arduino Tutorial - connecting a parallel LCD to connect the LCD properly, that will give you the idea, and the correct sensor connection to the Arduino is R4 and R5, they are in voltage divider mode, it is OK. But E1, E2 and E2 are connect with a "meter" , those sensors work in "current changing" mode, the Arduino wil not work well in that mode. So please disconnect D1, D2 and D3.
So my solution is disconnect the 12 V and the analog gauge, connect a resistor for each sensor ( E1, E2, E3 ) , just like R4, R5 with S1 and S2. I know, you will loose the analog meter. If you want to keep the analog meter, you have to use a serie resistor with the sensor Like : the gauge -- serie resistor of 1 ohm - the sensor E1. Because to measure a current, you need to measured in serie. and measure the voltage diference at that serie resistor. But be aware that the gauge will not be accurate. ( Because of the resistance in series.
Here a better schematic of what I trying to say. In your program, you simply take the difference of A1 - A0, A2 - A0, A3 - A0. I still don't know what type of current goes into the gauges ( Max ? mA ) Because, at 5 mA going to the 1 ohm resistor, You will measure about 0.004 V to 0.005 V. That is Value = analogRead(A1) - analogRead(A0) equal 1 because 5 V / 1023 = 0.004887585 equal 5 mA.
Thanks for all of the advice. I think I understand what you are saying. Basically you are getting the current by comparing the voltage difference between a circuit with only two resistors, and each circuit with 2 resistors and the sensor. In the end this setup is going to cause additional resistance in the circuit, therefore changing the current measured by the "meters" or exciting gauges. This would be fine if there were some adjustment in the gauges, but there isn't.
I think I am going to go back to your original suggestion, and get 3 new sensors (actually, I am only going to get, two - I can live with a digital only trim gauge, and the mechanics involved with adding another trim sensor would be difficult.)