Hello all guys of the Arduino Forum...
Dear all,
At this point, I am in a deep crisis (you may be laughing). I don´t know if I should laugh or cry, though...
Only 2 out of 7 small sketches I prepared, one for each sensor, worked out. This is a mere 28.5%. Not very good.
The ones that worked were fuel tank level and one fuel flow meter.
I checked the signals at the car end of the connecting wires: they are all working and sending signals.
So, come to the conclusion that I must start over again, this time, on a protoboard. No more soldering until all is working and almost final.
Soldering from the beginning is a bad idea, because you cannot modify things easily and quickly, on the run.
I have a new startegy, to be followed in ten phases. I publish my experience here, because some newbies may take advantage of it.
- Check every one digital and analog pin of the Arduino board, before any further intent.
For that, I need a couple of testing sketches, very simple and short. I cannot see other way.
Once Arduino has been evaluated on its health,
-
Get every single signal of the car (or whatever) on the protoboard, where you can check voltages. I good idea is to input them to a PC-based osciloscope (free), for analysis.
-
Prepare voltage dividers for every signal that is over 5 VDC. Eventually, prepare a signal amplifier if the signal is too weak for Arduino to process.
-
Prepare 7 sketches, one for every signal, very simple, just to put the signal into Arduino. Once it is recognized by Arduino, you can process it. There are many data processing functions, that may help.
-
Process each signal, according to its nature. Sample, smooth, calculate moving averages, map, constrain, etc., everything usefull to improve signal and convert it into information. Bring the computer to the car and solve the details there. Start with one analog and one digital signal to gain scope on how to manage them. You can use your math models at this stage.
-
Consolidate a "final" processing sketch for each signal, save it with a very clear name that you can recall later, without confussion.
-
Begin to work with time, means, results screens, etc. In my case, time is needed to calculate distance travelled, as my odometer is analog, very old.
-
Begin to program a final sketch where all signals are integrated. Starting with one signal and add one at a time, testing all is working ok. After all intermediate values prove to be ok, program final "to be shown results", as to take advantage of the project.
-
Calibrate all signals.
-
Eventually, make a pcb where I can solder (at last) all necessary pieces efficiently and securely. Maybe use a Arduino shield. Assamble and test again in the car.
The stategy sound good to me... any improvement ideas from your experience?
- Make some fancy staff, such as put the thing into a box, add some buttons for multiple display pages, or such.
At present I am on stage 1, having trouble from the beggining: the test sketch that comes with the Arduino 16, do not work for me as it is supposed to.
This is it:
/*
* Button
* by DojoDave <http://www.0j0.org>
*
* Turns on and off a light emitting diode(LED) connected to digital
* pin 13, when pressing a pushbutton attached to pin 7.
*
* http://www.arduino.cc/en/Tutorial/Button
*/
int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare pushbutton as input
}
void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, LOW); // turn LED OFF
} else {
digitalWrite(ledPin, HIGH); // turn LED ON
}
}
It should turn off the LED everytime I press the button. It doesn´t. Instead, when I plug the button the LED turn off, no matter if I press the button or not.
The bad thing of this routine is that it hasn´t any circuit diagram to know where and how to connect the button!
Does anyone know about a routine that can be used to check Arduino board? Maybe there is such a routine already made somewhere? Anyone knows?
Conversely, would someone bring here a couple of very simple routines to check Arduino?
I have a potentiometer, resistors, capacitors, buttons, a small motor, and the led of the Arduino board to use for this purpose.
Best,
OldBeaver
Gracias Lorena por tu ayuda. Trataré de aprovecharla. No es fácil toparse con una chica e este medio y menos que hable español! Sabes bastante más que yo, por lo que veo en tu sketch. ¡Es bueno saber de tu existencia! Nuevamente, gracias.