Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT+ in Arduino with nRF24AP2 - question about implementing…

RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Hi to all...
for a personal non commercial project I am trying to develop a system to acquire multiple ANT+ HRM via nRF24AP2 connected to an Arduino Pro Mini 3.3V 8MHz.
I am trying to use a Arduino library free developed by an internet user. The library is here: https://github.com/brodykenrick/ANTPlus_Arduino.
Testing it with a single ANT+ HRM it works fine. I can read the heart rate and display on a lcd panel.
I am trying to implement a searching mechanism to pair multiple ANT+ HRM sensors without success...

My problem is:
1) I can open with success a channel (tipically channel #0) and I can read data from it...
2) I can open with partial success a channel from 1... to 7 (the module nRF24AP2 is 8-channel type)... the partial success is given by the fact that after opening that channels nothig happens... the data does not acquire.

I need to read the Device Serial Number (16bits) and manage it so I can try to establish a connection with other HRM directly.
I need a search and a pair procedure.
Could someone help me? Could someone give me information or code scretch on how to search and obtain the device serial number list and a procedure to pair all available HRM found in the network near my Arduino/nRF24AP2 system?
Thanks to all...
     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Hello,

You can find more information on pairing with a device in the Device Pairing Application Note
http://www.thisisant.com/resources/an02-device-pairing

You can use the techniques outlined in the application note (e.g. wildcard search, proximity pairing) to establish the initial connection to the devices, and then request the channel ID and remember the value for future sessions.

Also, since you are planning on receiving from multiple heart rate devices, depending on your power budget, you may want to have a look at Continuous Scanning Mode and Background Scanning Channel. Please refer to the following application notes for detail
http://www.thisisant.com/resources/an11-ant-channel-search-and-background-scanning-channel/
http://www.thisisant.com/resources/an14-continuous-scanning-mode/      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Many thanks for your repaly.
I am studying the documentation, but I do not undestand how to search for all heart rate monitor presents in the room and only after I acquired the presence and then I can decide to establish connection for some of them.
     
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

In order to pair with ANY heart rate sensor nearby you'll set the serial number to 0 (wildcard), when opening the channel on the slave (= display device).
The FIRST sensor that is detected will be paired then.
You can then add this sensor to an "exclude list", when opening the next channel, so that it will be discarded and the next sensor will be found.
For comparison see ANTware II, tab "Inc/Exc list" in the channel configuration pane.
Note that not all ANT chips support this feature. There should be a bit in the capabilities list of the device to query this. It's all in the documentation smile

Cheers,
OMB
     
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Many thanks!