AIN pin definition

Hi all

I would like to use the AIN pin on the base board (5005) to receive an analog microphone signal but I can not see documentation on how to define it in my code - would it just be WB_AIN?

Thanks, Garth

Welcome to the forum @garthpaine

Unfortunately the AIN pin on the base board is connected to the battery for voltage measurement and cannot be used for other purposes (a design flaw on the RAk5005-O).
On April 7th we launch a new base board, which is using another AIN port.

for the general usage of the analog ports, you can check our Battery example.
The two available analog inputs are defined as
WB_AIN0 (used for the battery readings)
WB_AIN1 (not exposed on the RAK5005-O)

Thanks Bernd

I note there are some available pins on the 4630. Looks like ANI2 and others - pins 39/40/41
Can I use those as analog input? I am trying to get a microphone with a lower frequency sensitivity and have a decent analog capsule, just need to get the signal into the code. Thanks, garth

Hello Garth (ASU?)

Pin 40 is WB_AIN0
Pin 39 is WB_AIN1
Pin 41 is used as WB_IO4 and is connected to the Slot C and IO slot as an GPIO.
It can be used as analog input unless used by another module.
But it is not exposed on a pin header. You would need our RAK13002 IO Module which exposes all signals on pin headers.

Hi Bernd, yes garth (ASU)

I thought that it looked from the technical specification that all three of these pins are available on the 4630 as solder pads. In this configuration I will probably not be using any other boards, although I may look at adding an enviro board for additional data. Are pins 39-41 available at 12bit? And what sample rate would you advise? 16KHz would be great.

Thanks, garth

Ps we just ordered another 25 wiseblock kits. Shame we are just a week ahead of the analog pins being available on a new base board :frowning:

Hi Garth,

The nRF52 ADC can be set to 8, 10, 12 or 14 bit. In the API I see only

analogReadResolution(); // set read resolution 8, 10, 12 or 14 bit
analogReference(); // set the reference voltage 3.6, 3.0, 2.4, 1.8, 1.2 or 0.6V
analogOversampling(); //  set oversampling 2x, 4x, 8x, 16x, 32x, 64x, 128x, 256x
analogSampleTime(); // set sample time 3, 5, 19, 15, 20 or 40 us

Yes, you can of course solder directly to the pins on the module, just be aware that there is no warranty after that.

For your order, the new base boards will not (yet) be sold in the starter kits. You need to order them separate.