{"id":3081,"date":"2022-06-11T06:23:55","date_gmt":"2022-06-11T13:23:55","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3081"},"modified":"2022-06-11T06:23:55","modified_gmt":"2022-06-11T13:23:55","slug":"project-23-e-textiles-microsd-card-mk07","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3081","title":{"rendered":"Project #23: E-Textiles &#8211; MicroSD Card &#8211; Mk07"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3081-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #ETextiles #Wearable #FLORA #BME280 #CCS811 #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\/DL2205Mk01a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01a.png\" alt=\"MicroSD Card\" width=\"720\" height=\"571\" class=\"alignnone size-full wp-image-3083\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01a-300x238.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\/DL2205Mk01b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01b.png\" alt=\"MicroSD Card\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3084\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01b-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\/DL2205Mk01c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01c.png\" alt=\"MicroSD Card\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3085\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/06\/DL2205Mk01c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>MicroSD Card Breakout Board+<\/strong><\/p>\n<p>Not just a simple breakout board, this microSD adapter goes the extra mile designed for ease of use.<\/p>\n<ul>\n<li>Onboard 5 Volt &#8211; 3 Volt regulator provides 150mA for power-hungry cards.<\/li>\n<li>3 Volt level shifting means you can use this with ease on either 3 Volt or 5 Volt systems.<\/li>\n<li>Uses a proper level shifting chip, not resistors, less problems, and faster read\/write access.<\/li>\n<li>Use 3 or 4 digital pins to read and write 8 Gb of storage.<\/li>\n<li>Activity LED lights up when the SD card is being read or written.<\/li>\n<li>Push-push socket with card slightly over the edge of the PCB so its easy to insert and remove.<\/li>\n<li>Comes with 0.1&#8243; header, unattached, so you can get it on a breadboard or use wires your choice.<\/li>\n<\/ul>\n<p>To use with an Arduino, connect GND to ground, 5 Volt &#8211; 3 Volt to 5 Volt &#8211; 3 Volt, CLK to pin 13, DO to pin 12, DI to pin 11, and CS to pin 10. Then you can use the Arduino IDE&#8217;s SD library which supports FAT and FAT32 SD cards. <\/p>\n<p><strong>DL2205Mk01<\/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 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>DL2205Mk01p.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 - MicroSD Card - Mk07\r\n23-07\r\nDL2205Mk01p.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 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-07&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 #RTC #SD #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; MicroSD Card Breakout Board+ Not just a simple breakout board, this microSD adapter goes the extra mile designed for ease of use. Onboard 5 Volt &#8211; 3 Volt regulator provides 150mA for power-hungry cards. 3 &#8230; <a title=\"Project #23: E-Textiles &#8211; MicroSD Card &#8211; Mk07\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3081\" aria-label=\"Read more about Project #23: E-Textiles &#8211; MicroSD Card &#8211; Mk07\">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,102,4,212,19,85,24,182,9,27,109,33,34,213],"class_list":["post-3081","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-components","tag-consultant","tag-e-textiles","tag-electronics","tag-fritzing","tag-microcontroller","tag-microsd-card","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\/3081","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=3081"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3081\/revisions"}],"predecessor-version":[{"id":3086,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3081\/revisions\/3086"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}