Battery Level from Mysensor node
I know my problem is probably present in this forum, I try to find it but with no results.
I'm using Openhab 1.8.1 on Raspberry Pi 2, mqtt mysensor gateway and I have a node with arduino nano (temperature, humidity, motion and light sensor). MySensor version is 1.5.
I want to integrate it with power battery and I want to monitor the battery level in Openhab (I get the project directly from mysensor site) .
I see that mysensor has sendBatteryLevel, but I don't succeed to show value in my sitemap.
Battery level is internal message like sketch name but I succeed to show sketch name in openhab using the follow string request:
How can see battery level sent using sendBatteryLevel? Is possible without using custom message?
Thanks in advance.
@Masonkante I could not make it work with MySensors v1.5, Openhab and the Sensebender sketch because (as you have noticed) battery level is an internal message. I had to make a custom message but this is easily made so it is not much of a drawback. I wanted a message for the actual level in mV as well so it did not matter much.
Thanks for your answer @mbj !
I implement sending of battery level using custom message.
It is a good solution for me.
In this moment I have system connected to usb via programmer (not to power battery, it is my next step).
I see that arduino read a variable battery level on analogic input...from max voltage level 100% to 85% level.
It's normal behavior?
I think that using costant power supply the level must be always at 100%.
I suppose the problem is connected or to arduino analogic input or to usb power supply (even if using a tester on circuit voltage seem to be costant).
Have you ever seen something similar?
Thanks in advance.
@Masonkante So far I have only one battery powered node, the Sensebender Micro. I do not remember seeing any varying readings when connected to the programmer but this node is powered from programmer only during programming.
So I do not have much experience from running it on power from a FDTI programmer.
You mentioned first that your node is a nano so it is a bit unclear to me if you refer to a Sensebender or a nano.
I'm using arduino nano.
I will try to test the configuration and also use other arduino type.
May be a possible configuration or hardware error, I need to verify circuit.
@Masonkante With the nano you have power regulators and other stuff involved as well. Also you will get a poor battery life using that one if it is not modified a lot. Have you looked at this?
Yes, I know it.
My idea is to switch to arduino pro mini, remove power led and test duration, before remove the regulator.
Nano is used only to develop sketch and test connection.
@Masonkante Another alternative is to build your own using a 328P-PU chip. This is at least a lot more fun and the only thing needed is the chip itself (almost).
Hello there @Masonkante - I recommend that you check out my current build for reference to battery powering a custom board. I have created a board that uses a ATmega328p-au powered through a coin cell battery to act as a switch module. By all means use my thread for information on how to create a low powered arduino alternative for your desired needs.