Team Meeting 10.24.2015
- projectsilversteps
- Oct 24, 2015
- 3 min read

Today during the team meeting, Roy and Karly focused on issues that had been occuring with the bluetooth LE shield. Currently, they had been having issues with transmission. The arduino application would indicate that the device was connected, however when trying to connect to the device from their phones, it was not feasible because the device would not appear as an avilable bluetooth connection. To solve the issue, they soldered the device to the pins that connected the chip to establish a better electrical connection. They then connected the device as shown in the breadboard diagram below.

The diagram shows that the bluetooth LE shield is powered by the 5V supply and grounded on the Arduino. The SCK connects to the SPI clock which on the Arduino is the Digital 13 pin. MISO connectos to the SPI MISO which is the Digital 12 pin. The Digital 11 pin is the SPI MOSI where the MOSI is connected to. REQ is connected to the Digital 10 pin and the RST is the Digital 9 pin. Finally, RDY is the interrupt out from teh nRF8001 and must be connected to an interrupt pin which in this case is the Digital 2 pin. The image below is our circuit:

Once the device was soldered, connected appropriately, and powered, we were able to establish a connection to it with our iOS iPhone 6. Now, we needed to test the bluetooth connection to ensure that data could be transmitted and received. This is important because we will be needing the connection to send analog accelerometer data from the circuit to the SAMI database. To test the connection we used the following code:
// This version uses call-backs on the event and RX so there's no data handling in the main loop!
Adafruit_BLE_UART uart = Adafruit_BLE_UART(ADAFRUITBLE_REQ, ADAFRUITBLE_RDY, ADAFRUITBLE_RST);
/**************************************************************************/ /*!
This function is called whenever select ACI events happen */
/**************************************************************************/ void aciCallback(aci_evt_opcode_t event) {
switch(event) {
case ACI_EVT_DEVICE_STARTED: Serial.println(F("Advertising started"));
14
break; case ACI_EVT_CONNECTED:
Serial.println(F("Connected!"));
break; case ACI_EVT_DISCONNECTED:
Serial.println(F("Disconnected or advertising timed out"));
break; default: break;
} }
/**************************************************************************/ /*!
This function is called whenever data arrives on the RX channel */
/**************************************************************************/ void rxCallback(uint8_t *buffer, uint8_t len) {
Serial.print(F("Received ")); Serial.print(len); Serial.print(F(" bytes: ")); for(int i=0; i<len; i++)
Serial.print((char)buffer[i]); Serial.print(F(" ["));
for(int i=0; i<len; i++) {
Serial.print(" 0x"); Serial.print((char)buffer[i], HEX); }
Serial.println(F(" ]"));
/* Echo the same data back! */
uart.write(buffer, len); }
/**************************************************************************/ /*!
Configure the Arduino and start advertising with the radio */
/**************************************************************************/ void setup(void)
15
{ Serial.begin(9600); while(!Serial); // Leonardo/Micro should wait for serial init Serial.println(F("Adafruit Bluefruit Low Energy nRF8001 Callback Echo demo"));
uart.setRXcallback(rxCallback); uart.setACIcallback(aciCallback); // uart.setDeviceName("NEWNAME"); /* 7 characters max! */ uart.begin();
}
/**************************************************************************/ /*!
Constantly checks for new events on the nRF8001 */
/**************************************************************************/ void loop() {
uart.pollACI(); }
This code essentially is an echo. From our phones we can transmit up to 20 bits/sec. In this case we sent a small message to the bluetooth circuit, the device received the message, processed it, and then transmitted it back to our phones in an 'echo'. To test the connection we texted 'hello' to the circuit. We recieved a 'hello' echo back from the device meaning that it is connected and can transmit data.
Now that the bluetooth LE shield is working and connected the next step is to connect the functioning accelerometer and bluetooth shield simultaneously. This is the first hardware integration step. Once the components are integrated and fully powered, we will then establish the connection toe the SAMI website and our hip connector prototype will then be deemed fully functional.
コメント