Things used in this project

Custom parts and enclosures

Solmate lid
Used for mounting the various sensors and LCD.

Schematics

Diagram
Parts Diagram
Fdkk3pzic0chou4

Code

Solmate twitter integrationPython
Python code for uploading data to twitter
import twitter
import random
import time
from datetime import datetime
import smtplib
import argparse

def sendMess(percentIn,e,t,u):
	CLIENT_ID = "1290d6798b1a4e9"
	sender = "troop138wu@gmail.com"
	eRecievers= ["6262413103@tmomail.net"]
	if(percentIn<0 or percentIn>100):
		print 0
		return
	elif (percentIn<=20):
		messageIn="Keep calm and get your tan on. Remember to use an SPF!"
		tweet(1,e,t,u)
	elif (percentIn<=40):
		messageIn="Time to soak up the sun! The sun is high, and the tan is low."
		tweet(2,e,t,u)
	elif (percentIn<=60):
		messageIn="Sunscreen is recommended for toaster oven conditions."
		tweet(3,e,t,u)
	elif (percentIn<=80):
		messageIn="You're now equivalent to a baked potato."
		tweet(4,e,t,u)
	else:
		messageIn="You're fried chicken status. Time to go home for the day."
		tweet(5,e,t,u)
	try:
		#print "Sending message to " + recvname + "...",
		server = smtplib.SMTP(host='smtp.gmail.com',port=587)
		username = 'troop138wu@gmail.com'  
		password = 'Wu123456'  
		server.ehlo()
		server.starttls()  
		server.login(username,password)  
		server.sendmail(sender, eRecievers,"From: " +"in"+ "\n"+"To: " +"out"+ "\n"+"Subject: " + "SOLMATE!"+ "\n"+messageIn)         
		server.quit()
		print "successfully sent!"
	except  Exception:
	    print "Error: unable to send message"
	print 1

def tweet(choice,e,t,u):
	tweets=['Happy to soak up the sunlight for the day!','I know #Solmate always has my back for getting a perfect tan.','Safely getting a healthy amount of UV rays for the day!','Having fun under the sun. Make sure to wear some shades and sunscreen!','I just got my daily dose of Vitamin D and Calcium']
	api = twitter.Api(consumer_key='d6RF46ZYRC1EMJ9GFfhwAsPHo',
	                      consumer_secret='syq9klXBYYQbAnSVm6ie3qPpi2PFtO2nwQI0nEdsYMWxDGIUgJ',
	                      access_token_key='3246491366-V2KQG7EF1R6rAFZv4GCsZLw8kEZOuXHaUUEUq1n',
	                      access_token_secret='5nPvjXaJscb8wqKH32RSy3jTrA4VnP9PPJxvesG8Q3NIg')
	choice=tweets[choice-1]+' #'+e+'mins #'+t+'F #uv'+u+' #SolMate #IntelMaker'
	try:
		status = api.PostUpdate(choice)
	except:
		choice+=' #'+(str(datetime.now()))[:10]+' #'+str(int((str(datetime.now()))[11:13])-7)+(str(datetime.now()))[13:19]
		status = api.PostUpdate(choice)
	return status.text

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="send message and tweets")
    parser.add_argument('-m', '--message', dest='mess', help='message')
    parser.add_argument('-e', '--e', dest='e', help='elapsed time')
    parser.add_argument('-t', '--t', dest='t', help='temperature')
    parser.add_argument('-u', '--u', dest='u', help='uv')
    args = parser.parse_args()
    mess=int(args.mess)
    sendMess(mess,args.e,args.t,args.u)
Solmate Arduino CodeArduino
Entire structure of the Arduino code
No preview (download only).
Solmate Selfie Sun Mobile App apk fileJava
Download the apk file to install the app on your mobile device, the complete Android Studio project can be found at: github.com/BrianCottrell/selfie-sun
No preview (download only).

Credits

Dscn0986
Brian Cottrell

I am a software developer with a background in physics and low level programming and I am currently focused on web and mobile development.

5f62597ecdc72ba3f266552b95b8a3b8
Robert Wu

Junior at USC. Go Trojans!

F404b82fd3bb4f437d682a23cb33393a
Sarah Han

Designer

Thanks to Justin Cheng.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Amazon Echo – Read Temperature and Humidity from Sensor
Intermediate
  • 323
  • 12

Full instructions

I am going to show how to use Amazon Echo to read temperature and humidity from sensor.

Arduino101 Bluetooth Interfacing
Intermediate
  • 191
  • 3

Full instructions

Use the Arduino101 Bluetooth wireless interface with the Blynk GUI Library for control of things directly from your phone or tablet !

Intel Curie TinyTILE Dress: Accelerometer + Optical Fibers
Intermediate
  • 395
  • 10

Full instructions

A dress using Intel Curie accelerometer on TinyTILE and its small form factor to control colors of the optical fibers with arm movements.

MAKERBALL
Intermediate
  • 994
  • 4

Makerball is a DIY pinball machine kit that can be upgraded digitally with the Arduino Genuino 101. Here we show you the electronical part.

MAKERBALL

Team Makerball.org

Voice Controled Click Lamps
Intermediate
  • 110
  • 2

Work in progress

We have a couple of floor lamps from Ikea. They have two lights in each, and a switch for each light. Let's control them remotely.

Control RGB LED by Dragging – Arduino 101 & App Inventor
Intermediate
  • 422
  • 4

Full instructions

This topic will teach you how to control a RGB LED on an Arduino 101 board with an Android device (MIT App Inventor).

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback