Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 68
571  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

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 ?
572  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!

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.

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
573  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.
574  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
Here 3k3 is used :
575  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....
576  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:

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 ?
577  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.

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.
578  Using Arduino / Project Guidance / Re: interfacing a display with arduino on: August 08, 2012, 04:22:04 pm
Give it a try !
579  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.

580  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: (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.
581  Using Arduino / Storage / Re: Webduino, getting data from SD card on: August 08, 2012, 06:34:34 am
I have this 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(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.
582  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.
583  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.
584  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 :
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:
This looks also very interesting :
585  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield + Pro Mini 3.3 v on: August 07, 2012, 09:06:52 pm
You can send a 3.3V signal to a +5V Arduino. The 3.3V is seen as "HIGH".
But you can not send a 5V signal to a 3.3V Arduino.

If you look at the schematic of the Ethernet Shield, the main chip, the W5100, is at 3.3V
The ethernet board contains logical level shifters to be able to connect it to an Arduino at +5V.
But to change the ethernet board, to make it run at 3.3V... perhaps that is possible, but I doubt it.
Pages: 1 ... 37 38 [39] 40 41 ... 68