ADC converting of the node B-L072Z-LRWAN1

Hi,

I use the node B-L072Z-LRWAN1 with the example “end node” of the stack “STM32CubeExpansion_LRWAN”, the objectif it’s to send data of sensor to lora server. and I managed to send “int” or "floa"t without problem to my lora server as first step.

on the other hand, I made a program of polling data acquisition of temperature sensor with the adc of the “B-L072Z-LRWAN1” thanks to STM32CubeMX, and it’s working well.

Unfortunately I do not know how integrated all the code that STM32CubeMX generated in the project “end node” to send data from adc, Normally the program should have used sensor data, but I’m not sure how to set up acquisitions, there are too many functions !! have some one ever had the opportunity to work with this program ?

Hello,

in the end_node demo (BL072Z-LRWAN1) you have an example which works with the shield nucleo-IKSA02, it use a temperature sensor with the ADC, maybe you can leverage on this and perform your own modification?

Hi,

Thanks for your reply, well i will try, but i can’t find wich gpio a should use ! i have analog température sensor, i have find the function i should use " BSP_sensor_Init( void )" and " BSP_sensor_Read( sensor_t *sensor_data)" but it’s still not really clear ! i must enable some variable, to use the two function

the nucleo-IKSA02 communicate in I2C, in my case, i have to use the adc of the BL072Z-LRWAN1 !

In the main.c you will find a function which "uint8_t HW_GetBatteryLevel( void )" Go to definition of HW_GetBatteryLevel in mlm32l0xx_hw.c and here you will find HW_AdcReadChannel( ADC_CHANNEL_VREFINT ); function, go to definition of this function always in mlm32l0xx_hw.c and here you will find an example.

Keep mind that in this example Vrefint is used, so it’s an internal channel, in your case you will use an external channel. You should also initialize your ADC according your needs, looking for HW_AdcInit( ); function in i-cube-lrwan or look how did you with STM32cubeMX.

Plz if you need more information send me a private message this topic does not really relate to the loraserver.

1 Like

HI ,

I just find the same solution before you propose it, thanks very much for you help :slight_smile: !! well, i will check the configuration of the ADC in `HW_AdcInit( );

Next step, i will try to use I2C sensor

!!! resolved !!!

1 Like