Difference between revisions of "Thermo Cup"

From Microduino Wiki
Jump to: navigation, search
(Hardware Buildup)
 
(6 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
|
 
|
 
==Objective==
 
==Objective==
This cup can "sense" water temperature and present light based on program setting with different color.  
+
This cup can "sense" water temperature and present different colors according to program settings.  
 
[[File: Temp_Cap-cool.jpg|600px|center]]
 
[[File: Temp_Cap-cool.jpg|600px|center]]
  
 
==Principle==
 
==Principle==
 
Temperature and humidity sensor detects environment temperature and humidity and make light present different color in different sections.  
 
Temperature and humidity sensor detects environment temperature and humidity and make light present different color in different sections.  
[[File: Temp_Cap-sch.jpg|600px|center]]
+
[[File: 11Temp_Cap-schss.jpg|600px|center]]
  
 
==Equipment==
 
==Equipment==
Line 24: Line 24:
 
| [[Microduino-Temp&Hum]]||1||Temperature and humidity sensor  
 
| [[Microduino-Temp&Hum]]||1||Temperature and humidity sensor  
 
|-
 
|-
| [[Microduino-Color led]]||1||Colored LED light
+
| [[Microduino-Colored LED]]||1||Colored LED light
 
|}
 
|}
  
Line 31: Line 31:
  
 
  [[File: Temp_Cap_sch.jpg|600px|center]]
 
  [[File: Temp_Cap_sch.jpg|600px|center]]
 +
 
==Load the Code==
 
==Load the Code==
 
*Setup 1:Connect CoreUSB and PC/MAC with a USB cable and open Arduino IDE.  
 
*Setup 1:Connect CoreUSB and PC/MAC with a USB cable and open Arduino IDE.  
Line 58: Line 59:
 
#define temp3    32
 
#define temp3    32
 
</source>
 
</source>
*Based on the definition for relation between light color and temperature, we set four light RGB values for environment temperature higher than temp1, between temp1 and temp2, between temp2 and temp3 and higher than temp3.  You can try to change RGB values or add more temperature sections and see changes. " strip.Color(R,G,B)" R, G and B represents three primiary colors.  
+
*Based on the definition for relation between light color and temperature, we set four light RGB values for environment temperature higher than temp1, between temp1 and temp2, between temp2 and temp3 and higher than temp3.  You can try to change RGB values or add more temperature sections and see changes. " strip.Color(R,G,B)" R, G and B represents three primary colors.  
 
<source lang="cpp">
 
<source lang="cpp">
 
   if (sensor_tem <= temp1)
 
   if (sensor_tem <= temp1)
Line 72: Line 73:
 
     colorSet(strip.Color(255, 0, 0));
 
     colorSet(strip.Color(255, 0, 0));
 
</source>
 
</source>
*About RGB. 关于RGB。
+
*About RGB.  
 
RGB value is method of defining light color. R(Red), G(Green) and B(Blue) are the three primary colors, whose values is 0-225. The value represents color intensity. Three different kinds of light can be superimposed together to form a variety of colors, such as (0, 225), that is green.  
 
RGB value is method of defining light color. R(Red), G(Green) and B(Blue) are the three primary colors, whose values is 0-225. The value represents color intensity. Three different kinds of light can be superimposed together to form a variety of colors, such as (0, 225), that is green.  
  
Line 87: Line 88:
 
==Result==
 
==Result==
 
The sensor detects different temperature data. You can also build a beautiful shell with LEGO.  
 
The sensor detects different temperature data. You can also build a beautiful shell with LEGO.  
[[File: ThermoCup_legao.jpg|600px|center]]
+
[[File: 213ThermoCup_legao.jpg|600px|center]]
  
 
==Video==
 
==Video==
  
 
|}
 
|}

Latest revision as of 09:29, 4 August 2017

Language: English  • 中文

Objective

This cup can "sense" water temperature and present different colors according to program settings.

Temp Cap-cool.jpg

Principle

Temperature and humidity sensor detects environment temperature and humidity and make light present different color in different sections.

11Temp Cap-schss.jpg

Equipment

Module Number Function
mCookie-CoreUSB 1 Core board
mCookie-Hub 1 Sensor pin board
mCookie-BM 1 Battery management
Microduino-Temp&Hum 1 Temperature and humidity sensor
Microduino-Colored LED 1 Colored LED light
  • Other Equipment:
    • Two cells of battery
Temp Cap sch.jpg

Load the Code

  • Setup 1:Connect CoreUSB and PC/MAC with a USB cable and open Arduino IDE.
CoreUSB Ble pc.jpg
  • Setup 2:Click file > Program examples > mCookie >_206_ThermoCup and load the program.
ThermoCup-ino.jpg
  • Setup 3:Choose the right board and serial port, download program to CoreUSB.
ThermoCup-upload.jpg

Code Debugging

  • Calculate temperature and humidity values--"readByAM2321()" function. You can open serial monitor and check the data.
void readByAM2321()
{
  AM2321 am2321;
  am2321.read();
  sensor_tem = am2321.temperature / 10.0;
  Serial.println(sensor_tem);
  delay(100);
}
ThermoCup-read.jpg
  • Define three temperature values and divide the temperature zone into four sections. You can change the values according to personal needs or add more temperature values.
#define temp1    28
#define temp2    30
#define temp3    32
  • Based on the definition for relation between light color and temperature, we set four light RGB values for environment temperature higher than temp1, between temp1 and temp2, between temp2 and temp3 and higher than temp3. You can try to change RGB values or add more temperature sections and see changes. " strip.Color(R,G,B)" R, G and B represents three primary colors.
  if (sensor_tem <= temp1)
    colorSet(strip.Color(0, 255, 0));
  
  else if (sensor_tem > temp1 && sensor_tem <= temp2)
    colorSet(strip.Color(0, 0, 255));
  
  else if (sensor_tem > temp2 && sensor_tem <= temp3)
    colorSet(strip.Color(255, 255, 0));
  
  else
    colorSet(strip.Color(255, 0, 0));
  • About RGB.

RGB value is method of defining light color. R(Red), G(Green) and B(Blue) are the three primary colors, whose values is 0-225. The value represents color intensity. Three different kinds of light can be superimposed together to form a variety of colors, such as (0, 225), that is green.

ThermoCup RGB.jpg

Hardware Buildup

  • Setup 1:Connect the temp.&hum sensor to the IIC pin of Hub and the colored light to A0.
ThermoCup setup 2.jpg
  • Setup 2:Connect the activated battery box with BM module.
CoreUSB Ble steup2.jpg
  • Setup 3:Stack all modules without fixed order and finish circuit buildup.
ThermoCup steup3.jpg

Result

The sensor detects different temperature data. You can also build a beautiful shell with LEGO.

213ThermoCup legao.jpg

Video