Tuesday, December 9, 2014

arduino project

I'm working on an idea for my own BMS (battery management system), here is some details on my initial research:

last night I started prototyping with this device I purchased ($20)
http://www.rfduino.com/product/rfd22102-rfduino-dip/

I originally purchased an adafruit BLE shield to use with a Arduino Micro/Trinket but I broke it during assembly/testing. So the RFduino will be the first proto child.

Step 1 initial software setup: I got the RFduino loaded up with a template "sketch" software and broadcasting from a standalone battery. the template looks similar to this: https://github.com/RFduino/RFduino/b...e/Template.ino

Step2: communication: Got the free tester Android app installed and was able to send and receive data to my phone. link to Andriod tester: https://github.com/lann/RFDuinoTest/releases

added code to Arduino sketch code template:

void RFduinoBLE_onReceive(char *data, int len)
{
// anytime we receive a char from Andriod we send back the only useful data we have at the moment
//read pins 5 and 6 and report integer from 0 to 1023

int vlt;
vlt = analogRead(6);
RFduinoBLE.send(vlt);
vlt = analogRead(5);
RFduinoBLE.send(vlt);
}

step3: measure something real and report.
I learned the microcontroler cannot measure it's own supply voltage without help. Either use a voltage divider or an external reference. The divider formula is?
Vout = Vin * (R2 / (R2 + R1)) *edit* due to voltage sag this could be too innacurate except in comparing relative readings across all cells. For any decisions on shunting/balancing, we would need to multiply and regulate the supply? so measurements can be useful.

step4: see if the measurement can be added to the bluetooth broadcasted device name so there is no connection needed and the andriod device can simply scan all device names, then pick one to connect to when desired. eg.

RFduinoBLE.advertisementData = "vCell1"; //but real voltage in there somewhere

No comments:

Post a Comment