This is a project which I and my classmates had finished in a course focusing on practical implementation for mechatronics and system design, and is a sequel of the previous Aroma Alarm Clock project. We designed an Android app-controllable alarm clock which can heat up objects such as a water-filled container, and intend to further improve it for making coffee, so that one can enjoy a fresh cup of coffee in the morning after awakening. Similar to the previous one, I worked as the engineer in our group, and designed and constructed the hardware system.
Fig. 1 shows the overall system architecture, which several electronic components (e.g. clock module, LCD display…) are controlled by a microcontroller that can communicate with a mobile application using a Bluetooth module. The alarm clock can be controlled either using its own hardware input (buttons) or using the mobile app. Simply put, the system has same the functions as a typical alarm clock, but has two additional features:
1. Temperature controllable heater. 2. Bluetooth communication.
Figure 1. System architecture for the coffee maker alarm.
Arduino Uno, DS1302 chip, HC-06 and LCD1602 are used respectively for the microcontroller, real-time clock module, Bluetooth module and LCD display module. Being an end-semester project in class, the components are simply connected using a breadboard. All the hardware components except the heater are packed using patterned cardboard in a simply looking fashion (Fig. 2).
Figure 2. Hardware appearance of the coffee maker alarm.
A ceramic heater plate and temperature sensor are integrated for realizing temperature controlling (Fig. 3), and are connected out from the main hardware. The total cost for all the components is 1,741 NTD (≅ 60 USD).
Figure 3. Heater and temperature sensor.
App Inventor 2 is used as the platform for creating the Android app for controlling the hardware. Fig. 4 displays the designing interface for the mobile app using the platform.
Figure 4. Design interface using App Inventor 2.
The coding section for this platform is very unique and easy to get started. It implements a block-based programming method which developers can create procedure by dragging pre-defined blocks together to for performing a certain function. Developers with no programming background can use this kind of environment for creating mobile apps. Fig. 5 shows a gallery containing the complete code for the alarm clock controlling app.
Figure 5. Gallery of block codes for the alarm clock app.
Here’s a video demonstration for using this system:
I have always wanted to automate the cumbersome experimental operation process. For biochemical experiments, often a whole day in web lab is spent in order just to acquire one single set of data. Having the hands-on experience of developing hardware and software integrated systems for several projects (e.g. Surface Plasmon Resonance Platform, Real-time Impedance Detection Systems), I initiated this project for constructing a microfluidic controlling platform that can automatically manipulate liquid-based solutions of little volume, and also assist real-time detection experiments.
The platform is constructed by four sections: A Raspberry Pi, an actuator module that consists of an Arduino and two H-bridge circuits, a fluid controlling system made up of a syringe pump/syringe device, and the microfluidic platform (Fig. 1).
Figure 1. System architecture of the automated microfluidic controlling platform.
For x/y position control, the Raspberry Pi sends data through type-B USB to the Arduino, which afterwards commands the H-bridge circuits, then control the x/y stepper motors on the microfluidic platform for moving the position of the racket. The servo motor is used to control the high/low position of the tube it holds, where the high (low) position means the tube isn’t (is) inserted into the microtube (Fig. 2).
Figure 2. The microfluidic platform and surrounding modules.
For fluid control, the Raspberry Pi sends an infuse/withdraw signal to the syringe pump using another type-B USB, which subsequently pushes/pulls the syringe on it. A simple flow for moving liquid from microtube A to microtube B is:
1. Confirm that the tube (for fluid conveyance) position is high. If not, then move it up by servo motor. 2. Move to microtube A by stepper motor. 3. Change tube position to low by servo motor. 4. Withdraw liquid by syringe pump. 5. Change tube position to high by servo motor. 6. Move to microtube B by stepper motor. 7. Change tube position to low by servo motor. 8. Infuse liquid by syring pump.
Figure 3. Photograph of the automated microfluidic controlling platform.
The circuitry for this platform is relatively easy compared with other projects (e.g. Aroma Alarm Clock), and is consisted simply with wires and resistors. Except the motors and the racket with microtubes, all the other components of the for microfluidic platform are fabricated using 3D printing. 3D-printed gears are fixed with the stepper motors. Precise control of racket position (~ 0.2mm) is realized by combining the gears with a 3D-printed linear gear that fits on the racket and another linear gear of a subsidiary platform which the racket sits on. Below is a clip demonstrating how the 3D-printed components, the stepper motors, the racket with microtubes, and a microfluidic electrode chip are integrated together, along with x/y position control of the racket.
The program structure written inside Raspberry Pi is quite similar to the program structure in another project “Real-time Impedance Detection Systems”. The difference for this project is that PHP is used to directly communicate with peripheral devices (Fig. 1).
Fig. 4 displays the website-based user interface for controlling this platform. The UI is divided in four sections: procedure window, buttons field, racket window, and status window. Briefly, the user can save/load settings from the connected Arduino, add/delete a control command, start/pause/stop the current procedure, download the control procedure to a text file, and append a command after another one.
Figure 4. Website user interface of the platform.
Fig. 5 shows the settings menu. Here, the user needs to find the device url for Arduino and the syringe pump beforehand and insert them. Several controlling preferences, such as motor operation delay time, steps for the stepper motor to move per cell (microtube), precise high/low position of the servo motor, current cell of the racket … etc. can be set.
Figure 5. Settings menu of the UI.
Fig. 6 shows the add command menu. The user can either move the stepper motor to a target cell (microtube), infuse/withdraw fluid at a self-defined rate and target volume, move servo high/low position, or perform a time delay.
Figure 6. The add command menu of the UI.
Concentration Gradient Generation
An automated concentration gradient generation process is written, and is carried out by the automated platform. Here is a clip for demonstration (speed = 10x):
Real-time Impedimetric Detection
The tube doesn’t have to directly connect to a syringe. A detection chip can be inserted between for real-time detection of different solutions (similar to the method illustrated in Fig. 1 of another project Surface Plasmon Resonance Platform). A microfluidic interdigitated electrode chip using microfabrication technique is previously developed (which is a part of my research), and is used for detection of electrochemical impedimetric properties of the fluid. Here, potassium ferricyanide (K3Fe(CN)6) and potassium ferrocyanide (K4Fe(CN)6) are serial diluted using the platform, and real-time impedance detection is carried out using an electrochemical analyzer (CHI614b, CH Instruments) and the microfluidic chip.
Fig. 7 shows the detection result. It can be seen that the solution switching time is relatively fast and stable, and the detection time is consistent, which demonstrates the advantages of this automated platform.
Figure 7. Real-time impedimetric detection plot for different diluted concentrations of K3Fe(CN)6/K4Fe(CN)6.
In summary, a website-controlled automatic microfluidic controlling platform is designed and fabricated for real-time microfluidic sensing and other applications. Solution manipulation using this platform is stable, repeatable, and time-saving compared with manual operation.
This project is an integration of computer vision, mechatronics, wireless communication (Bluetooth), database management, mobile app design, sensors and actuators, and is a final project of a course called Design of Automated Systems. I teamed up with two classmates for accomplishing this challenging task of constructing a remote commandable car that can automatically detect and find balls with different colors, then be manually navigated towards a certain location. My contributions to this project are coding the ball-tracking algorithm using OpenCV, utilizing the microcontroller Arduino for movement control, and wiring electric components to the hardware circuit (yellow shaded area in Fig. 1).
Fig. 1 illustrates the system architecture for this project. Raspberry Pi is used as the main computer. Node.js is installed for communicating with the MariaDB database, receiving ordering signals from a remote Android app, and commanding the ball-tracking C++ program.
Figure 1. System architecture of the remote commandable self-driving toy car.
A standard procedure for command and action of the system is as follows.
Android user logins to Node.js server by verification of username and password through the database.
The user sends target ball color to the server.
The server sends command to “face_ball” program by bash.
“face_ball” detects colored ball position by ball recognition algorithm.
“face_ball” sends command to Arduino by serial USB.
Arduino controls two servo motors for the car to move towards the target ball.
After getting close enough, a fence is set to physically trap the ball.
Fig. 2 shows a 3D drawing of the toy car. Components such as Arduino, Raspberry Pi (RPi) are fixed to the laser-cut acrylic board using plastic columns. Here, three servo motors are used. The first two controls the left/right wheel, and the third controls a trap that can lock the ball at the front of the car.
Figure 2. 3D illustration of the remote commandable toy car.
Figure 3. Preliminary version of the toy car.
The main objective of the ball-tracking program is to navigate the toy car towards a target ball, and trap it with a fence connected to the toy car. The flowchart for image recognition of the ball is shown in Fig. 4.
Figure 4. Flowchart for the ball detection algorithm.
Using the above algorithm, rapid detection of the target ball can be realized. Here’s a demonstration of the program recognizing a ball being thrown in the air in real-time.
For movement control of the toy car, the Arduino will either turn left, turn right, or move straight according to the control algorithm shown in Fig. 5.
Figure 5. Flowchart for the ball-trapping algorithm.
Fig. 6 shows the commands available for controlling the toy car using Arduino.
Figure 6. Available commands for Arduino.
Here’s a clip for automated control of the toy car. A red ball is defined as the target and is trapped by the car using a fence.
Android App Design
The app is designed using MIT App Inventor, which implements a block-based programming method in which developers can create procedures by dragging predefined blocks together to for performing a certain function. Fig. 7 shows an image containing the complete code for the Android app. The user interface and flowchart for direct control of the toy car is shown in Fig. 8.
Figure 7. Complete block code for the Android app (click for magnified view).
Figure 8. App interface (left) and Arduino control flowchart (right).
Here’s a demonstration for the remote commandable toy car. The car automatically detects a green ball, moves near, and traps it. Then it is manually controlled to avoid obstacles and reach a yellow-colored area at the end.
As an old saying goes, “An hour in the morning is worth two in the evening”. What we encounter and conceive during this period is largely intertwined with our whole day. However, what is the most important thing that we encounter in the morning? It is about waking up. Nowadays, we wake up by the noisy, buzzing sound of an alarm. How would it be like if we could wake up by a scent, a fragrance, wiping away the unsatisfactory memories of the past? What can be changed to fulfill a better awakening?
An aroma alarm clock should fill in the answer. When I was a junior, I enrolled in a program called “NTU Creativity and Entrepreneurship Program” (NTUCEP). In this program, students with similar ideas form groups and learn about entrepreneurship by practice. After a couple days of brainstorming, our group came up with the concept about developing an alarm clock that can wake people up using scent packs. Apart from being awakened by a loud ringing sound of an alarm, fragrances (as we had proposed) have a milder, progressive effect for waking people up. We named our product “Sensio”, a Latin noun of the meaning “thought”.
In order to verify the market demand of this proposal, we devised a questionnaire for investigating the views and habits of people about waking up, which 1320 valid responses were collected. A score of 0 ~ 7 is used to quantify the “discomfort level” for waking up, in which a level of 0 ~ 3 is regarded as painless, and 4 ~ 7 as painful. Fig. 1 shows the discomfort level distribution of all the samples, and Fig. 2 shows the distributions by occupation. It can be seen that regardless of identity, the majority of people feel painful when waking up (students: 71%, office worker: 62%, other: 51%, overall: 68%). Moreover, we analyzed their habits of lying in bed after awakening. Fig. 3 shows the proportion and durations for lying in bed. Accordingly, over 44% of people lie in bed for over 15 minutes, and the average duration is 15.07 minutes. Theoretically, this means if a product could help lower one’s discomfort level of waking up, and reduce the duration of lying in bed after awakening, he could approximately increase 3.8 days/year of effective time. Not only having a favorable morning, but also enhancing his work efficiency.
Figure 1. Discomfort level distribution of waking up.
Figure 2. Number of people vs discomfort level by occupation.
Figure 3. Duration of lying in bed after awakening.
From the above analysis, we became confident about the large market demand for a better quality of getting up. For me, being the leading engineer role in our group of six meant turning ideas into reality. This had been a difficult period but a time of inspiration and excitement. I put into practice what I had learned within the past few years for developing a system, a hardware that can really be used as a product.
I developed two preliminary versions of the hardware, with the 1st version using Arduino as the CPU (Sensio v0.1) (Fig. 4). In this version, an Arduino chip, a time clock module (DS1302), a shift register (74HC595N), relays, button switches, LED displays, a buzzer, a fan and a potentiometer are used for the alarm clock (Fig. 5). 10 different themes are written inside the system and a few simple features are integrated within (Fig. 6 details every mode of the alarm clock and the corresponding function of the buttons). This version serves as the proof-of-concept version for making an aroma alarm clock. Although being simple and somewhat rough, it demonstrated to my team and our professors a solid proof and feasibility of our objective.
Figure 6. Alarm modes and button function for Sensio v0.1.
During this period, we earned 40,000NTD in a fundraising event in our program, and won the Best Potential Award in the 14th NTU innovation competition. Fig. 7 shows the poster we had used in the competition. During that period, we had great enthusiasm and motivation, and dreamed that one day our product would become on-sale and we could establish a real listed company of our own. We entered the NTU garage, which is an incubator for startups that are closely linked to NTU.
Figure 7. Poster of product Sensio for the NTU innovation competition.
The second version Sensio v0.2 was created during my second semester as a junior. This time, an IC chip (ATMEGA328P) is used as the CPU rather than Arduino in order to lower the cost of the system and decrease its volume. Moreover, a PCB layout for fixing electronic parts on a solid panel is used. Fig. 8 illustrates the structural model of Sensio v0.2, Fig. 9 shows a photograph of the integrated electric components and its corresponding PCB layout schematic, and Fig. 10 shows photographs of the laser-cut 3D outer case.
Figure 9. Electronic component-integrated PCB board of Sensio v0.2 and its corresponding layout schematic.
Figure 10. Outer case (blue) and scent pack holder (orange) of Sensio v0.2.
We were thrilled after these accomplishments, since never had a team of the same period achieved such a high level of completeness, especially when concerning the integrity of hardware and software. These remarkable things happen so quickly, so fleeting for us to catch up with. The truth is, we are still so far from success, since we were still students back then. Reality pulled us back, and we started asked ourselves: are we ready to give up some things and dedicate ourselves to entrepreneurship? Our dream product, the aroma alarm clock, had once seemed so close, yet had never seemed so far.
I started to use a technique called electrochemical impedance spectroscopy (EIS) for biosensing since my undergraduate research. For analyzing EIS data, an equivalent circuit must be constructed for modeling the reaction mechanism. Physical parameters can be extracted by fitting the data using the model. However, for most software, the circuit elements being provided and their corresponding combined circuit couldn’t necessarily meet my needs for finding the physical parameters in a symmetric electrode system. Therefore, I developed a circuit fitting program for customized analysis of impedance data. The fitting and impedance calculation program are used in a first-author journal paper of mine. In the following paragraphs, the development of the fitting program, another program that assists data visualization, and a program for calculating the diffusion impedance of interdigitated array (IDA) electrodes are detailed.
Figure 1. (a) The Nyquist plot for visualizing impedance values, and (b) an equivalent circuit with several circuit elements for modeling electrode surface reactions.
Electrochemical Impedance Circuit Fitting Program
The algorithm for finding all the element parameters in a given circuit is by implementing the Levenberg-Marquardtnon-linear fitting method. This is a general and popular method for solving the minimum value of function E(x), where
where S is the weighted sum of squares of error, Nf is the number of frequencies within an experiment, Zi is the impedance of the i–th frequency, and wi,Re and wi,Im are the statistical weights for the real and imaginary parts of the impedance of the i–th frequency. The subscript exp indicates experimental value and the subscript cal indicates the calculated value while fitting.
For any kind of circuit, Zi,cal can be calculated by the set of element parameters and the frequency (e.g. R for a resistor, C and f for a capacitor), then S can be calculated using its defined equation. By minimizing S, the fitted element parameters can be modified so that the result impedance (Zi,cal) can be as close as possible to the experimental value (Zi,exp). Fig. 2 shows an example for a non-linear curve fitting process.
A program written in C language is designed using the open-source numerical analysis library ALGLIB® to implement numerical integrations and calculations. ALGLIB is also used for non-linear least squares fitting of EIS data using Levenberg-Marquardt method. Several circuit elements for EIS data fitting are available in this program, which are shown in Table 1. Detailed methods for calculating the IDA diffusion element is shown in my first-author paper.
Table 1. Available circuit elements in the fitting program.
A circuit description code is defined to express equivalent circuits. Elements, including whole blocks inside parentheses, are either in series or parallel with each other. Those inside an odd number of pair of parentheses are in parallel with each other, and those inside an even number of pair of parentheses are in series. Fig. 3 shows a circuit equivalent to the description code of “R(RC)(R(RC))”.
Figure 3. Circuit description code and its corresponding circuit. Equivalent parts are marked by identical colored blocks.
Figure 4. Snapshot of the equivalent circuit fitting program.
It is reasonable that an element in a circuit contributes to the impedance change to a certain degree. For instance, a resistor has an influence on the real part of impedance, and a capacitor affects its imaginary part. However, when the circuit consists of elements with serial or parallel combinations, it can be quite difficult to imagine how the shape of impedance data would change according to each element.
Therefore, I wrote a program for plotting impedance data in real-time using Processing language. After entering the circuit description code into the program, a Nyquist plot, total impedance Bode plot, and phase angle bode plot is generated. The user can use horizontal bars to control the value of a specific element. By changing its value, the impedance would be calculated immediately, and the plot would be drawn out in real-time.
Figure 5. User interface for the real-time impedance plotting program.
Here’s a clip for demonstrating the real-time impedance plotting program.
Due to calculation difficulties, a program is written for calculating the IDA diffusion impedance. The program consists of two files “settings.txt” and “IDA_diff_Z.exe”. “settings.txt” is of the format below:
These contain all the 12 parameters for the usage of this program. A detailed description is listed in order below:
If [output to txt file] is 0, then calculated impedances will be shown directly on screen. If it is 1, then the values will be saved to the file “Z_diffusion_IDA.txt”.
The maximum frequency for impedance calculation can be set after [max freq (Hz)].
The minimum frequency for impedance calculation can be set after [min freq (Hz)].
The number of frequency points within a decade can be set (e.g. If [points per decade] is set to 5, then frequencies calculated between 101 and 100Hz will be 101, 100.8, 100.6, 100.4, 100.2 and 100Hz.)
we can be set after [electrode bandwidth we (um)].
wg can be set after [gap width wg (um)].
l can be set after [electrode length l (mm)].
N can be set after [number of bands N].
D can be set after [diffusion coefficient D (m^2/s)].
C* can be set after [bulk concentration C* (mM)].
n can be set after [number of electrons n].
T can be set after [temperature T (K)].
After setting the 12 parameters, put “settings.txt” and “IDA_diff_Z.exe” in the same directory and open “IDA_diff_Z.exe”. Impedances will be automatically calculated and printed in the defined format (Fig. 6). ※The program can only be run in a Windows 64-bit environment.
Figure 6. An example output of the IDA diffusion impedance calculation program.
Even the simplest thing we recognize may seem increasingly difficult in another point of view. Take a simple arithmetic operation for example, if one wants to calculate the function y = ax + b with given a and b, he simply multiplies any number x with a, then adds b, and gets the answer. What if no multiplication and addition can be used? How can the calculation even be possible?
Computers can actually finish the task by implementing three fundamental logic operations: AND, OR, and NOT. Most of them can do these operations within a nanosecond. In this project, I constructed a circuit for performing a simple linear algebra calculation (Fig. 1) using only basic logic and storage circuits (Fig. 2) that can be realized using standard cells.
Figure 1. Formula to be calculated. (x0, x1, x2 are all 6 bit 2’s complementary integers)
Figure 2. Basic logic and storage circuits. (Note that other circuits (e.g. NAND, XOR) are also used in this project)
Here, x0, x1 and x2 equal the three 6-bit integer inputs (2’s complementary), so there are a total of 18 Boolean input values. The output is stored in a 16-bit integer. Therefore, the goal for this project is to construct a circuit that connects all of the 18 inputs and the 16 outputs, and perform the calculation.
To make it harder, three stages of pipelines are carried out. This means that calculations are divided into three parts, and the most time-consuming part contains the critical path of the whole circuit. Fig. 3 shows an illustration of the designed circuit.
Figure 3. Logic circuit diagram for realizing the arithmetic operation (Fig. 1) of this project.
Verilog is used for simulating the results, and the circuit is written as a spice sub-circuit model. Because the D flip-flop is used, the critical time is defined as the clock cycle of the D flip-flop. Moreover, the number of transistors are defined for every basic logic circuit, so the total number of transistors can be calculated, and is named the “area” of the whole circuit.
Fig. 4 shows the simulation results of the circuit. It can be seen that only 1.3305 nanosecond is used for a half clock cycle of the circuit. This means that the circuit can continuously output calculation results every 2.661 nanosecond, which is really fast!
Figure 4. Simulation results using Verilog.
Having the experience of using absolutely no arithmetic operations for calculating a linear algebra problem really significantly broadened my insight towards digital IC design. This project inspired me to understand that even the most insignificant elements possess the potential to be combined and make up the world that we live in.