This design will be all software, no hardware layout/ pcb manufacturing required.
Description: This system will be composed of 3 devices (Remote Bluetooth, Central Bluetooth, and the application board. The purpose of this system is to wirelessly observe remote events and provide accurate timestamps so that the application board knows at what time the event occurred according to its own internal time. While running the remote will also pass keep alive messages to the central, and the central will provide its own keep alive messages and remote status messages (based on remote keep alive) to the application board. When no longer necessary the central will also be able to put the remote into a standby mode to conserve battery life.
Event: GPIO pin raised high.
Event Clear: GPIO low
Remote/Central Communications: Event Timestamp, Event Clear Timestamp(Event and Event Clear message have a max latency of 20ms and preferably 10ms, the time stamps should provide time accurate to within 50 microseconds), I'm Alive message (error if no alive message for >100ms), Go to Active Observe message, Go to Standby message.
Central/Application Communications(Serial Based): Remote error message (no i'm alive for 100ms), go to active(send message to remote to go active), go to standby(message remote to go standby), Event occurred (Toggle GPIO and send time offset so accurate calculation for time of event occured),
Event Cleared (Same as previous), Remote ready (signifies to application remote has gone into active mode and is ready for observation)
Example walkthrough of system for an Event: The remote and central bluetooth's synchronize their clocks together using the Raw Radio API provided by Nordic (will link to example application). Let's say an even occur at time tick 620 of the remote (which should be syncronized to central), it produces and event message with a time stamp of 620. The central Receives the message somewhat later at its own time of time tick 830 (this time is not the one used) it goes to raise the GPIO tied to the application board high. It notes the time as 834 ticks and prepares an event occurred message sending the value 214 (830 - 620). On the application side it sees the gpio toggle, this generates an interrupt where the current time is noted and flag is generated waiting for the message.
After the message comes though the time for event is calculated as ( (time at interrupt) - (time ticks in event message)).
Central (Nrf52832 DK): Implements master/central bluetooth, serves as the master for time sync for raw radio as well. Communicates with the remote (as previously described) and controls connection. Communicates with application board as per described via UART and a generated message API.
Remote (NRF52832 DK): Implements slave/peripheral bluetooth, syncronizes clock with master by use of the Radio TimeSlot API. Generates I am alive messages, Event messages, and event clear messages based on a GPIO pin.
Application (probably arduino): Mostly used as a reference and for validation purposes that the time sync and event observation stacks work.
Verification: A common gpio pin will be tied to the input of both the application board and the input of the remote. The application board will output via UART (To pc console), a comparison of the time noted from its gpio and the one calculated from the remote. The times should be < 50 microseconds difference. The latency between the event occurring and the GPIO of the central toggling should be less than 15 milliseconds.
Link to time sync example: [login to view URL]
Sorry small mistake in description: In time example walkthrough calculated time should be (834 - 620). 834 being the time that the central toggled the gpio line to signify an event to the application board.
10 freelancers are bidding on average $668 for this job
Dear Sir, I have perfect experience in firmware programming for Bluetooth applications based on nRF51822. I can provide you full functioning codes for your project. Best Wishes