If the TFT needs both 5.0 and 3.3 volts it sounds hazardeous to operate the TFT using only one of the two VCCs.
Pulling 900 mA from the Arduino 3.3 volt is out of the question. Something must be wrong. Is that happening when the 5.0 vot is disconnected?
Without knowledge about TFTs I still think 900 mA must be wrong. Check again that GND and Vcc are connected to the right places. Start the test having no other Cables connected to/from the TFT.
I made a mistake switching the one wire data and GND when connecting a sensor. That increased the current from microAmps to 150 mA. Luckily t he sensor survived.
Powering the Arduino using 12 volt makes the 5 and 3.3 volt converters of the Arduino to deliver current and they are not very powerful. USB provides more of 5 volt then the 5 volt of the Arduino does.
tasmod:
I retired a few years ago from doing door and gate automation. It sounds like you are doing something others have access to. (Password ? )I don't want to be a killjoy or a nay sayer BUT beware of local laws and european directives regarding automation.
Liability definitely is a consideration in this age of litigation.
I ended up whereby my company had to fit infra red barrier beams, inductive ground loops (vehicle) and pneumatic safety strips (pedestrians) to meet all the requirements. It is also a european requirement that the closing force of a gate or door be measured and logged.
Please be careful for YOUR own sake. It's a red hot topic with health and safety.
I know safety is most important. I am doing the project for a door which is on my property. There is no commercial use for the gate opener for now.
Railroader:
If the TFT needs both 5.0 and 3.3 volts it sounds hazardeous to operate the TFT using only one of the two VCCs.
Pulling 900 mA from the Arduino 3.3 volt is out of the question. Something must be wrong. Is that happening when the 5.0 vot is disconnected?
Without knowledge about TFTs I still think 900 mA must be wrong. Check again that GND and Vcc are connected to the right places. Start the test having no other Cables connected to/from the TFT.
I made a mistake switching the one wire data and GND when connecting a sensor. That increased the current from microAmps to 150 mA. Luckily t he sensor survived.
Powering the Arduino using 12 volt makes the 5 and 3.3 volt converters of the Arduino to deliver current and they are not very powerful. USB provides more of 5 volt then the 5 volt of the Arduino does.
I am not sure completely if the 5V was disconnected when I measured the current but I think it was disconnected and then I measure the current on the 3.3V.
I checked the VCC and GND connections couple of times and they are correct.
I tried to plug the TFT display directly in the arduino pins but still the display is not working. There is a small light on the display but it does not show anything.
Therefore you suggest that I should use USB power to power the arduino not the Vin pin?
The TFT display is designed to be directly plugged in the arduino pins therefore I think the current delivered by the arduino should be sufficient to power the display.
Maybe I should use an external supply for the display as well.
Hi,
Update on the project.
I bought a separate power supply to power the screen with 5V and 3.3V separately, not from the Arduino.
The programm stopped reseting randomly, therefore in my opinion it was a lack of power issue.
Now I interfaced the sensors (open and close sensor), the TFT display and the real time clock.
I have some problems now with the execution of the program.
Sometimes the program resets(just one time) when I perform the sequnce or the motor starts when I upload the program after changing someting.
Here is the program, I added a lot of comments.
I think the problem might be in the order of the code and statements.
sketch_aug11a.mar11CHANGED.ino (16.9 KB)
Why not attach the code using code tags? I have no IDE in my smartphone and can't read Your code.
Railroader:
Why not attach the code using code tags? I have no IDE in my smartphone and can't read Your code.
I was researching and perhaps another reason that might cause the problem is that I use delay() function. Therefore the whole just stops and does not get updates when the function executes.
I am trying to understand the millis() function and eventually change the delay() with millis().
The code exceeds 9000 characters and I cannot attach it to one post.
I tried to implement the millis() function with no success.
I observed that now, when there is no delays(only 3 delays of 1 ms), the system does not reset itself.
I set the real time clock to work and detect the time when the door starts opening and from then on it counts a certain amount of time before it starts closing automatically. The problem here is that the amount of time that the door is supposed to wait before start closing automatically does not match with the time on the stopwatch. Basically the door starts closing earlier.
If you look at code I do not use any interrupts or something of that kind. My program is mostly functions, if and while statements. I am not sure if that is correct.
I also get this error quite a lot of times. For example, when the Arduino stays a lot of time without upldoading anything to it. Sometimes when I upload a program and then I try again the same error.
avrdude: ser_open(): can't set com-state for "\\.\COM3"
avrdude: ser_drain(): read error: Invalid manipulator.
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The parameter is not correct.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The parameter is not correct.
EDIT: I just unplugged the Arduino from the computer and the program did not start from the beginning, the door started closing suddenly. Then I uploaded the same program again and same as before, started closing. First Reset using the button on the Arduino did not help, the second or the third Reset fixed it.