Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 68
571  Using Arduino / Programming Questions / Re: LM 35 Temperature sensor accuracy on: August 11, 2012, 03:56:01 am
The 'float' in Arduino is actually a 'double'.

Something like this:
Code:
double totalTemp;
double averageTemp;
int count;

count = 0;
totalTemp = 0.0;

some while or for loop
{
  temperature =  analogRead(...) / 2.01;     // calculate temperature.
  totalTemp += temperature;
  count++;
}

averageTemp = totalTemp / count;

If you take too many samples, the accuracy will no longer increase. But up to 1000 samples is no problem.

Question: Is that electric heater with a temperature control. Since the temperature is going up and down, it might be due to the electric heater switching on and off.
572  Using Arduino / Sensors / Re: simulate MPU-6050. on: August 11, 2012, 03:45:33 am
I don't know what teapot or MWC software is.
You could alter my sketch perhaps. I wrote if for Arduino 1.0.1
http://arduino.cc/playground/Main/MPU-6050

edit: I saw your name, and realized you know that sketch already for a previous thread. Can you give some links for the simulating software ?
573  Using Arduino / Sensors / Re: Diode temp sensor help. on: August 11, 2012, 03:41:22 am
Some basic explanation:

The analog-to-digital converter (ADC) inside the microcontroller converts a signal from 0...5V to a value of 0...1023. To use the ADC, the function analogRead() is used.

The ADC is however capable of more than just that. It uses a voltage reference for the conversion. Normally that voltage reference is +5V. But it can be set to +1.1V.

With a voltage reference of 1.1V, the ADC converts a signal an analog input pin from 0...1.1V to a value of 0...1023. That's roughly 1mV resolution. So the accuracy increases. Nice!
http://arduino.cc/it/Reference/AnalogReference

This is all happening inside the chip.
The voltage reference is connected to the outside world with a pin. On your Arduino Board, you see "AREF", that's the reference.
If you switch to another voltage reference, it is best to wait for 20ms, to let the voltages settle.

Code:
void setup()
{
  analogReference (INTERNAL);   // 1.1V reference
  delay(20);                                // let voltages settle
}

void loop()
{
  int rawADC;
  rawADC = analogRead(some_pin);   // 0...1.1V -> 0...1023
}
574  Using Arduino / Programming Questions / Re: LM 35 Temperature sensor accuracy on: August 10, 2012, 06:53:42 pm
...
I would agree with the other guys. Take 1000 samples and send the average every 30 seconds.

Now that I think of it, taking many samples during the whole period of 30 seconds would be the best.
So the ideal program keeps on going to take samples (and remember how many). If it is time to send them, the average is send, and taking many samples starts over again.

I think that a sample per second will do.
If I use a sensor, I start with the average of 5, and mostly that is enough.
575  Using Arduino / Sensors / Re: Diode temp sensor help. on: August 10, 2012, 06:39:50 pm
The common 1N4148 diode can be used as temperature sensor (but almost every diode will do).
The resistor can be connected to +5V.
For the 1N4148, I used 10k.
Rule of thumb is: 2mV / C    (2mV less voltage drop for every degree increase of temperature)
   0.4 V at +100 degrees Celcius
   0.6 V at 0 degrees Celcius
   0.8 V at -100 degrees Celcius
But you have to test for yourself to determine a more precise calculation. I think that 2 degrees accuracy is possible.

You don't need an Op Amp. The analog input of the Arduino is high impedance, it will never influence your circuit. The variation of the voltage drop is also large enough for a good accuracy. But you have to use the internal reference of 1.1V
http://arduino.cc/it/Reference/AnalogReference
Here 3k3 is used : http://www.openimpulse.com/blog/2012/07/low-cost-diode-temperature-sensor/#more-261
576  Using Arduino / General Electronics / Re: Multiple LEDs with 1 resistor on: August 10, 2012, 06:25:53 pm
In your example picture all leds have the same intensity. But only of they are all the same leds.

I assume that your smd RGB led has three leds. They all have a very different voltage drop. It could be from 1.8 (red) to 3.4 (blue). You have to know the voltage drop to calculate the current. And you have to see for yourself to see if the same current seems like the same brightness.

In the end, I think you need many resistors....
577  Using Arduino / Programming Questions / Re: LM 35 Temperature sensor accuracy on: August 10, 2012, 06:12:13 pm
Power Supply of 12V is a good, but a bit high. Check the voltage regulator on the Arduino Board to see if it doesn't get too hot (put your finger on the component next to the power plug).

Read those two links I posted:
http://arduino.cc/it/Reference/AnalogReference
http://arduino.cc/playground/Main/LM35HigherResolution

The analog reference voltage is the reference voltage inside the microcontroller. All analog inputs are read with that reference voltage as the maximum.

1 meter of cable is long. You need to place 100nF over the sensor at +5V and GND.

And yes, we like the whole sketch. We also like schematic diagrams, photos and url links. But most important is that you have fun with Arduino.

You have to use the average of a number of samples. That would probably solve 80% of all problems. Can you make a function that returns the temperature ?
578  Using Arduino / Programming Questions / Re: LM 35 Temperature sensor accuracy on: August 10, 2012, 03:48:41 pm
How is your Arduino Uno powered ? I hope not only the USB bus.
If you use the +5V reference, the value changes if the voltage changes.
If you have selected 1.1V reference, it is no problem.
http://arduino.cc/it/Reference/AnalogReference
http://arduino.cc/playground/Main/LM35HigherResolution

You should take the average of 10 to 20 samples. There is always some ADC noise, and noise from the circuit. You could even add a delay of about 100ms between the samples. If your power supply is good, taking the average should make a smooth line !

How is your hardware ? If you have long wires to the sensor, there must be a decoupling capaciter of 100nF.

There are many other things that could cause this: a draft by opening a door; electric noise; a bad switching adapter;  and so on.
579  Using Arduino / Project Guidance / Re: interfacing a display with arduino on: August 08, 2012, 04:22:04 pm
Give it a try !
580  Using Arduino / Project Guidance / Re: Timing Issues To Make Arduino RC Car Realistic on: August 08, 2012, 01:06:14 pm
I was assuming that you use 5V servo motors.
If you do use 5V servo motors, the voltage regulator (on the Arduino board or an other voltage regulator) could get hot. A DC-DC converter would convert the voltage without loss, so your battery is will last longer.

581  Using Arduino / Project Guidance / Re: interfacing a display with arduino on: August 08, 2012, 12:39:53 pm
You are right, but I can't find what kind of controller is used.

There is also an original datasheet. Download it here: http://www.datasheetarchive.com/CU209SCPB-T20A-datasheet.html (click on the PDF thumbnail for the 484.77 Kb, and then click on the image of the first page).

You could check that datasheet against a datasheet of an LCD with the HD44780, to see if it is the same.
582  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 06:34:34 am
I have this code:
Code:
if (error404)
{
      // The file didn't exist, or it was not a file after all.
      Serial.println(F("Error 404 !"));
     
      pClient->println(F("HTTP/1.1 404 Not Found"));
      pClient->println(F("Content-Type: text/html"));
      pClient->println();
      pClient->println(F("<h2>File Not Found !</h2>"));
}

The pClient is a pointer: EthernetClient *pClient;
The error404 is an error flag: boolean error404;
So an error is returned and a message is displayed.
583  Using Arduino / Networking, Protocols, and Devices / Re: Serial Communication Problem on: August 08, 2012, 04:18:38 am
Well, that might be the problem.
The level shifter receives a the higher level correctly.
But it transmit only a 5V level, it does not create the higher levels for output.
You need a board with the MAX232, that's what everyone is using.
584  Using Arduino / Networking, Protocols, and Devices / Re: Serial Communication Problem on: August 08, 2012, 03:24:19 am
According to the document at page 34 : "Signaling levels: RS232".
So it does need the higher levels of the original RS232.
So first make sure the level converter is working.
Can you upload a schematic of the level converter ? The RX of the Arduino is also influenced by its own serial-to-usb-converter. The level converter has to override that.
585  Using Arduino / Project Guidance / Re: interfacing a display with arduino on: August 07, 2012, 09:18:18 pm
The 'C' code is for another microcontroller. You can see how it is done, but you can't just copy it.
The pins can be any of the 13 digital pins.

If you are new to Arduino, you should try something easy first. A few leds and switches and so.
Arduino has code for displays with a HD44780 controller : http://arduino.cc/en/Tutorial/LiquidCrystal
If your display is different, it can be hard to make it work.
You need an example of someone who has used this display with the Arduino.

Your first stop is the playground section about VFDs: http://arduino.cc/playground/Main/InterfacingWithHardware#VFD
This looks also very interesting : http://www.neilhannah.com/arduino-vfd/
Pages: 1 ... 37 38 [39] 40 41 ... 68