I've almost finished my first Arduino project and I'm realizing I might have gone a bit over my head - I'm a web programmer, I have a very basic electronics knowledge and started tinkering with Arduino with just a couple simple, tutorial-like small circuits.
I then started building this project of a battery-powered Weather Station that sends sensors data via WiFi to my server - I managed to have a working product but I'm bumping into issues that are starting to look a bit bigger than what they initially seemed.
The workflow (schematics follow):
On the +5V pin of the Arduino Nano (actually a cheap chinese clone) I've put an AMS1117 to stabilize down the voltage to 3.3V (the 3.3V ArduinoNano output wasn't powerful enough), and from there I power several modules; a DS3232 wakes up the Arduino (pin 2) when put in deep sleep mode (every 30 mins); when woken up I read data from the DHT11 (humidity), the BMP085 (pressure), the DS18B20 (temperature) and FC-37 (rain), I connect to my WiFi using the ESP-01, send data to my server, and put the Arduino back to sleep until the next cycle.
Everything worked when on the breadboard, worked after building the circuit with a perfboard; heck, it worked even when connected to my power supply, which is something similar to this project: https://www.arduinolab.net/solar-li-ion-charger-and-power-supply-for-arduino/
My battery is a 3,7V 2500mA instead, but all components are almost the same and I use a regular USB - type B cable to connect this to my Arduino Nano
But after an hour or so it stopped working - I checked again by connecting the Arduino to my PC and it appeared to be fine, but when connected to the battery everything was powered up (all leds on!) but the ESP wasn't trasmitting (never saw the flashing blue led).
So I started some reading around and I tought it might be a problem of too much current needed, and the battery wasn't enough anymore after it got under a certain voltage (I still measured 3.80V on the battery terminals though..)...
This is what I'm thinking:
- to cut/remove the LEDSs from all the modules (dht, rtc, fc-37 has two!, AMS1117) to save power (it's 5 LEDs + the arduino power on LED). Is it safe? Will they still work with the LED circuitry interrupted?
- connect my power source directly to the Vin+ of the AMS1117, instead of using the +5v Arduino output pin (but I read it can safely outsource 500mA, which is the limit for the USB power in anyway, so it shouldn't be an issue...)
- for the "long run", use a transistor to power on the sensors when Arduino is awaken, keeping them off the rest of time to spare battery juice, if nothing else...But I really don't know how to start for this, I thought of an NPN transistor (I have a PN222A available) with Base to Arduino (through a 1k Ohm Resistor), Collector to +5V and Emitter to the AMS1117 Vin+, is this sensible?
- increase power output? but how? the power source lets 5V 600mA through a regulated DC-DC booster, it should be ideal in theory...How do I understand if it's right for me?
- Ditch the ESP01 in favor of the NRF24L01 (I already have a couple of these, but any other suggestion is appreciated)...but that would require a new setup, new coding (never used those modules), a "receiver" that then sends to wifi, and btw I don't know if the signal can make it from the balcony (where I plan to put the WeatherStation) to the inside of the house (I think it will, as the WiFi does - at least I think it does)
I don't really know how to actually measure the consumption of my circuit...I've read something around but, as I said, my electronics knowledge is limited, I don't have much spare time to dedicate on this, and therefore I cannot figure out without a clear guidance, sorry...
I'm not attaching my code because I don't think it's necessary - the sleep mode I'm using is SLEEP_MODE_PWR_DOWN from the avr/sleep.h library, other than that it works fine as it is.
Can someone give me suggestions or pointers on how to analyze my problem? Am I on the right track or my reasonings are off?
Thanks for any help you could provide, if you need any more info I'll do my best (in due time though, as I said I've not that much time to work on this...if I could muster 1 or 2 hours a week it would be a dream!)