Smart materials concept introduction
What is a smart material?
Smart materials:By definition also called intelligent or responsive materials, are designed materials that have one or more properties that can be significantly changed in a controlled fashion by external stimuli.
Are they truly ‘smart’?
Conventional ‘smart’ materials:Although these traditional smart materials can change some of their properties according to the external environment, these changes are passive. Simply put, these materials can only be regarded as mechanical spontaneous actuators.
What are the key elements to make a real smart material?
Real ‘smart’ materials:Have you have ever seen captain marvel? in the movie, a bunch of aliens called shapeshifters can transform into any object that they see. So there is a scene, in order to avoid captain marvel, they disguise into an old lady, and got hit right into the face. And also in the movie transformer, the human-made transformer Galvatron although got hit into pieces can reconstruct itself into the initial state. These two clips give us a very great description of the key elements for self-evolving.
Let’s imagine, What if the sample that we fabricated has a great sensing ability to a certain type of property that we are interested in, so it can sense this property of any object, just like the shapeshifter’s eyes can scan the object they want to transform into. And then the sample also has constructability like the Galvatron, it can reconstruct this property by itself. Also, by integrating learning ability into this sample, at first, the sample doesn’t know the exact way to become the target object, but by trying little steps, it can learn by itself how to approach the target.
By combining these three key capabilities together, the sample can evolve itself to any possible object without any external manual operation, and especially for the very complex object, it will be a fast way perhaps the only way to accomplish it with high accuracy. This is the fundamental idea of self-evolving, and if a material has the self-evolving ability, as if it can think and learn also evolve by itself, it can be called a smart material.
Smart materials in the future
If you have extra time, please take a look at this video, it’s a quite inspiring talk in the smart materials field.
Code:
Minimization algorithm
If you are not familiar with machine learning or have no coding experience, it is recommended to start with the minimization function compiled by scipy.optimize.minimize. Because in the whole loop built, it is a process of narrowing the gap between the intime state and the target state, and some simple problems can be solved with the simplest minimization algorithm. If you are more familiar with machine learning algorithms, you can use some more streamlined and faster algorithms.
Electronics:
Raspberry pi
Arduino
Using Raspberry pi to connect with multiple Arduinos can achieve the purpose of quickly controlling multiple voltage ports.
##code part in python
from smbus import SMBus
addr1 = 0x04 #address of Arduino uno
addr2 = 0x05 #address of Arduino mega
bus = SMBus(1)
bus.write_block_data(addr1, 10, [3,5,6,9,10,11])
# pwm ports of Arduino uno
time.sleep(0.1)
bus.write_block_data(addr2, 10, list(range(2,12)))
# pwm ports of Arduino mega
time.sleep(0.1)
Thus you can individually control 16 ports which can be a simple version of multiplexing.
Aim:
Let LEDs self-evolve into any random brightness.
Required components:
Raspberry pi; Arduino; LEDs; resistance; jumper wires
Schematic diagram:
In order to demonstrate this idea, the first simple case is using LEDs. In this case, the target is 5 LED with different brightness which I don’t know. And 5 LED’s initial state is set at 0. The microcontroller is used to adjust the input current into the LEDs. The LEDs will try to change the brightness itself, whenever they change, a picture will be taken, the image analysis will tell it the difference between the intime brightness and target one, so it can figure itself the way to approach the target in this feedback loop. Finally, when it evolves pretty much like the target, it goanna stop and generate the output. This is the real experimental pic that I try, I think this case is quite fulfilled now.
Brightness detection:
brightness detection demo code:
def ReadLEDLightness(File):
frame = cv2.imread(File)
print(‘read image file: ‘ + File)
PosX=[217, 273, 322, 388, 409] #Position the Red LED
PosY=[297, 301, 303, 300, 307]
RectangleX = 10
RectangleY = 10
LEDLightness=[0 for ii in range(0,PortNum)]
fout=open(“TestLED.txt”, “w”)
for jj in range(0,PortNum):
HAve=0.0
LAve=0.0
SAve=0.0
for kk in range(-RectangleY,RectangleY+1):
for ll in range(-RectangleX,RectangleX+1):
RGB_Red=frame[PosY[jj]+kk,PosX[jj]+ll,2]/255.0
RGB_Green=frame[PosY[jj]+kk,PosX[jj]+ll,1]/255.0
RGB_Blue=frame[PosY[jj]+kk,PosX[jj]+ll,0]/255.0
(H,L,S)=colorsys.rgb_to_hls(RGB_Red,RGB_Green,RGB_Blue)
HAve=HAve+H
LAve=LAve+L
SAve=SAve+S
HAve=HAve/((2*RectangleX+1)*(2*RectangleY+1))
LAve=LAve/((2*RectangleX+1)*(2*RectangleY+1))
SAve=SAve/((2*RectangleX+1)*(2*RectangleY+1))
LEDLightness[jj]=LAve
for ii in range(0,3):
fout.write(‘%8d’ % frame[PosY[jj],PosX[jj],ii])
fout.write(‘%15.5f %15.5f %15.5f’ % (HAve,LAve,SAve))
fout.write(‘\n’)
fout.close()
return LEDLightness
Results:
For each function evaluation, it will take 0.5s, after 5 iterations, the brightness will reach the target.
Extra practice:
Using RGB LEDs to tune the color of your LEDs.
Please try it by yourself to let your LEDs self-evolving!
About the Author
Yun Bai
CONTACT INFORMATION
Email Address: yun.bai@duke.edu
EDUCATION
M.S. in Materials Science and Engineering, Northwestern University
B.E. in Materials Science and Engineering, Huazhong University of Science and Technology