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.

Contact
5f62597ecdc72ba3f266552b95b8a3b8
Robert Wu

Junior at USC. Go Trojans!

Contact
Img 6921 na2ljiikha
Sarah Han

Web Designer, UX/UI Designer, Graphic Designer. Skills include 3D modeling, software engineering & combining all for experimental projects.

Contact
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

LoRaCatKitty Build IoT Applications with LoRaWAN in 3 Steps
Intermediate
  • 1,003
  • 7

Protip

LoRaCatKitty Build IoT Applications with LoRaWAN in 3 steps with The Thing Networks and Cayenne.

Build Your Own Amazon Echo Using a RPI and ReSpeaker HAT
Intermediate
  • 6,386
  • 33

Full instructions

How to build your own Amazon Echo using a Raspberry Pi and ReSpeaker 2-Mics HAT.

Smart Shoes (Auto-lacing and Generating Electricity)
Intermediate
  • 543
  • 7

Full instructions

Features of smart shoes: generates electricity, auto lacing, step counting, etc.

Build Your Own Google Home Assistant with Android Things
Intermediate
  • 392
  • 5

Build your own Google Home Assistant with Android Things using one of the supported platforms, such as the Intel Edison or Raspberry Pi.

Arduino101 / tinyTILE BLE: Match-Making Sunglasses
Intermediate
  • 5,185
  • 20

Full instructions

You can make someone else's sunglasses see-through via BLE and check them out from far away, perhaps with your heartbeat.

Water Valve
Intermediate
  • 401
  • 6

Work in progress

Control your garden's watering with sensors or from your phone.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login