nRF5 action!
-
@NeverDie said in nRF5 Bluetooth action!:
Quantization error on the hwCpuVoltage() function appears to about 14 millivolts, which is a nice little improvement over the atmega328p. Measurement accuracy appears to be well within those bounds.
Next step is to measure voltage on an analog pin using an AnalogRead. Not sure if the reference voltage is Vcc (as it typically is with the atmega328p) or something else for those measurements.
Strangely, if I do, say, analogRead(A4) on the nRF52832, all I get back is a 10-bit number, not a 12-bit number. i.e. the number never exceeds 1023. That can't be right. Should I be using a different function call to get the full 12 bits on the nRF52832?
-
@NeverDie looks like you need to call analogReadResolution first https://github.com/sandeepmistry/arduino-nRF5/blob/425e719af8d85b543def01e49a6ef4048525dc59/cores/nRF5/wiring_analog.h#L74
@mfalkvidd said in nRF5 Bluetooth action!:
@NeverDie looks like you need to call analogReadResolution first https://github.com/sandeepmistry/arduino-nRF5/blob/425e719af8d85b543def01e49a6ef4048525dc59/cores/nRF5/wiring_analog.h#L74
Thanks! That did the trick. Calling analogReadResolution(12) once in Setup() routine, I now get back a 12-bit number (i.e. up to 4095) thereafter when I do an analogRead(...). :)
-
So, just did the experiment, and here are the results. Supplying 3.3v to the Ebyte Module, a voltage of 3.0 volts on A4 yields an analogRead(A4) of 4095. Less voltage on A4 yields a lower number.
So, generalizing, I suspect that the reference voltage for analogRead() is Vcc-0.3.
So, you either know Vcc, because of a voltage regulator or something, or else you must call hwCpuVoltage() to get what it is. Then, subtract 0.3v from that, and that's the reference voltage which corresponds to an analogRead() return value of 4095.
:)
-
I just did a quick and dirty measurement on the current consumption of the nRF52832 Ebyte module during sleep, and it measured 10 milliamps. I measured it using a uCurrent Gold. That's very high current for most battery powered applications. Can someone else here please measure it also and either confirm or refute?
I invoked sleep with this from the mocksensors sketch:
wait(SLEEP_TIME); //sleep a bitPerhaps there's a way to invoke a deeper sleep than that where less current is drawn?
-
I just did a quick and dirty measurement on the current consumption of the nRF52832 Ebyte module during sleep, and it measured 10 milliamps. I measured it using a uCurrent Gold. That's very high current for most battery powered applications. Can someone else here please measure it also and either confirm or refute?
I invoked sleep with this from the mocksensors sketch:
wait(SLEEP_TIME); //sleep a bitPerhaps there's a way to invoke a deeper sleep than that where less current is drawn?
-
@rmtucker said in nRF5 Bluetooth action!:
sleep(60000); // Sleeps for a minute in deep sleep
Thanks! That's a big improvement. I'm now reading 51uA. I did the measurements on the Ebyte nRF52832 module, powering it at 3.3v.
However, to be frank, that's still rather high compared to, say, an atmega328p with a RFM69 radio, which can have a combined sleep current of less than 1uA.
Is there anything more that can be done to lower the sleep current further?
-
@rmtucker said in nRF5 Bluetooth action!:
sleep(60000); // Sleeps for a minute in deep sleep
Thanks! That's a big improvement. I'm now reading 51uA. I did the measurements on the Ebyte nRF52832 module, powering it at 3.3v.
However, to be frank, that's still rather high compared to, say, an atmega328p with a RFM69 radio, which can have a combined sleep current of less than 1uA.
Is there anything more that can be done to lower the sleep current further?
-
@rmtucker said in nRF5 Bluetooth action!:
Is that a bare board with nothing connected (Not even serial)?
Yes. It's the bare Ebyte nRF52832 module. The only connections are Vcc and GND.
-
@rmtucker said in nRF5 Bluetooth action!:
Is that a bare board with nothing connected (Not even serial)?
Yes. It's the bare Ebyte nRF52832 module. The only connections are Vcc and GND.
-
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
-
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
@NeverDie said in nRF5 Bluetooth action!:
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
Did you use the same board definition in the IDE and the same script ?
-
@NeverDie said in nRF5 Bluetooth action!:
Interestingly, I just now tried the same measurement with one of these nRF52832 modules instead of the Ebyte module:
https://www.aliexpress.com/item/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-SMA-512K-FLASH-64K-RAM-pass-through/32798522093.html?spm=a2g0s.9042311.0.0.KKA3PF
and during sleep it measured 6uA. Quite a bit lower!Anyone know of a module which tests even lower than that?
Did you use the same board definition in the IDE and the same script ?
@Nca78 said in nRF5 Bluetooth action!:
Did you use the same board definition in the IDE and the same script ?
Yes.
-
@Nca78 said in nRF5 Bluetooth action!:
Did you use the same board definition in the IDE and the same script ?
Yes.
-
@NeverDie
Have you tried sleep and wait for an external interrupt instead of sleep and wake on timer?
Just in case it is the lfxtl that is causing the problem.@rmtucker said in nRF5 Bluetooth action!:
@NeverDie
Have you tried sleep and wait for an external interrupt instead of sleep and wake on timer?
Just in case it is the lfxtl that is causing the problem.Haven't tried that yet. Is there a library functional call for that, or do I need to start addressing the registers directly? With this new mpu, I feel like I'm learning to walk all over again.
-
@rmtucker said in nRF5 Bluetooth action!:
@NeverDie
Have you tried sleep and wait for an external interrupt instead of sleep and wake on timer?
Just in case it is the lfxtl that is causing the problem.Haven't tried that yet. Is there a library functional call for that, or do I need to start addressing the registers directly? With this new mpu, I feel like I'm learning to walk all over again.
-
@rmtucker said in nRF5 Bluetooth action!:
Try
sleep(digitalPinToInterrupt(10), FALLING,0);Unexpected result: using that as the sleep invocation, the infor-link module measures at 14ua while sleeping. i.e. worse, not better, compared to the 6ua measured earlier.
-
Looks as though the infor-link is using an A620N crystal:

I tried to see if I could find a datasheet for it, in the hope of learning what its current consumption is (or, at least, should be). Unfortunately, though, I couldn't find a datasheet for an A620N. -
Maybe it doesn't matter, because in looking at the actual module I received, it appears to use a different XTAL anyway: A649N.


-
Maybe from a current consumption standpoint, not using an external XTAL crystal, but rather relying on the nRF52832's internal resonator would draw less current? I know that's true for the atmega328p. If so, then that's a trade-off worth examining more carefully.
-
Maybe it doesn't matter, because in looking at the actual module I received, it appears to use a different XTAL anyway: A649N.


Sorry i have been a little distracted because my waveshare BLE400 and jlink just turned up.
Took a little time to get it running but i loaded up the mockmysensors sketch with all the sensors un commented and pow all 30 odd sensors showed up in domoticz which made me chuckle.
Anyway post your sketch for the consumption testing and i will put it in and see if it works on my board.
The only problem is i can not unplug it from the Ble400 because i have no way of connecting wires to the core board because of the smaller pitch pins.