Trenton Rochelle | Justin Hemphill | Ziming Qi |
Any Android smartphone with USB OTG is compatible with our system. OTG is required to maintain serial communication with the microcontroller due to the dynamic usb host/slave configuration with charging
We were limited to the design of the previous alpha prototype which used the SAMD21 Cortex-M0+ 32-bit low power ARM MCU . This processor is used in the Arduino MKRZERO which allowed easy prototyping and vast open-source libraries
This element provides the ability to perform electrochemical measurements. For this we used the highly compact Emstat Pico by PalmSens.
The Android phone supplied power to itself and we used a 1S 2500mAh LiPo battery to supply power to the rest of the electronics. Charging both the Android phone and the LiPo while maintaining power was made available through a TI TPS61090 and supporting circuitry.
The blood within the chip is heated or cooled by a Peltier module where one side draws heat from the other side, where heat polarity is determined by current polarity. This can be controlled through an H-Bridge IC, polarity signal, and a PWM to determine power output. The polarity of the current flowing through the Peltier module is shown below, where the red/blue indicate the temperature of the top of the Peltier.
A thin-film surface mounted thermistor (PT100) feeding into a MAX31865 digital amplifier was used to read the temperature on a rapidly changing basis. A PT100 was used due to it's low thermal mass, small size, and responsive thermal equilibrium. Here is the peltier sandwiched between the RTD and the heat sink.
We used a software PID (Proportional-Integral-Derivative) to adjust the PWM which controlled the H-Bridge IC power output. A PID is a control loop mechanism which employs feedback by continuously calculating an error value e(t) as the difference between a desired setpoint y(t) and a measured process variable r(t). The feedback is a correction based on proportional, integral, and derivative terms, each multiplied by a respective weighting. This control is shown below:
The hardware interface between the Android phone and the microcontroller was through USB OTG, but we ran into issues when plugging in and removing the usb cable. We wanted the Android phone to be isolated from the power system of the rest of the board, so the circuitry to the phone was set up such that it could only "sink" power and not charge the peltier device, but also communicate with the MCU. The data role between the Android phone and the MCU is a master/slave relationship for USB, but we could either only charge the phone and communicate, or communicate and not charge. This was solved by peeking into the Android operating system USB code and determining that the phone had preferred data role defaults: host within a non-charging state and a slave device during charging state. Once this was figured out, we kept the MCU to be a permanent slave, and the Android phone was rooted to call "echo host > /sys/class/typec/port0/data_role" upon any change in the USB connection state. This setup allowed us the keep the phone in a permanent host state, and the MCU in a permanent slave state, with no communication interruptions during a charging state change.
Because the user was interfacing with the Android application and not the MCU, we decided that the Android phone would take care of the high-level information and control the MCU state, while the MCU would interface with the sensors and temperature control. Message passing between the two "brains" was done through JSON messages where the Android phone would tell the MCU what to do or what information to fetch, and the MCU would reply with an acknowledgement and the fetched data. This allowed for a host/slave relationship that allowed the two systems (Android/MCU) to be developed in parallel and to create a distinct hierarchy.