PsoC 5lp external battery

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

cross mob
Dimaty
Level 1
Level 1
First reply posted First question asked Welcome!

Hi,

I have a cy8ckit-059 and I would like to power it using a 3.7V battery previously used in a drone. I would like to have a button that turns the system on and off from the battery and also I would like the battery to be charged when the board is connected through the USB port. As I'm really a newbie to this world can you please guide to how can I make it work if it is at all possible?

The battery has all the required protections built in so if I connect it to a 5V 1A source (regular USB charger or PC) it can be charged without any trouble.

Thanks ahead for your help!

0 Likes
1 Solution

Dimaty,

Thanks for the feedback.

The battery you referenced may have overvoltage protection but it does not have a LiPo charging circuit.  

The charging board you referenced should do the trick.  It has a USB-C connector that can support > 0.5A input from a USB phone charging device with higher current output.

I figured you would be detaching the KitProg from the 059 kit.

If you would like to keep the charging circuit on the final assembly.  It is possible.

Len_CONSULTRON_0-1638713045565.png

There are a few reasons this may not be optimum especially if you are creating a device that requires long battery duration and light-weight.

  • The battery charging circuit weighs a few grams.
  • The battery always  connected to the PsoC and the battery charging circuit will discharge the battery even when not in use.  In drones, it is recommended to disconnect the battery when not in use.  You can also place an in-line switch to the B+ terminal of the battery.
  • The battery charge circuit takes up some space.

If you off-board the charging circuit, you can eliminate the issues above.

The VDD pin on the 059 can take in 1.7V to 5.5V.  You do have to be careful what circuits in the PsoC are powered.  The  analog circuits do not run very accurately if the voltage drops below 2.7V.  There is a ScBoost circuit inside the PsoC that can be enabled to allow for operation down to 1.7V

If you're using any ADCs, DO NOT use VDDA, VDDA/2, VDDA*2, etc as a reference..  Since VDDA is dependent on VDD, VDDA will drop with VDD.  Use the internal Vref of 1.024V as your reference.  This reference is mostly immune to VDDA drops down to 1.7V.

The Digital side of the PSoC is mostly immune to VDD drops.  Internally the digital circuits will successfully operate down to 1.7V with the following exceptions:  The maximum clocking speeds will be reduced as VDD drops. 

Consider what the voltage requirements of externally connected circuits to the PSoC.  They might be a more narrow range of operation.

In general, on battery operated applications, there are some highly recommended considerations:

  • Avoid using a crystal on ECO if you can.  Use the IMO (+/- 1% accuracy) at 3 MHz.  The crystal driver consumes more current.
  • PSoC active (non-sleep modes) current is highly dependent on the clocking rates to the CPU and the peripherals.  The higher the clocking rate, the higher the current consumption. Therefore:
    • Do not use the PLL.  Feed the IMO directly to the MASTER_CLK and BUS_CLK.
    • Keep the input clocks to peripherals (both Fix Function and UDB blocks) as low as practical.
  • If you absolutely need crystal accuracy, you can use the WCO with a 32.768 KHz watch crystal.  This can be better than +/-200 ppm accurate.
  • In your SW application, you might consider going to a low-power sleep mode as often as possible.  There are different low-power modes where the CPU can consume <5uA in this mode.  If you use even less current if you can tolerate CPU to be turned off and restarted.

Hopefully this covers many of your questions.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
9 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Dimaty,

I believe the general answer to your question "... is at all possible?" is: Yes.

Here are some design considerations.

I'm assuming your battery is a rechargeable LiPo battery.


The battery has all the required protections built in so if I connect it to a 5V 1A source (regular USB charger or PC) it can be charged without any trouble.


If there are protections as you indicate and can currently connect a USB charger to charge safely, this battery may contain a LiPo charger.  Can you supply the battery part number for me to confirm this assumption?

Normally batteries don't come with LiPo charging circuits.  If a LiPo charger is not included with the battery, then you need to design one.

The PSoC5LP IC does not have dedicated resources for a LiPo charger.   

You can connect an external LiPo charging circuit components.   I have no recommendations since I've never designed with one.  You might be able to buy a tiny LiPo charger PCB with the circuit.

If you're using a Cypress/Infineon kit like the CY8CKIT-059, it has a USB port and you can use the +5V from the VBUS pin on the USB connector.  There is a schematic for this kit available on the Cypress site.

Note:  The maximum current allowed from USB from a PC host (this also includes the VBUS connection on the kit) is 0.5A.  The special USB charging devices are designed to go up to 1A and is designed specifically for battery charging.

I believe it is possible to develop a LiPo charging circuit using the PsoC5LP as the charger controller.  This can be done with minimal components (eg. pass transistor/FET, current sense resistor, thermistor input).    If another expert who has achieved this can weight in, it would be appreciated.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len.

Thank you very much for your reply!  So the battery that I have is 3.7V 1800mAh and it is originally designed for a drone:

https://www.ebay.com/itm/353523739571?ssPageName=STRK%3AMEBIDX%3AIT&var=622813890618&_trksid=p206035...

 

This battery has over charge protection and short circuit protection and it can be charged in multiple ways such as computer, power bank and vehicle power supply.

I'm indeed using the CY8CKIT-059 kit, and according to its guide in section 4.2.3, I can connect an external power supply to the VDD pin of the target board. But than there is no way I can charge the battery as far as I understand. On the other hand I have the VDDIO that might be able to charge the battery but I'm not sure it will power the board. I see the VBUS pin on the KitProg but the idea is to separate the KitProg from the target board once I finish programming it, so I cannot use that pin. Using an external charging board like this one:

https://www.ebay.com/itm/154671218168?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2648

Is also not optimal for me as it will increase the overall size of my device. That is why I want to know if there is any option where I can connect the battery to the target board so it will power the board when it is not connected by the USB and if it is so the USB will power the board and charge the battery at the same time. If charging and powering the board at the same time is not possible I would like to at least be able to charge the battery once the USB is connected even if the board is not powered at this stage.

Thank you very much for you help!

0 Likes

Dimaty,

Thanks for the feedback.

The battery you referenced may have overvoltage protection but it does not have a LiPo charging circuit.  

The charging board you referenced should do the trick.  It has a USB-C connector that can support > 0.5A input from a USB phone charging device with higher current output.

I figured you would be detaching the KitProg from the 059 kit.

If you would like to keep the charging circuit on the final assembly.  It is possible.

Len_CONSULTRON_0-1638713045565.png

There are a few reasons this may not be optimum especially if you are creating a device that requires long battery duration and light-weight.

  • The battery charging circuit weighs a few grams.
  • The battery always  connected to the PsoC and the battery charging circuit will discharge the battery even when not in use.  In drones, it is recommended to disconnect the battery when not in use.  You can also place an in-line switch to the B+ terminal of the battery.
  • The battery charge circuit takes up some space.

If you off-board the charging circuit, you can eliminate the issues above.

The VDD pin on the 059 can take in 1.7V to 5.5V.  You do have to be careful what circuits in the PsoC are powered.  The  analog circuits do not run very accurately if the voltage drops below 2.7V.  There is a ScBoost circuit inside the PsoC that can be enabled to allow for operation down to 1.7V

If you're using any ADCs, DO NOT use VDDA, VDDA/2, VDDA*2, etc as a reference..  Since VDDA is dependent on VDD, VDDA will drop with VDD.  Use the internal Vref of 1.024V as your reference.  This reference is mostly immune to VDDA drops down to 1.7V.

The Digital side of the PSoC is mostly immune to VDD drops.  Internally the digital circuits will successfully operate down to 1.7V with the following exceptions:  The maximum clocking speeds will be reduced as VDD drops. 

Consider what the voltage requirements of externally connected circuits to the PSoC.  They might be a more narrow range of operation.

In general, on battery operated applications, there are some highly recommended considerations:

  • Avoid using a crystal on ECO if you can.  Use the IMO (+/- 1% accuracy) at 3 MHz.  The crystal driver consumes more current.
  • PSoC active (non-sleep modes) current is highly dependent on the clocking rates to the CPU and the peripherals.  The higher the clocking rate, the higher the current consumption. Therefore:
    • Do not use the PLL.  Feed the IMO directly to the MASTER_CLK and BUS_CLK.
    • Keep the input clocks to peripherals (both Fix Function and UDB blocks) as low as practical.
  • If you absolutely need crystal accuracy, you can use the WCO with a 32.768 KHz watch crystal.  This can be better than +/-200 ppm accurate.
  • In your SW application, you might consider going to a low-power sleep mode as often as possible.  There are different low-power modes where the CPU can consume <5uA in this mode.  If you use even less current if you can tolerate CPU to be turned off and restarted.

Hopefully this covers many of your questions.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len,

Thank you so much for your detailed response. You gave me a lot of things to think about that I didn't take in mind before. I especially liked your idea with the switch as well as putting the board to sleep in the application. About the constant voltage supply to the PSoC board, I thought about adding something like the next board to the output of the charging board before connecting it to the PSoC:

https://www.ebay.com/itm/313711958210?hash=item490ab098c2:g:NiMAAOSwToZcjJqD

This will ensure that the voltage to the PSoC is kept constant at 5V preventing all of the possible problems you mentioned I assume. Would be really great to hear what you think about that. Finally, I'm not 100% sure that I understood what you meant by off-board the charging circuit so if you could please elaborate a bit more it will be great.

I also have the CY8CPROTO-063-BLE module and in it's guide it says that the voltage to the board should be at most 3.3V if I understand correctly. So using the same scheme as you suggested here with the external charging circuit and the next board:

https://www.ebay.com/itm/192274826656?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2648

Do you think it will work fine?

Thanks a lot for all of your precious input! 

 

0 Likes

Dimaty,

Yes you can use a boost circuit on the Out+ and Out - of the charging circuit before it feeds VDD of the PSoC.  There are three downsides:

  • The boost converter is anywhere from 73% to 95% efficient meaning that 5% to 27% of the energy to boost the voltage is lost to heat.   That's generally a bad use of battery power.
  • The current needed to power the boost circuit is about 13uA.  This will be consumed even if using the sleep modes of the PSoC.  Note most PSoC5 sleep modes can go down as low as 5uA.
  • A boost circuit can be prone to some ripple added to the DC output.  For digital circuits, it's usually not an issue.  For analog circuits, this could be an issue if the layout and bypass caps are not properly thought out.

As I stated in my previous post, consider the goals of your design from an analog and digital perspective.  I might be possible to avoid the need of the boost circuit.   

Usually boost circuits are used to provide more extra operating range when the battery voltage drops below the operating level of the CPU.  The boost circuit will keep it higher.

In fact, the PSoC5 has internal circuitry for a boost circuit.  With two external components (cap and inductor) you can boost the VDD supply to a selectable voltage.  In addition, the boost circuit only kicks in with the battery voltage drops below the target level.  The PSoC5 on the CY8CKIT-059 has the pins for the boost circuit but they are disabled in the layout.  It would not be easy to modify the PCB to use these pins.  However with a new layout this can be achieved.

Here are two links to learn about the Boost Converter 

BoostConv component 

Boost Converter example code 

The PsoC5 CPU has an operating voltage of 1.7V to 5.5V.   If your design can tolerate the battery down to 1.7V, you might want to consider no boost.

About the PsoC6:  The PSoC6 voltage operating range is about 0.8V to 3.6V.  This will allow for a better voltage match to the battery output.

To state again ... proper design of your application HW needs may no require a voltage speed-up boost.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len,

Thanks again for your meaningful input! I will think all of these over.  In principle I'm trying to build a potentiostat with a three electrode configuration, working, reference and counter. I would like to apply voltage between the reference and working electrodes and measure the current between the counter and working electrodes. This is illustrated in the next image:

Dimaty_2-1638774825150.png

I'm trying to follow a work published in a scientific journal where they show how to do it:

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0201353

but instead of using the USB port to power the board and to get the data, I want to use a battery and to send the data over bluetooth so that the device can operate from a mobile phone and be portable meaning it can be applied outdoors where there is no means to connect it to a USB source.

Thank you very much I really appreciate all of your answers and input! 

 

0 Likes

Dimaty,

Thank you for the feedback.

I don't have a good understanding of your application.  Therefore, I can't speak to whether you need a constant VDD source or not.  (The DVACs used in the project you listed are somewhat ratiometric to VDDA.)

The project in the article uses the PSoC5.  Since you are targeting BLE as communication, a PSoC6 (PSoC63-family part) makes sense.  Porting a PSoC5 project to a PSoC6 is not usually seamless.   Not all components used are equivalent.  The PSoC6 does have an opamp, a 12-bit DAC, and a ADC but it doesn't have a TIA if this is needed.

This application seems very similar to another thread I posted to:  Square-Wave-Voltammetry 

I'm not totally sure I was much help in the long run.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Hi Len,

Thank you very much I think you helped me a lot especially to understand that it's not so easy and a lot of things need to be accounted for to achieve the desired results. I've read the thread you provided and it is similar in some ways so I will use it once I start building the system. Anyway I really appreciate all your time and effort and will probably come back with more questions in the future. By the way I was also thinking about buying and using the CY8CKIT-145-40XX PSoC® 4000S instead of the PSoC 6 board as it is more similar to the PSoC 5lp that is used in the paper and also has integrated Bluetooth capabilities. 

0 Likes

Dimaty,

You're welcome.  I hope the thread I pointed to is a good starting point.

Yes.  The  CY8CKIT-145-40XX has a BLE PROC.  However, the PsoC4s in general do not have as many internal resources.

You can use the PsoC Creator to begin to create your TopDesign schematics for the  CY8CKIT-145-40XX before you even buy the kit.   If you can complete the "Application Build" phase with no errors, then it stands to reason, the PsoC4 may be able to implement your application.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes