{"id":3088,"date":"2022-06-18T06:32:04","date_gmt":"2022-06-18T13:32:04","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3088"},"modified":"2022-06-18T06:32:04","modified_gmt":"2022-06-18T13:32:04","slug":"project-23-e-textiles-coin-cell-battery-mk08","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3088","title":{"rendered":"Project #23: E-Textiles &#8211; Coin Cell Battery &#8211; Mk08"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3088-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #BME280 #CCS811 #CoinCell #RTC #SD #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03a.png\" alt=\"Coin Cell Battery\" width=\"720\" height=\"597\" class=\"alignnone size-full wp-image-3090\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03a-300x249.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03b.png\" alt=\"Coin Cell Battery\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3091\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03c.png\" alt=\"Coin Cell Battery\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3092\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk03c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Coin Cell Battery Holder &#8211; 2 x CR2032 (Enclosed)<\/strong><\/p>\n<p>This is a simple coin cell battery holder that can enclose two CR2032 batteries inside itself, and safely kept closed via two phillips head screws. Each battery holder will run batteries in series, output up to 6V, and is equipped with an On\/Off slide switch and two 6&#8243; power wires (one positive and one negative) on the back.<\/p>\n<p><strong>DL2205Mk03<\/strong><\/p>\n<p>1 x FLORA &#8211; Version 1.0a<br \/>\n1 x SparkFun Environmental Combo CCS811\/BME280<br \/>\n1 x DS3231 Precision RTC FeatherWing<br \/>\n1 x MicroSD card breakout board+<br \/>\n1 x MicroSD card 8 Gb<br \/>\n1 x CR1220 Coin Cell Battery<br \/>\n1 x LED Red<br \/>\n1 x 220 Ohm<br \/>\n1 x Coin Cell Battery Holder &#8211; 2 x CR2032<br \/>\n2 x CR2032 Coin Cell Battery<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>FLORA &#8211; Version 1.0a<\/strong><\/p>\n<p>CLK &#8211; ICSP 3<br \/>\nDO &#8211; ICSP 1<br \/>\nDI &#8211; ICSP 4<br \/>\nCS &#8211; Digital 10<br \/>\nLER &#8211; Digital 6<br \/>\nSCL &#8211; Digital 3<br \/>\nSDA &#8211; Digital 2<br \/>\nVIN &#8211; +5V<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2205Mk03p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #23: E-Textiles - Coin Cell Battery - Mk08\r\n23-08\r\nDL2205Mk03p.ino\r\n1 x FLORA - Version 1.0a\r\n1 x SparkFun Environmental Combo CCS811\/BME280\r\n1 x DS3231 Precision RTC FeatherWing\r\n1 x MicroSD card breakout board+\r\n1 x MicroSD card 8 Gb\r\n1 x CR1220 Coin Cell Battery\r\n1 x LED Red\r\n1 x 220 Ohm\r\n1 x Coin Cell Battery Holder - 2 x CR2032\r\n2 x CR2032 Coin Cell Battery\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n#include &lt;SparkFunBME280.h&gt;\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n#include &lt;SparkFunCCS811.h&gt;\r\n\/\/ Date and time DS3231 RTC\r\n#include &lt;RTClib.h&gt;\r\n\/\/ Serial Peripheral Interface (SPI)\r\n#include &lt;SPI.h&gt;\r\n\/\/ Secure Digital (SD Card)\r\n#include &lt;SD.h&gt;\r\n\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\nBME280 myBME280;\r\n\/\/ Temperature Celsius\r\nfloat BMEtempC = 0;\r\n\/\/ Humidity\r\nfloat BMEhumid = 0;\r\n\/\/ Altitude Meters\r\nfloat BMEaltitudeM = 0;\r\n\/\/ Barometric Pressure\r\nfloat BMEpressure = 0;\r\n\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n\/\/ Default I2C Address\r\n#define CCS811_ADDR 0x5B \r\nCCS811 myCCS811(CCS811_ADDR);\r\n\/\/ eCO2\r\nfloat CCS811CO2 = 0;\r\n\/\/ TVOC\r\nfloat CCS811TVOC = 0;\r\n\r\n\/\/ Date and time functions using a DS3231 RTC\r\nRTC_DS3231 RTC;\r\nString sDate;\r\nString sTime;\r\n\r\n\/\/ Secure Digital (SD Card)\r\nconst int chipSelect = 10;\r\nString zzzzzz = &quot;&quot;;\r\n\r\n\/\/ LED Red\r\nconst int iLEDR = 6;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;23-08&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n  isBME280();\r\n\r\n  \/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n  isCCS811();\r\n\r\n  \/\/ Dates and Time\r\n  timeRTC();\r\n\r\n  \/\/ MicroSD Card\r\n  isSD();\r\n\r\n  \/\/ 1 Seconds\r\n  delay( 1000 );\r\n\r\n}\r\n<\/pre>\n<p><strong>getBME280.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n\/\/ isBME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\nvoid isBME280(){\r\n\r\n  \/\/ Temperature Celsius\r\n  BMEtempC = myBME280.readTempC();\r\n  \/\/ Humidity\r\n  BMEhumid = myBME280.readFloatHumidity() ;\r\n  \/\/ Altitude Meters\r\n  BMEaltitudeM = myBME280.readFloatAltitudeMeters();\r\n  \/\/ Barometric Pressure\r\n  BMEpressure = myBME280.readFloatPressure();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getCCS811.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ CCS811 - eCO2 &amp; tVOC\r\n\/\/ isCCS811 - eCO2 &amp; tVOC\r\nvoid isCCS811(){\r\n\r\n  \/\/ This sends the temperature &amp; humidity data to the CCS811\r\n  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);\r\n\r\n  \/\/ Calling this function updates the global tVOC and eCO2 variables\r\n  myCCS811.readAlgorithmResults();\r\n\r\n  \/\/ eCO2 Concentration\r\n  CCS811CO2 = myCCS811.getCO2();\r\n  \r\n  \/\/ tVOC Concentration\r\n  CCS811TVOC = myCCS811.getTVOC();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRTCDS3231.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ DS3231 Precision RTC\r\n\/\/ Setup RTC\r\nvoid setupRTC() {\r\n\r\n  \/\/ DS3231 Precision RTC   \r\n  RTC.begin();\r\n  if (! RTC.begin()) {\r\n    \r\n    while (1);\r\n    \r\n  }\r\n  \r\n  DateTime now = RTC.now();\r\n\r\n  if (RTC.lostPower()) {\r\n    \r\n    \/\/ Following line sets the RTC to the date &amp; time this sketch was compiled\r\n    RTC.adjust(DateTime(F(__DATE__), F(__TIME__)));\r\n    \/\/ This line sets the RTC with an explicit date &amp; time, for example to set\r\n    \/\/ August 2, 2021 at 13:53:0 you would call:\r\n    \/\/ RTC.adjust(DateTime(2022, 4, 26, 11, 39, 0));\r\n    \r\n  }\r\n  \r\n}\r\n\/\/ timeRTC\r\nvoid timeRTC() {\r\n\r\n    \/\/ DS3231 Precision RTC\r\n    sDate = &quot;&quot;;\r\n    sTime = &quot;&quot;;\r\n    \/\/ Date Time\r\n    DateTime now = RTC.now();\r\n\r\n    \/\/ sData\r\n    sDate += String(now.year(), DEC);\r\n    sDate += &quot;\/&quot;;\r\n    sDate += String(now.month(), DEC);\r\n    sDate += &quot;\/&quot;;\r\n    sDate += String(now.day(), DEC);\r\n  \r\n    \/\/ sTime\r\n    sTime += String(now.hour(), DEC);\r\n    sTime += &quot;:&quot;;\r\n    sTime += String(now.minute(), DEC);\r\n    sTime += &quot;:&quot;;\r\n    sTime += String(now.second(), DEC);\r\n\r\n}\r\n<\/pre>\n<p><strong>getSD.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ MicroSD Card\r\n\/\/ MicroSD Setup\r\nvoid setupSD() {\r\n\r\n    \/\/ MicroSD Card\r\n   \/\/ See if the card is present and can be initialized:\r\n  if (!SD.begin(chipSelect)) {\r\n\r\n    \/\/ Don&#039;t do anything more:\r\n    while (1);\r\n    \r\n  }\r\n\r\n}\r\n\/\/ MicroSD Card\r\nvoid isSD() {\r\n\r\n  zzzzzz = &quot;&quot;;\r\n\r\n  \/\/ Version|Date|Time|Temperature Celsius|Humidity|Altitude Meters|Barometric Pressure\r\n  \/\/|eCO2 Concentration|tVOC Concentration|\r\n  zzzzzz = sver + &quot;|&quot; + sDate + &quot;|&quot; + sTime + &quot;|&quot; \r\n  + BMEtempC + &quot;|&quot; + BMEhumid + &quot;|&quot; + BMEaltitudeM + &quot;|&quot; + BMEpressure + &quot;|&quot;\r\n  + CCS811CO2 + &quot;|&quot; + CCS811TVOC + &quot;|&quot;;\r\n\r\n  \/\/ Open the file. Note that only one file can be open at a time,\r\n  \/\/ so you have to close this one before opening another.\r\n  File dataFile = SD.open(&quot;DLE22Log.txt&quot;, FILE_WRITE);\r\n\r\n  \/\/ If the file is available, write to it:\r\n  if (dataFile) {\r\n    \r\n    \/\/ Write\r\n    dataFile.println( zzzzzz );\r\n    dataFile.close();\r\n\r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n  \r\n  \/\/ Set up I2C bus\r\n  Wire.begin();\r\n\r\n  \/\/ Delay\r\n  delay( 50 );\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Altitude and Barometric Pressure\r\n  myBME280.begin();\r\n\r\n  \/\/ CCS811 - eCO2 &amp; tVOC\r\n  myCCS811.begin();\r\n\r\n  \/\/ Setup RTC\r\n  setupRTC();\r\n\r\n  \/\/MicroSD Card\r\n  setupSD();\r\n\r\n  \/\/ LED Red\r\n  pinMode( iLEDR , OUTPUT);\r\n  \/\/ Turn the LED Red on HIGH\r\n  digitalWrite( iLEDR , HIGH);\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor and E-Mentor<\/strong><\/p>\n<ul>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2022 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #BME280 #CCS811 #CoinCell #RTC #SD #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Coin Cell Battery Holder &#8211; 2 x CR2032 (Enclosed) This is a simple coin cell battery holder that can enclose two CR2032 batteries inside itself, and safely kept closed via two phillips head screws. &#8230; <a title=\"Project #23: E-Textiles &#8211; Coin Cell Battery &#8211; Mk08\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3088\" aria-label=\"Read more about Project #23: E-Textiles &#8211; Coin Cell Battery &#8211; Mk08\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[208,47,50,49,38,59,5,58,10,43],"tags":[86,6,92,220,102,4,212,19,85,24,9,27,109,33,34,213],"class_list":["post-3088","post","type-post","status-publish","format-standard","hentry","category-e-textiles","category-adafruit","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-battery","tag-coin-cell-battery","tag-components","tag-consultant","tag-e-textiles","tag-electronics","tag-fritzing","tag-microcontroller","tag-programming","tag-projects-2","tag-sparkfun","tag-technology","tag-video-blog","tag-wearable"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3088"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3088\/revisions"}],"predecessor-version":[{"id":3093,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3088\/revisions\/3093"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}