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
7 projects • 6 followers
I am a software developer with a background in physics and low level programming and I am currently focused on web and mobile development.
Contact
5f62597ecdc72ba3f266552b95b8a3b8
Robert Wu
1 project • 0 followers
Junior at USC. Go Trojans!
Contact
Snapchat 4349759409709142701
Diego Humberto Gonzalez Alanis
1 project • 0 followers
Contact
Img 6921 na2ljiikha
Sarah Han
1 project • 3 followers
Web Designer, UX/UI Designer, Graphic Designer. Skills include 3D modeling, software engineering & combining all for experimental projects.
Contact
Thanks to Justin Cheng.

Comments