Do not mix digital and analogue outputs of the light sensor
Lm393 is used to switch from low to high above the light threshold. Etc. it provides digital (binary) output. If you connect it to arduino analogue ping you mostly will read binary data with some noise.
Analogue output of this sensor is bypassing lm393 and provides you a range of analogue levels depending on the light level
For me a cheap 5mm round photoresistor is very sufficient as a light sensor. Just create a divider with photoresistor on bottom and fixed resistor on top. Fixed resistor should be with resistance much lower than dark resistance of the photoresistor, so you will read 1023 in a dark room
Ok, finally I found the Problem.
I changed the prescaler value of Timer0 becuase I needed a higher PWM Frequenciy.
Unfortuneatly this also affects the millis() function that is used in gw.wait.
It turns out taht with the changed TImer 0 Prescaler 1ms was not 1ms anymore but less. So the gw.wait(750) where only 750ms/64 which is not enough for DS18S20 conversion to take place.
My plan is to use 2x nimh batteries. Nimh can need up to about 1.5V before they are fully charged (depends on how fast the solar panel can charge them but for a small panel charging will probably be less than 0.1 so 1.45V should be enough to fully charge)
These lights usually charge directly from the solar panen to avoid having to add a charging circuit, to keep cost and complexity down.
3x1.45V=4.35V which is more than most 3.3V components can handle.
The atmega328 works down to 1.8 with lowest BOD. Rfm69 works down to 1.8. Nrf24 works down to 1.9.
At 1V a nimh is almost totally exhausted. So 2x nimh gives enough voltage at the low end for the components I usually use. This avoids adding a step up/down which means lower complexity and cost, and no loss of efficiency due to conversion.
These are just my thoughts so far. Hopefully improvements can be made
@qqlapraline The 5v and 3v3 pro-minis can both be modified to very similar low power consumption, Google low power pro-mini for a multitude of sites over several years detailing comparatives and examples. I had reason to dig into this as explained below:
With combined radio and RTC on a 3v3 pro-mini I was faced with a lack of available pins from the combination to deal with the 5v ultrasonics as well as providing voltage step-up. I tried a plethora of potential solutions before realising it was a losing battle with a single device and so many demands.
Adding a low power 5v pro-mini to the node to deal with the US and communicating via I2C to the 3v3 pro-mini ended up the most efficient solution for my case. It may seem counter intuitive to waste energy on two devices and two power sources, but not so, both sleep saving energy. In my own case I was going to end up with two devices and two power supplies anyway, but just two separate radio nodes, so there was no energy penalty.
The 5v pro-mini has one interrupt triggered by the 3v3's RTC for US readings, the second interrupt is to be enabled by the adjacent Gas Meter reed sensor, releasing the original dedicated node for other duties.
It is not completed and deployed yet as it is still sub-zero here and the ground is rock solid where the sensor head has to run.