I wrote some code on my arduino uno (it’s CH340) to detect if someone in the bathroom, and the power is from a 9 volt battery with the DC hole.
Everything is going well… well, for only 1 day.
I can make sure that my code doesn’t have problem because if I connect my arduino with my laptop, it will work again. But I don’t have any idea why it cannot work with the 9V battery now (it’s new and has electricity till now, I tested it on other device)
According to my observation, I found that something different: if I connect my arduino to laptop, there’s 2 lights shining; connecting it with 9V battery, only 1 light shines. Hope this information is useful, thank you!!!
oh maybe I said too less, I try to add here: when I connect to my laptop, my arduino, motion sensor (HC-SR501) and LED work. I know we need some time (abt 1min) to let motion sensor start working, but 1 mins after connecting with 9V battery (like the pic you pasted on), they don’t operate
He understood your question but maybe his answer could use further explanation.
A 9v battery of this type is not a good way to power a project. They may have 9v but have very low amperage.They are only good for very low power usage such as a smoke detector.
You need to use a better battery. Lipo's or even AAA batteries are much better.
IF u re powering projects which use light or motors , and the 9v battery you are using, then i expect none of those to work perfectly. Problem lies that is storage type batteries current is very low. You wont find them in heavy duty day to day appliance/equipment. I had the same problem 3 years back when building a simple car with l298n. I even tried to power with 3 9v batteries of your type (tried in series and parallel both) later I found out the problem. With a bit of research, I found that 9v batteries which rechargeable are very good for these project. I ordered one 9v lipo 500 mah. with only one of those rechargeable battery, My project was now working as expected. Even i didn't have to use 2 different batteries for powering up the uno and l28n, one managed it. For your kind of project, if u use the same battery as mine (infinite 9v lipo 500 mah), Guess your project will work for at least 1 and half days at full brightness(or maybe more!).