I'm currently running a project which involves the reading of an analog signal and sending it via serial to my PC. Pretty simple and usual thing (but apparently I can't manage it...)
I have also put an LCD, which displays the data I get from analogread().
My problem is basically that I start running the Arduino (without opening the serial monitor) and read the data displayed on the LCD [it's the reading of a temperature, so I roughly can understand if it's correct]. When I open the serial monitor, the read data starts to be noisy( before i had an acceptable nois of 0.1C now i have a noise of 1C). So the actual data i can save on my PC isn't ok.
Note that after the first time I had this problem, I removed the serial communication (i.e. I commented all the serial.print) but I still get this problem...
Note: if I use the programming port, the error is huge. If I use the native port the problem is minor, but I need to understand it (and since i comunicate via serai with a VB.NET code, i cant communicate with the native port [i.e. i tied with no succec]).
I also tried to change the board, testing the code on my arduino UNO and i get the same error.
Can it be that i have driver problems on the computer side? altering somehow the readings on the board?
First of all thanks for you time, and for replying my post.
the loaded is correct, maybe i didn't explain myself properly.
i load this program,
i keep the usb cable connected,
arduino starts acquiring data and displaying it on the lcd,
i see a nice and not (too much) noisy data displayied on the lcd,
then i start the serial monitor of the arduino ide and the signal starts to be more noisy.
i consciously commented the "serial.begin" and i didnt put any "serial.print" because i removed step by step all the thigs that could have caused this problem. So i ended up stating that the problem is just due to the opening of the serial port on the pc side (from the arduino ide or other programs as well). Can be this a limit of arduino?
UPDATE: i tried with different baud rates and it seems that this "noise" is reducing by increasing the baud rate. This can explain why using the native port i have better results (because as i read the native port communicates faster).
i unistalled the ide and then installed again, thinking that this could be a driver problem on the pc side, but apparently is not.
Thanks for the clarification. I did not properly understand the problem.
However I must say that I have never had an occasion to do what you are describing so I don't have any solution to offer.
The only thought that comes to mind is whether you are powering something from the Arduino 5v or 3.3v pins and that something might be at the limit of the capacity of that pin to produce current.
I suggest you make a pencil drawing of all of your wiring connections and post a photo of the drawing.
i had the same idea, maybe i can try powering the arduino.
i noticed that my arduino is powering 4.6-4.7V at the 5V output an this can be a sign of unstability, but this voltage doesn't change when i activate the com port on the computer side.
i have also attached a picture of my circuit.
i tried to supply the arduino with a power supply, but i don't think it is stabilized, because even if i get 5.05V at the 5V ouput i get a noisy signal indipendently of the com port opening.
maybe i should try with a 9Vbattery, or by building a stabilized power supply.
Yes but the problem is that even if i can find one, i'm not able to use it.
btw, what do you suggest to look at with the oscilloscope?
would you test the usb pins?
in your opinion how can i make a stable power supply? if by using a vref to power up the IC and a voltage regulator to supply the arduino i can overcome a possible voltage alteration to the system induced by the opening of the com port?
Why not power the external device separately from the Arduino. Just have a common GND between them. If you need a 5v supply for the external device a 7805 voltage regulator is very cheap and simple to use.