I have a 2.4" TFT Screen as a shield on an Arduino Uno. The sketch scrolls 4 images on the screen sourced from a mini SD card which is supposed to last indefinitely. The sketch compiles just fine and the four images show in order, repeating quite a few times until 5 minutes have passed. At this point right before it starts the loop again I get a message on the screen "Bad bmp" but it starts up anyway. Then at 6 minutes, I get a "bad bmp" message and a "cannot find bmp image" message and the whole thing quits. I can hit the reset button or turn the power off and on again and that clears the problem and it goes through the same 6 minute cycle. OK, but this is going into a piece of art that has to run for hours, if not days.
My question is I don't know where I should be troubleshooting or where to do any homework (I haven't found reference to this kind of issue anywhere yet.). Is it a memory problem? Can I add a line or two of code to clear everything without actually doing a reset. Reset results in an unwanted start-up white screen and blue test scroll screen. Is there anywhere that actually states what the capacity for run-time is for various boards? In other words, I could use a mega but maybe that only gets me an hour instead of 6 minutes. Should I be going at this in an entirely different way?
[Note: maybe this is a code problem but since it compiles successfully, I don't think so. Therefore I'm not entering code at this point.]
Thanks for any advice.
The only real info we have now is that you're using an Uno.
No links to the TFT screen, SD card, no diagram or how you power the setup, no code, etc.
Should we guess ?
I guess power.
You're powering the setup externally, with a 12volt power supply (too high), and the 5volt regulator overheats and shuts down. But I could be wong.
Read the "how to post" sticky that's on top of every main page.
Leo..
My guess is that the SD is not connected solidly or is overheating due to someone shortcutting the 5V to 3.3V leveling.
Thank you, this was actually quite helpful. I woke up thinking "power source" as that was the one thing that changed after it ran fine when directly connected to the laptop with the code on it. I am going to change the power source and see what happens.
Note: I did read the "how to post". It seemed most helpful if you were trying to debug or refine a sketch. I thought my problem didn't fit. Anyway I did err in not giving the power source info. It was an external 9 volt battery. Which apparently will still be too high for the regulator to handle.
If I connect a cord that plugs into a standard wall socket, that will not solve the problem. I will have to find a way to step all this down.
FYI the board is one made by Red Board that comes ready just to plug the shield into. The shield just says TFT LCD Shield on it. The slot for a micro SD card comes already attached to the shield.
The code was actually downloaded and modified by a team member so I didn't have it to share yesterday. I'm an artist who's played around with basic electronics, not a techie playing around with art, so thanks for your patience.
The regulator will let you run on 12V if you need. The 9V battery does not deliver enough current through the regulator to do much and the screen really should use external power, meaning not through the Arduino but around it.
There are cheap DC-DC Buck converters that will take current at 9V and turn it into almost 9/5 as much current at 5V. You plug the 5V into Arduino 5V and ground to GND, see if that works. The 7805 regulator turns 100mA 9V to 100mA 5V, the converter gives more like 170mA 5V. If you need more, get 1A 12V wall wart but no more if the converter output is rated at 3A max.
Thanks for reply.
I ditched the battery and tried a 5.0V adapter I got from Adafruit that plugs into the wall on one end and with barrel insert directly into the Arduino on the other end.
Sadly, the symptoms persisted. Same 5-6 minute routine to a stall.
I think I will have to do a deep dive into the operations of the code with a monitoring program to find out where and when things start to go wrong as it is running. That has to wait until the weekend though.
Was hoping I had an easier problem to solve. Sigh.
Regards.
If you've dealt with possible power / overheating problems, the next place I'd start looking would be for memory leaks in the code. Does it use the String class? Or any of the malloc() family? Or recursive functions?
lore88:
I ditched the battery and tried a 5.0V adapter I got from Adafruit that plugs into the wall on one end and with barrel insert directly into the Arduino on the other end.
5volt on the DC socket of an Uno is wrong. That DC socket needs at least 7volt.
You could have show us REAL pictures of the setup, and links to the parts you're using.
Add the code once you have it.
Leo..
Thanks all,
Will come back when at a more advanced state.
Wawa:
5volt on the DC socket of an Uno is wrong. That DC socket needs at least 7volt.You could have show is REAL pictures of the setup, and links to the parts you're using.
Add the code once you have it.
Leo..
IF the supply is regulated, cut the plug end off the cable and find 5V from ground wires (usually the dark wire) then put ground to shield GND and 5V to shield 5V. If the supply is not regulated, just don't.
Problem solved!
First, thank you to everyone who gave me advice. As a newbie on this forum, I learned a lot about how to use the forum. I will do better next time. I also learned a lot about power supply.
What was the problem? When I got my hands on the code, fortunately a version was saved after each single step was made as we modified the Elegoo ShowBMP (their Example05) sketch to fit our needs. There were no problems until our iteration #9. At that point we subtracted a line rather than just modifying it. It turned out that that affected an input defining the number of files in the Gnfile. The number didn't match the number of BMP files we had listed elsewhere. Once matched, it has run perfectly ever since.
Perhaps one of you would have spotted this right off the bat if I had waited to get the code and uploaded the entire sketch for you. If so, mea culpa. But in the end, I'm a better troubleshooter than I was for having gone through the process.
To close the loop about power. I'm currently using a 9 volt adapter with wall plug, which has tested out fine. I appreciate the suggestions for alternative solutions. I should note that I mentioned this was an art piece. It is going in a museum setting where I will have only the ability to access power from a standard US wall socket. So I have these limitations. But I am more knowledgeable for the input.
Regards.
I'm glad that the problem is solved, and even more glad that you seem to have learned something - perhaps even several things!