Finished Home Automation University Project

Hi guys,
Here is my finished Home Automation project, using 3 Spark Cores an IP camera and a WeMo Switch.

Let me know what you think and if you have any questions just pop them in the YouTube comments section.



I was wondering what did you use to write the andriod app and how are you communicating with the core?
Great work

I used Eclipse to write the android app- you need to know Java and a bit of XML. The graphics are all done on Photoshop.

In order to send and receive information to and from the Core I have used a httpPost in the android application, which includes the following:
Cores ID number
Users Access Token
Function name
Information to be sent

Then in the Cores code it has a corresponding Spark.function that is used to read the information sent. The Android app can receive information from the Core by allowing the function to return a value .

I would happily post the code for this but as it is a university project it is yet to be assessed so must consider plagiarism checks.

I have also used a website called Ubidots, to plot the temperature and humidity and monitor the Carbon monoxide levels. To put the graphs into the android application I have used whats called a WebView.


yes,i would like know more.

Really cool project.

A couple of questions:

  1. How did you do the device discovery with the Spark Core + NFC app. I’m not interested in how it works electronically or physically. I’m more interested in how you broadcasted/discovered that A, it’s a Spark Core (probably on the NFC tag) and B, it’s a mood lamp (perhaps also on the Spark Core). Could any arbitrary RGB light device be used? What “spec” would it have to follow to be considered a “mood light”?

  2. I like that you tackled alarms but I’m not sure I’m a fan of how you did it (not sure it needs an NFC tag). I’m alright with the idea of using the NFC tag to discover the device but once added you should need to add it again to discover a new cooking time. Perhaps it worked this way but, in my ideal little world, you could add the timer once and then, whenever you set the time either locally, at the timer, or remotely, on the app, you would instantly see that the timer was updated on either device (minus some communication delay). If you started the timer on the app you could pause it, or here it go off, on the actual timer device. Realistically I doubt the timer would be much more than a even receiver and the actual timing could happen in the cloud (if you had the resources)

1 Like


  1. Basically with the NFC tags I have programmed them to open up the Android application when scanned, so anyone with the application on their NFC enabled device can scan one of these tags and it will automatically open up the application. The next step, is as you guessed, there is a String stored on the NFC tag which indicates if it is a Spark Core and also contains the Device ID and the type of product it is connected to, e.g a “MoodLight”. The android app reads all this information and decides what to do. I’m not aware of any specs for a product to be considered a MoodLight but have seen numerous devices classed as MoodLights that also simply use RGB LED’s. I guess MoodLight simply sounds better than just Light :smile: Here’s a photo of the circuit built onto stripboard, just using standard 5mm RGB LED’s.

  1. This is also something I considered. The idea behind this was to allow a user to set a reminder with minimal effort, i.e. no touching of the phone screen. Anyone can setup a reminder on their phone these days but it requires multiple touches of the phone. So for instance, say the user sets the washing machine to a 2 hour wash, you could easily automatically send a notification to the user when the wash finishes without any NFC scan or any effort on the users part. However, the problem occurs when their are multiple people in the house. The NFC tag is effectively used to determine who in the house wants to be reminded. Note: The application doesn’t deal with giving the Core the WiFi credentials.

Depending on the device it is monitoring additional controls could be added and users with non-NFC devices could go onto the application and set a reminder to occur from the time remaining.

The idea works better with a SmartWatch, as doesn’t require the user to get their phone from their pocket or wherever they have left it, whereas a SmartWatch is more likely to be with the user and only requires the user to put their wrist near the NFC tag. Another way you could do it is send a notification to all devices in the Home and allow any of the users to accept the reminder. However, this would be both annoying for other people in the house and would require the user to touch their device multiple times :smiley:

Another option I considered was using an NFC transmitter, thus requiring no Wi-Fi connection, the NFC transmitter simply transmits the time remaining and the phone reads this time and sets a reminder.

Whether or not appliance manufacturers would be willing to include this type of technology in their appliances is another question.

1 Like
  1. I was thinking more along the lines of something like this:
    You scan the tag. It contains a device ID, a read-only access token (they are coming), and perhaps even a custom api-url (so users would be free to use another compatible cloud service). Your device issues a variable request to the device asking for it’s deviceType (custom spark variable). it would come back with “moodlight”. Your app now knows what the heck it is. It’s next request is for the device owner. You make another request asking for the owner of the read-only access token to give you a “write” access token (revokable by them later, these are also potentially coming). The owner would get an email and be allowed to distribute an access token to you automatically (clicking a link in the email). Your app simply places the mood light in a “pending” group until it is given the access token. The flow of the second part of this (the special access tokens) would need to be figured out. It’s something I’m hoping to integrate into my phpSparkDashboard project I’m working on.

  2. I agree with the minimal effort desire. Perhaps this is one of many ways to do it. Keep up the good work

1 Like
  1. Your method would definitely be a better way to do it I agree, much more secure, I like it! Had a little look at your phpSparkDashboard project, the demo works well, thanks for sharing it.

It is really an awesome project. Could you please share your code if your university assessment is completed ??

1 Like

Thanks Bijay. Once the project has been marked I shall share the code, this should be sometime in June I am afraid.


I made a review / case study on smart watches for my university (Conservatoire National des Arts & métiers at Lyon city) and your project is very interesting. Do you have published some papers in your university which I can cite for reference ?

Hi, thanks for the interest, i’m afraid the project was a 3rd year project with no reference to any of the universities papers. You could perhaps reference my report, but it is a 3rd year project report, definitely not a published paper. :confused:

Well, if your work has been validated by your teacher/university, there’s no problem. Could you send to me (my personnal mail : your report to see if I can cite it in my paper ?

Hi, I was planned to use nfc tag to control home lighting for my University project. Could you please share with me your code for my reference ?

Thanks in advanced.

See below for a link to my project code.

MyApplication - Just reading data from an NFC tag. (NFC tag can be programmed with plain text easily using NFC tools:
To use the MyApplication import into Android Studio. If you want to use in eclipse you could copy the code across manually, but you will struggle to import it into eclipse.

MyHome-The full application shown in the video.

Also included is my report and the application APK
Please reference me in any work thanks.

Kind Regards,
Joe Banks