{"id":7201,"date":"2013-02-26T22:03:51","date_gmt":"2013-02-27T03:03:51","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=7201"},"modified":"2013-04-12T23:36:53","modified_gmt":"2013-04-13T03:36:53","slug":"i2c-eeprom-plus-temperature-sensor-breakout-board","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/i2c-eeprom-plus-temperature-sensor-breakout-board\/","title":{"rendered":"I2C EEPROM plus Temperature Sensor breakout board"},"content":{"rendered":"<p>This tiny breakout board carries Microchip&#8217;s 24LC512 EEPROM and MCP9802 temperature sensor devices, both of which support I2C protocol. This board can be used for both sensing the ambient temperature and storing it. The MCP9802 is a digital temperature sensor with an user-selectable resolution from 9 to 12 bit. It can measure temperature ranging from -55\u00b0C to +125\u00b0C and notifies the host microcontroller when the ambient temperature exceeds a user programmed set point through its ALERT output pin. This board allows you to store up to 32000 temperature samples when you use the sensor in high resolution mode (12-bit, 0.0625\u00b0C) with each sample stored as two bytes.<\/p>\n<div id=\"attachment_7203\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7203\" class=\"size-full wp-image-7203\" title=\"I2CBoard3\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard3.jpg\" alt=\"\" width=\"560\" height=\"386\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard3.jpg 560w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard3-550x379.jpg 550w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-7203\" class=\"wp-caption-text\">I2C EEPROM and Temperature sensor board<\/p><\/div>\n<p><!--more--><\/p>\n<div><strong>Features:<\/strong><\/div>\n<div>\n<ul>\n<li><span style=\"font-size: 13px; line-height: 19px;\">Small PCB layout (0.95&#8243; X 0.65&#8243;)<\/span><\/li>\n<li><span style=\"font-size: 13px; line-height: 19px;\">\u00b11\u00b0C temperature measurement accuracy from -10\u00b0C to +85\u00b0C<\/span><\/li>\n<li><span style=\"font-size: 13px; line-height: 19px;\">Operating voltage range +2.7V to +5.5V<\/span><\/li>\n<li><span style=\"font-size: 13px; line-height: 19px;\">Pin headers with standard 0.1&#8243; spacing for breadboarding<\/span><\/li>\n<li><span style=\"font-size: 13px; line-height: 19px;\">I2C pull-up resistors and decoupling capacitors on board<\/span><\/li>\n<li><span style=\"font-size: 13px; line-height: 19px;\">User-selectable 9- to 12-bit temperature measurement resolution<\/span><\/li>\n<\/ul>\n<\/div>\n<div>\n<p><strong>Applications:<\/strong><\/p>\n<ul>\n<li>Temperature monitoring, controlling, and logging<\/li>\n<li>Learning and practicing I2C protocol<\/li>\n<li>Rapid prototyping with Microchip&#8217;s serial EEPROM and MCP9802 temperature sensor<\/li>\n<\/ul>\n<\/div>\n<div id=\"attachment_7202\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7202\" class=\"size-full wp-image-7202\" title=\"I2CBoard2\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard2.jpg\" alt=\"\" width=\"565\" height=\"418\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CBoard2-550x406.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7202\" class=\"wp-caption-text\">I2C EEPROM + Temperature Sensor breakout board<\/p><\/div>\n<div id=\"attachment_7204\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CEEPROM_plus_Sensor_Board_Circuit.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7204\" class=\"size-full wp-image-7204\" title=\"I2CEEPROM_plus_Sensor_Board_Circuit\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CEEPROM_plus_Sensor_Board_Circuit.jpg\" alt=\"\" width=\"565\" height=\"371\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CEEPROM_plus_Sensor_Board_Circuit.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/I2CEEPROM_plus_Sensor_Board_Circuit-550x361.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7204\" class=\"wp-caption-text\">Circuit diagram of I2C EEPROM and temperature sensor breakout board<\/p><\/div>\n<p>We are accepting preorders for this breakout board through a <strong><a href=\"https:\/\/tindie.com\/shops\/rajbex\/i2c-eeprom-temperature-sensor-module\/\" target=\"_blank\">Fundraising Campaign on Tindie<\/a><\/strong>. If you are interested, you can preorder it for $9.00. Interfacing examples for Arduino and PIC microcontrollers will be posted soon.<\/p>\n<p><strong>Update (April 4, 2013)<\/strong><\/p>\n<p>The funding campaign was successful and all orders have been shipped out today. Thank you for supporting the campaign.<\/p>\n<p>Note that the 7-bit slave addresses of the two I2C devices on board are as follows:<\/p>\n<p>MCP9802 sensor: 0x48<br \/>\n24LC512 EEPROM: 0x50<\/p>\n<p>Here&#8217;s a simple Arduino sketch to read temperature from the MCP9802 device and send it to PC through serial port.<\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"c\" style=\"font-family:monospace;\"><span style=\"color: #339933;\">#include &lt;Wire.h&gt;<\/span>\n&nbsp;\n<span style=\"color: #339933;\">#define address 0x48   \/\/I2C address of MCP9802<\/span>\n<span style=\"color: #339933;\">#define baudrate 9600  \/\/ Baud rate for serial communication <\/span>\n<span style=\"color: #993333;\">int<\/span> TempByte1<span style=\"color: #339933;\">,<\/span> TempByte2<span style=\"color: #339933;\">;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> setup<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\nWire.<span style=\"color: #202020;\">begin<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\nSerial.<span style=\"color: #202020;\">begin<\/span><span style=\"color: #009900;\">&#40;<\/span>baudrate<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n<span style=\"color: #666666; font-style: italic;\">\/\/ Write to Configuration Register <\/span>\nWire.<span style=\"color: #202020;\">beginTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span>address<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\nWire.<span style=\"color: #202020;\">write<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x01<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Address to Configuration register<\/span>\nWire.<span style=\"color: #202020;\">write<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x64<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ ADC resolution: 12-bit,<\/span>\nWire.<span style=\"color: #202020;\">endTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> loop<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n&nbsp;\n<span style=\"color: #666666; font-style: italic;\">\/\/ Read temperature <\/span>\nWire.<span style=\"color: #202020;\">beginTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span>address<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\nWire.<span style=\"color: #202020;\">write<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#40;<\/span>byte<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #208080;\">0x00<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Pointer to temperature register<\/span>\nWire.<span style=\"color: #202020;\">endTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\nWire.<span style=\"color: #202020;\">beginTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span>address<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\nWire.<span style=\"color: #202020;\">requestFrom<\/span><span style=\"color: #009900;\">&#40;<\/span>address<span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">2<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Now read two bytes of temperature data<\/span>\n<span style=\"color: #b1b100;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span>Wire.<span style=\"color: #202020;\">available<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n  TempByte1 <span style=\"color: #339933;\">=<\/span> Wire.<span style=\"color: #202020;\">read<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  TempByte2 <span style=\"color: #339933;\">=<\/span> Wire.<span style=\"color: #202020;\">read<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n  <span style=\"color: #993333;\">int<\/span> Temperature <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#40;<\/span>TempByte1 <span style=\"color: #339933;\">&lt;&lt;<\/span> <span style=\"color: #0000dd;\">8<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #339933;\">|<\/span> TempByte2<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Temperature <span style=\"color: #339933;\">=<\/span> Temperature <span style=\"color: #339933;\">&gt;&gt;<\/span> <span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #993333;\">float<\/span> TempC <span style=\"color: #339933;\">=<\/span> <span style=\"color:#800080;\">1.0<\/span><span style=\"color: #339933;\">*<\/span>Temperature<span style=\"color: #339933;\">*<\/span><span style=\"color:#800080;\">0.0625<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #993333;\">float<\/span> TempF <span style=\"color: #339933;\">=<\/span> TempC<span style=\"color: #339933;\">*<\/span><span style=\"color:#800080;\">1.8<\/span><span style=\"color: #339933;\">+<\/span><span style=\"color:#800080;\">32.0<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot; Temperature= &quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span>TempC<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot; C, &quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">print<\/span><span style=\"color: #009900;\">&#40;<\/span>TempF<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Serial.<span style=\"color: #202020;\">println<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot; F&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #b1b100;\">else<\/span><span style=\"color: #009900;\">&#123;<\/span>\n  Serial.<span style=\"color: #202020;\">println<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #ff0000;\">&quot;No response &quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\nWire.<span style=\"color: #202020;\">endTransmission<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\ndelay<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p>And here&#8217;s the output as displayed on the Serial Monitor terminal window.<br \/>\n<div id=\"attachment_7353\" style=\"width: 477px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/04\/MCP9802OP.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7353\" class=\"size-full wp-image-7353\" title=\"MCP9802OP\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/04\/MCP9802OP.png\" alt=\"\" width=\"467\" height=\"473\" \/><\/a><p id=\"caption-attachment-7353\" class=\"wp-caption-text\">Temperature readings displayed on Serial Monitor terminal window<\/p><\/div><br \/>\nVisit the following links for Arduino examples to read\/write to the I2C EEPROM devices.<br \/>\n<a href=\"http:\/\/fritzing.org\/projects\/readwrite-serial-eeprom-via-i2c\/\" target=\"_blank\">http:\/\/fritzing.org\/projects\/readwrite-serial-eeprom-via-i2c\/<\/a><br \/>\n<a href=\"http:\/\/playground.arduino.cc\/code\/I2CEEPROM\" target=\"_blank\">http:\/\/playground.arduino.cc\/code\/I2CEEPROM<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tiny breakout board carries Microchip&#8217;s 24LC512 EEPROM and MCP9802 temperature sensor devices, both of which support I2C protocol. This board can be used for both sensing the ambient temperature and storing it. The MCP9802 is a digital temperature sensor with an user-selectable resolution from 9 to 12 bit. It can measure temperature ranging from -55\u00b0C to +125\u00b0C and notifies the host microcontroller when the ambient temperature exceeds a user programmed set point through its ALERT output pin. This board allows you to store up to 32000 temperature samples when you use the sensor in high resolution mode (12-bit, 0.0625\u00b0C)<\/p>\n","protected":false},"author":1,"featured_media":7202,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150,245,367,437],"tags":[548,549,267,102],"class_list":["post-7201","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-2","category-embedded-lab-projects","category-mcu-develeopment-tools","category-products","tag-i2c-sensor","tag-mcp9802","tag-serial-eeprom","tag-temperature-sensor"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=7201"}],"version-history":[{"count":16,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7201\/revisions"}],"predecessor-version":[{"id":7363,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7201\/revisions\/7363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/7202"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=7201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=7201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=7201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}