CE215119 - BLE Battery Level with PSoC 4 BLE instead of PSoC 6 BLE

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AnCo_2736831
Level 4
Level 4
25 likes received 10 likes received 10 likes given

Hi All,

I have come across a sample program from the Cypress Website that focuses on the BLE Battery Level. However, this program only allows PSoC 6 BLE, whereas I need to use PSoC 4 BLE for it. Here is a link to the website:

http://www.cypress.com/documentation/code-examples/ce215119-ble-battery-level-psoc-6-ble

When I downloaded the program and tried to change the 'Device Selector' from the original device to whatever PSoC programming board I was using (CY8C4247LQI-BL483), I got an error message saying that the new device I have chosen is not compatible with the one that was already there.

Is there any way to fix this, or can I not use PSoC 4 BLE for this program?

Thanks,

Andrew Collins

0 Likes
1 Solution
ShengY_96
Employee
Employee
10 sign-ins 5 sign-ins Welcome!

Andrew

CE215119 is the demo code for PSoC6 BLE. There is an example code called BLE_Battery_Level for PSoC4 BLE also. Please follow the steps to find the PSoC4 BLE's demo code: Open Creator->File->Code examples-> Device family:PSoC 4200 BLE, filter by: BLE_Battery_Level-> Create project.

As in CE215119, there exists a demo code's user guide, followed the user guide's steps and you can import the demo code into PSoC4 BLE also. The profile and theory should be similar but the firmware should be tinny difference.

Regards

Jenson

View solution in original post

5 Replies
ShengY_96
Employee
Employee
10 sign-ins 5 sign-ins Welcome!

Andrew

CE215119 is the demo code for PSoC6 BLE. There is an example code called BLE_Battery_Level for PSoC4 BLE also. Please follow the steps to find the PSoC4 BLE's demo code: Open Creator->File->Code examples-> Device family:PSoC 4200 BLE, filter by: BLE_Battery_Level-> Create project.

As in CE215119, there exists a demo code's user guide, followed the user guide's steps and you can import the demo code into PSoC4 BLE also. The profile and theory should be similar but the firmware should be tinny difference.

Regards

Jenson

Could you send a hardware wiring diagram for connecting a 4.8V (1.2VX4) or 6V (1.5VX4) battery to the PSOC4 BLE through ADC SAR?

Do you have a PSOC4 BLE program to measure the voltage and monitor the charge of the battery?

Thanks,

Andrew Collins

Q:Could you send a hardware wiring diagram for connecting a 4.8V (1.2VX4) or 6V (1.5VX4) battery to the PSOC4 BLE through ADC SAR?

A:If the Vref=1.024V is used for ADC reference, we should set the battery sampling voltage between 0-1.024V. Like: connect the Battery + R1 + R2 +GND. Set the R1=5.7Mohm, R2=1Mohm. So when the Vbattery=6V, the sampling voltage =  6/(6.7)V=0.8955V. And the leakage current = 6/(6.7)uA.

Q:Do you have a PSOC4 BLE program to measure the voltage and monitor the charge of the battery?

A: I had no PSoC4 BLE program in hand.

Hi Yans,

That means we need to convert the 6V to become less than 1.024V by resistor divider network (connecting R1+R2 parallel to the battery) and measure the voltage across R2 (1MOhm) to do the voltage monitoring. For measuring the voltage, we will use the ADC example.

Thanks

Andrew Collins

0 Likes
Anonymous
Not applicable

Exactly. For measuring with the ADC, first convert your voltage from the value it is at to a value within the 0-1.024 volts range with a resistor divider network, and then calculate the voltage based on the percentage.

You can achieve a little more/less accuracy with the voltage reading by applying a slightly more complicated resistor network setup rather than a simple divider.