Skip to content

Commit 050a181

Browse files
committed
More edits
1 parent 8b466ba commit 050a181

File tree

1 file changed

+7
-74
lines changed

1 file changed

+7
-74
lines changed

content/hardware/01.mkr/01.boards/mkr-wifi-1010/tutorials/mkr-battery-app-note/mkr-battery-app-note.md

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'Understanding Battery Selection for the MKR boards'
2+
title: 'Understanding battery capabilities of the MKR 1010 WiFi'
33
difficulty: intermediate
44
description: 'Choose the correct battery for you MKR application.'
55
tags:
@@ -23,14 +23,12 @@ The goals of this project are to:
2323
- Distinguish between LiPo and Li-Ion batteries
2424
- Learn how to identify connector polarity
2525
- Understand how the SAMD chip reads battery voltage via a voltage divider
26-
- Export data to the Arduino IoT CLoud to read values in real time
2726

2827
### Hardware & Software Needed
2928
- [Arduino MKR WiFi 1010](https://store.arduino.cc/products/arduino-mkr-wifi-1010)
3029
- Multimeter
31-
- IDE 2.0
30+
- IDE 2.x
3231
- LiPo battery with JST-PH connector
33-
- Arduino IoT Cloud
3432

3533
### LiPo vs Fe vs Li-ion batteries
3634
Several different chemistries of rechargeable batteries are commerically avalible. The two main types are Li-Po and Li-Ion. Lithium Ion batteries have been around for a longer time and are generally cheaper. Lithium Polymer batteries have a higher energy density, allowing you to run your board longer with a similar sized battery.
@@ -46,13 +44,10 @@ You can see a comparison between these three in the table below.
4644
Apart from being a single cell (3.7V), a key factor to selecting the correct battery is that the connector is compatible.
4745

4846
### Connector
49-
<<<<<<< HEAD
5047
You can connect a battery to the MKR WIFI 1010 via a 2-pin JST-PH female connector. The PH varient of JST connectors are identified by a pin-to-pin distance of 2 mm. Here are several examples of LiPo batteries with a 2-pin JST-PH connector. Each individual connector is made of one plastic housing and two metal crimp terminals. A crimping device may be required. Note that when looking from above (with the notch facing you), the red (positive) wire should be on your left.
5148

5249
![JST-PH connector connected to the MKR WiFi 1010. Note that the positive terminal (red wire) is to the left, towards the PMIC](assets/battery-in-mkr.png)
53-
=======
5450
You can connect a battery to the MKR WIFI 1010 via a 2-pin JST-PH female connector. The PH varient of JST connectors are identified by a pin-to-pin distance of 2mm. Here are several examples of LiPo batteries with a 2-pin JST-PH connector. Each individual connector is made of one plastic housing and two metal crimp terminals. A crimping device may be required. Note that when looking from above (with the notch facing you), the red (positive) wire should be on your left.
55-
>>>>>>> 3faaafb6a75ff2500f060d68e60406d769408434
5651

5752
### Protection circuit
5853
A protection circuit cuts off the battery if overcurrent or under/over voltage is detected. This adds an additional layer of safety.
@@ -332,76 +327,14 @@ void loop()
332327

333328
***The battery must be connected to the MKR WIFI 1010 before connecting via USB, otherwise it may not work.***
334329

335-
**13.** Connect the MKR WIFI 1010 to the USB port of your PC. Make sure that the Arduino MKR WIFI 1010 is selected and that the port is correct. Upload the code to the board and open the terminal monitor. You will see a message similar to the following.
336-
337-
![Incoming battery voltage information via the Serial Terminal]()
338-
339-
340-
## Measure battery voltage via the Arduino IoT Cloud
341-
342-
Since we had connected the board via USB, the board is charging. In order to better realise the status of the battery in a more realistic environment, we will use the Arduino IoT Cloud. We will use three different dashboard elements to display the data.
343-
344-
**1.** In order to evaluate the performance of the device in a real world setting, we need to be able to test it remotely. To do so, we will use the Arduino Cloud to transfer data. The Arduino IoT Cloud makes it easy to create IoT solutions. In the free plan, you have to connect the board to the cable, but in a subscription plan, you can program the board wirelessly.
345-
346-
**2.** First, we will create a simple digital output to display the value of the ADC. Go to https://create.arduino.cc/iot/dashboards and click on **Create** to make a new dashboard and give it a name. Here, we are calling our dashboard MKR Remote Battery Status.
347-
348-
**3.** Click on the Add button and in the list and select the Value widget. You can also search by entering the name in the box. Click it in order to add it.
349-
350-
**4.** Name the widget raw ADC value. Then click on **Done**.
351-
352-
**5.** In order for the ADC value to be shown on the widget, we first need to configure the sketch to create a linked variable. A linked variable is a variable that is sent by your Arduino device to the cloud.
353-
354-
**6.** Go to the Devices tab and click on Add. Then Select Setup an Arduino device. Make sure your board is connected via a USB cable. If you have not done already, you may be requested to install the Arduino Create Adgent. Install it if needed.
355-
356-
**7.** After you have setup the device, go the the things tab. Click on the device you linked and add the sketch as well as the rawADC variable.
357-
358-
**8.** Upload the sketch
359-
360-
***If using a paid cloud account, you can send the sketch over the air. Otherwise, you will need to have the board conencted every time you upload a new sketch***
361-
362-
**9.** Now go to the dashboard, and link the variable to the value widget you made. You should see a four digit value.
363-
364-
**10.** Now let us link three other variables, in a similar manner. The upload again.
365-
366-
**11.** In the dashboard, we will create two objects. First, we create a chart. Select voltADC and voltBatt as the linked variables to display on the graph.
367-
368-
**12.** Then, add a Percentage widget and link the new_batt variable.
369-
370-
**13.** You now can view the battery status through a wide range of widgets.
371-
372-
<<<<<<< HEAD
373-
=======
374-
## Extract plots
375-
376-
**1.** In the Dashboard, click on the download historical data button to the right of your screen.
377-
378-
**2.** Click
379-
380-
**2.** Plot with Google Sheets
381-
382-
after i the usb port, the battery is disconnected as well? I have to reconnect battery for it to work? How are you supposed to charge it in a practical setting
383-
>>>>>>> 3faaafb6a75ff2500f060d68e60406d769408434
384-
385-
### Troubleshoot
386-
- You cannot upload OTA with
330+
**13.** Connect the MKR WIFI 1010 to the USB port of your PC. Make sure that the Arduino MKR WIFI 1010 is selected and that the port is correct. Upload the code to the board and open the terminal monitor. You will see information about the battery level displayed in the Serial monitor
387331

332+
388333
## Conclusion
334+
In this Application Note, you have gained an understanding of how the batteries connect to the MKR WiFi 1010, both physically via the JST-PH connector as well as the I2C-controlled BQ24195 IC. You can now select the correct battery capacity and configure it for your application.
389335

390336
## Further Ideas
391337

392-
- Try disabling the charging circuit with `code()` in order to read the voltage via serial without a WiFi connections
393-
- Save the values from the IoT cloud, and plot the change in voltage over time. What shape does the discharge function have?
338+
- Try disabling the charging circuit with `disableCharge()` in order to read the battery voltage, while it isn't charging
394339
- Try experimenting with different battery capacities, and see how long it can power your application.
395-
- ## Extract plots
396-
397-
**1.** In the Dashboard, click on the download historical data button to the right of your screen.
398-
399-
**2.** Clic
400-
401-
**2.** Plot with Google Sheets
402-
403-
after i the usb port, the battery is disconnected as well? I have to reconnect battery for it to work? How are you supposed to charge it in a practical setting
404-
405-
406-
## References
407-
battery charge level is tied to the voltage. don't need a table, but have explanation. depending on a battery used. from 4.2 to 4.0 and from 3.5 to 3.3 very little energy is released.
340+
- Send a just the `voltBat` over the serial and use the Serial Plotter to view the values as a graph.

0 commit comments

Comments
 (0)