Simmr: The Internet-Connected Coffee Mug Emilio Del Vecchio, Kevin Lin, Senthil Natarajan {edd5, kevinlin, ssn3}@rice.edu May 3, 2016
1
Overview
We started out with the goal to connect something to the internet that didn’t need to be. Then, one day, Kevin was annoyed that his tea was cold and thought, "Wouldn’t it be great if I had some sort of device that could solve this problem AND was connected to the internet". From there we went to the drawing board and came up with our project outline: a mug with internal heating elements and sensor, Bluetooth connectivity to an Android app and a on-board display. Our final product incorporates all of these features: a two digit seven segment display for readout of temperature in Celsius, paired Android app for remote monitoring and tweeting when you #simmr is done, and an enclosure for a metal cup with heating pads and temperature sensor.
2
Design
Now for an overview of our product’s design and reasoning behind it. Our bluetooth module requires a 5v power supply and TXD and RXD connections to communicate over a serial interface. To communicate with the MSP430, we had to use pins 3 and 4 because these are the only two UCARXD and UCATXD pins on the device. For the display logic, two SN74LS47s were used to convert from BCD (binary coded decimal) to the corresponding set of LEDs on the 7-segment displays. Because each number on the display is coded separately and ranges from 0 to 9, we need to use at least 4 pins per digit (8 total). All 8 P2 pins on the MSP were used for the display; P2.0 - P2.3 for one digit and P2.4 - P2.7 for the other to keep things simple. For temperature sensing, we used a TMP-37 temperature sensor from lab because the MSP’s internal temperature sensor is not the most reliable. The sensor output is encoded as an analog voltage, so the MSP’s ADC10 was used to convert to a binary value our code could use. Pin 2 was unused and connects to ADC10, so we connected the temperature sensor there. We also had to connect the heating pads to the MSP and regulate the current through them. The current necessary to get the pads to any reasonable temperature is on the order of amps, maximum current output from the MSP’s GPIO pins is about three orders of magnitude less, so we had to find another solution. We decided to use a high-current transistor that could be toggled via PWM to control the average current through the heating pads. Most of the PWM pins were taken by the Bluetooth module; however, pin 14 was open and connects to TA0.1. Powering the devices was also a challenge. The required voltage for the heating pads is around 10v, and is much higher than is recommended for the MSP and other elements on-board. While the heating pads are powered directly through the wall outlet, all other
1
Emilio Del Vecchio, Kevin Lin, Senthil Natarajan
Simmr: The Internet-Connected Coffee Mug
elements are powered via a LP2985-N 3.3v regulator or a LP2985-N 5.0v regulator. Finally we had to encase all the circuitry so that the temperature sensor, heating elements, and wires would stay in place. For the enclosure, we 3D printed a hollow base for the electronics, and top and bottom rings to hold the cup in place.
3
Hardware Components • 1x MSP430G2553 (20 pin) – http://www.ti.com.cn/cn/lit/ds/slas735j/slas735j.pdf • 1x KEDSUM Bluetooth Transceiver – http://www.amazon.com/KEDSUM-Arduino-Wireless-Bluetooth-Transceiver/dp/B0093XAV4U/ ref=sr_1_1?s=pc&ie=UTF8&qid=1462332618&sr=1-1&keywords=bluetooth+module • 1x LP2985-N 3.3 and 5v – http://www.ti.com/lit/ds/symlink/lp2985-n.pdf • 1x TMP 37 – http://www.analog.com/media/en/technical-documentation/data-sheets/ TMP35_36_37.pdf • 2x SN74LS47 – http://www.ti.com.cn/cn/lit/ds/symlink/sn7447a.pdf • 1x IRLB8721PbF NMOS Transistor – https://cdn-shop.adafruit.com/datasheets/irlb8721pbf. pdf • 2x Electric Heating Pad – https://www.adafruit.com/products/1481
4
Software
We tried to make Simmr as user friendly as possible. To use Simmr just follow these 6 easy steps: 1. Power on you Simmr device 2. Launch the Simmr app on your Android device 3. Login with Twitter 4. Select your Simmr Bluetooth device 5. Set target temperature 6. Wait for notification Drinking* has never been so easy! *(at a consistent temperature for prolonged periods of time)
2
Emilio Del Vecchio, Kevin Lin, Senthil Natarajan
4.1
Simmr: The Internet-Connected Coffee Mug
Android
The android app works by first authenticating your Twitter account. From there it detects nearby Bluetooth devices and waits for the user to select a Simmr device. Once connection to the Bluetooth module has been established, a constant stream of data flows between Simmr and the phone. When the user changes the target temperature on the app, the data is encoded as a string and sent to the Bluetooth module. Every second or so, a string is received by the app stating the current temperature of Simmr, which triggers a UI update. When the received string matches the target temperature, a push notification is sent to the user. At any time the user can send a tweet by pressing the share button. This will automatically generate a tweet saying what temperature you’re #simmr mug has reached along with two randomly chosen hash-tags from a pool of 5.
4.2
MSP430
Our MSP works by first running it’s initialization function. This sets values for the the watchdog timer, adc10, PWM timer, and GPIO pins. After that the main loop of our function runs. The main loop is responsible for incrementing or decrementing the desired temperature based on information received from the Bluetooth moduel. After once cycle, the MSP is sent into LPM0 with interrupts enabled. From here, the watchdog timer, UCARXD, or ADC10 can trigger an interrupt. The watchdog timer is set so that every second or so, a conversation with ADC10 is started and the current temperature is sent to the Bluetooth module via UCATXD. The WDT interrupt also updates the PWM as necessary to maintain a constant temperature. The ADC10 interrupt converts the reading from the temperature sensor to Celsius and updates the on-board display. Lastly the UCARXD interrupt is responsible for listening for when an update is sent from the Bluetooth module and storing it in a global variable so the while loop can change the target temperature.
5
Issues • After a few hours of troubleshooting and thinking all was lost, we discovered that the P2 pins on the MSP don’t work unless the pull resistor on the reset pin is connected. • P2.6 and P2.7 are not GPIO by default. Took a while to figure that out. • Bluetooth module worked well when it was the only thing connected, but became less reliable when connected to the entire circuit. We were unable to determine the cause of this issue. • Had to use a wall connection to power heating elements. If we had more time we would have liked to use a battery. • Forgot some vias on the PCB design. We tried to solder wires directly onto the MSP pins, but they kept falling off. We had to move the project onto breadboards for the final product. Fortunately we were able to fit everything into the enclosure.
3