Introduction: Home Automation System Using Arduino and SIM900 GSM Module

Hi there! As I've almost finished my studies at Faculty of Engineering, I had to make a graduation project and my thought was to make a jaw-dropping thing (I know that's hilarious :D ) to show everybody that I'm a good prototype maker and I can turn ideas into real and useful things.

I know GSM controlled home automation systems are widely used and can be found easily on internet, but as we all know, the prices are very prohibitive for general consumers. This is why I've tried to build some sort of device based on open-source knowledge that can be replicate by all the hobbyists, even if they are amateurs or professionals.

So I begun to think what kind of basic home appliances could be remote controlled via GSM network and nothing else? We all know, that you can control lights, heating, multimedia system and so on, but I've tried to make my project closer for my basic needs: lighting and heating (optional - garage doors, but it's not my case because I live on a 3rd floor apartment).

I mention that the finished prototype, seen in the photo, can be used safely (with a bit of tweaks, of course) on any kind of building with or without garage (the garage door relay can be repurposed for any other activity)

For this project I've used:

1. An Arduino clone
2. SIM900 GSM SHIELD
3. Relay module
4. 2x16 LCD Display
5. DS18B20 temperature sensor
6. Push button
7. Some Dupont wires
8. A led module (this is optional, if you have a chinese relay module with built in LEDs)
9. Some nuts and bolts to mount everything in place
10. A wooden chopping board or other kind of wooden board for propper display of the components

The costs?... The gsm shield was about 40$ from eBay, LCD...2$, DS18B20...1.5$, Dupont wires another 2 bucks, push button...few cents, the relay module 2-3$ to make and the Arduino clone was less than 10bucks to make...
Conclusion: you can build your own basic GSM home automation with less than 100$!

If you like this instructable please feel free to vote it on each contest it is subscribed! Thanks! :)

Step 1: Making the Arduino Clone

For this project I wanted to make a stand-alone Arduino board because I only have one Arduino UNO and I'm using it for my random project, so the need for a clone board was huge. I've managed to modify a schematic provided by my good friend Nicu Florica, which is derived from Nanino project and for my application I've added few pins to facilitate the connection of other devices (sensors, relays, etc) when a shield is attached on the main mother connectors.

The method used to make the PCB is just p'n'p using Oracal 641 paper, an 8 years old HP LaserJet 1018 printer, a clothes iron, ferric chloride etchant, some kind of dissolvent to clean out the toner traces after etching process and obviously a copper-covered board ready to be turned into a PCB.

After etching and cleaning the finished PCB, I've drilled all the holes for components and connectors, I've soldered them all, I've checked for short circuits and the result can be seen on the last photo.

The BOM is:

- ATmega328P-PU
- 16MHz Quarz
- 2 x 22pF caps
- 3 x 100uF caps
- 1 x 10uF cap
- 1 x 47uF cap
- 2 x 10k resistors
- 1 x 1k resistor
- 1 x 1N4007 diode
- 2 x 5mm LEDs
- 1 x 7805
- 1 x barrel power connector
- 1 x push button
- some male and female pin headers


Because I don't think that the etching and soldering processes are important, I've only made few pictures of the critical parts of the building.

Step 2: Making the Relay Board

Another friend of mine (Vlad) made a PCB schematic for the relay module because I have been busy with some exams and programming. He's actually a master in Altium Designer so he made the schematic in no time. As you can see, the relays are 5V ones, each one controlled by its own BC639 NPN transistor and also equipped with its own anti-parallel diode to prevent the destruction of transistors.

The BOM of this module is:

- 4 x Omron G5LA-14
- 4 x BC639 NPN transistors
- 4 x 1N4002
- 4 x 1k resistors
- 4 x screw connector
- 1 x 6pins male header

Step 3: GSM Shield

That's not much to say about this shield... I purchased it from ebay for about 35$ and it works just fine. The sad part of using it is you cannot add interrupt features to the project because it uses pin D2 and D3 for software serial communication and those pins are also used by internal interrupts system of the microcontroller. Also pins D7, D8 and D9 of the Arduino are reserved for incoming call presence, software power up and software reset of the GSM shield.

Step 4: Testing the Schematic

After putting almost everything together, I've made a test using each of the component to see if it works well or not, but I realized that the PIR sensor sucks. My second idea was to implement some security features in the code, but I've seen that PIR sensors turns high randomly even if the potentiometer from the top of it are turned or not. That's shame...

Step 5: Making Some Sort of Breakout Board for DS18B20

In the pictures you can see that the DS18B20 sensor is powered in parasitic mode, but after a lot of testings with bad results (-127degree C error), I've switched to direct powering and everything was just fine.

Step 6: Putting Everything Together...

For the base, I used a wooden chopping board that I've drilled some holes on it to fix all the components in place with bolts. Also for the finishing touch I've used some black spray paint to make the board a little bit sexy. :D


So if you ask for connections between Arduino clone and other components this is the order:

1. LCD Display is connected through i2c using arduino's A4 (SDA) and A5 (SCL)
2. Relay module is connected on digital pins 6, 10, 11 and 12. Note that I've didn't used digital pins 7, 8 and 9 because are used by the GSM shield
3. DS18B20 is connected to the A0 pin
4. The button is connected to A2 pin

Step 7: Sending Text Messages and Receiving Feedback

This is an example with sms commands and the feedback received from the system... Sadly I only did that in romanian language, but you get the picture of the whole thing. :)

Step 8: And a Short Demo...

I've made a short demo with this system, but because of lack of time I only made this in my native language, romanian. You don't need to understand what I'm saying, just watch carefully and don't forget to vote if you like this Instructables! Thanks alot guys and if you want some advices or you have some advices I'll be happy to read your comments.

Step 9: PLEASE READ THIS!!!!

Please do not send any requests for the code on the comment section or on private messages. As I said before, the code will be soon available to be purchased for few $ via PayPal because I really need money to finance my future projects. Please understand that it took me a week or two of hard labor just to put everthing together you've seen in this project and I cannot take back that spent time. Thanks!

Comments

author
thodo made it! (author)2017-07-24

Hi engineer

would you send me the schematic and source project and code for arduino
thanks

send mail: thodo57@gmail.com

thank's

author
Eboh made it! (author)2017-03-23

Good Day,
Please does anyone have the code for Home Automation System Using Arduino and SIM900 GSM Module please i need it before Monday please send it to ebohchinemelum@ymail.com

author
Pakto Sekiel R made it! (author)2017-03-10

plz send me source code. Thanks pakto.sekiel.rambe@gmail.com

author
Ali RezaZ1 made it! (author)2017-02-27

Hi , very goods project , plz send me source code. Thanks
Ali.reza.zarghi@gmail.com

author
Danialh2 made it! (author)2017-02-18

Hi engineer
would you send me the schematic and source project
thanks
danial.hp12@gmail.com

author
bedhoR made it! (author)2017-02-11

nice project, would you send email the code to me, my email is bedhore07@gmail.com, thanks

author
Gigima73 made it! (author)2016-09-27

Mi mandate con paypal il codice.
lelmartino@gmail.com

author
enduroman80 made it! (author)2016-08-18

salut! Marfa proiectul felicitari!

Ma intereseaza ce ai folosit pt Android, ce aplicatie pentru mesaje si codul sursa de la GSM 900 !

Felicitari si multumesc anticipat!

Ionut.

author
DomingoP5 made it! (author)2016-08-05

buenas tardes, me podrian enviar el codigo porfa, dapzzz@gmail.com

author
vitul24 made it! (author)2016-04-04

I want to work with SIM 900 but which simcard i should use

i tried fido, chatr, rogers but none of them are working

anybody please reply fast as i have my project due in a week

author
kapilavarman made it! (author)2016-03-28

i need code of this project pls send it my mail id my mail id kapilavarman@gmail.com

author
maja.pavlovic.144 made it! (author)2014-12-30

I have a problem with your code, I was try with both codes but has much errors. I was modified code, software serial (7, 8), software on is on pin 9 on my sim900 shield. But have more errors.

This is a error:

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"

FGLFC5MHY5Y3H1U:9: error: 'NEGATIVE' was not declared in this scope

FGLFC5MHY5Y3H1U:30: error: 'OneWire' does not name a type

FGLFC5MHY5Y3H1U:32: error: 'DallasTemperature' does not name a type

FGLFC5MHY5Y3H1U.ino: In function 'void loop()':

FGLFC5MHY5Y3H1U:171: error: 'sensors' was not declared in this scope

author
flint Isaac made it! (author)flint Isaac2016-03-16

hie did you manage to solve the errors can you pliz send me the code at flintisaac@gamil.com

author
flint Isaac made it! (author)flint Isaac2016-03-16

hie did you manage to solve the errors can you pliz send me the code at flintisaac@gamil.com

author
flint Isaac made it! (author)2016-03-16

nice project can you please send me the code at flintisaac@gmail.com

author
flint Isaac made it! (author)2016-03-16

nice project can you please send me the code at flintisaac@gmail.com

author
honey181 made it! (author)2015-04-20

Haha.. Your wooden board is really sexy! ;) And presentation is neat. Keep it up! :)

author
Timofte Andrei made it! (author)Timofte Andrei2015-04-22

thanks!

author
ravi varma8500 made it! (author)ravi varma85002016-03-14

can you pls send the code to kamatamravivarma@gmail.com

author
woojak made it! (author)2016-03-01

good day sir! i tried to display the text that the GSM shield sends out on the serial monitor. the output was this

+CMT: "+639XXXXXXXX","","16/03/02,8:31:09:+32"
hello world

what does +32 mean? and where is it from?

author
NicholasM59 made it! (author)2016-02-25

please i need code for receiving sms from authenticated phone numbers for the gsm module and display on the lcd screen for my final year project.

please send to my email mensahnicholas55@gmail.com

counting on you

author
NourL made it! (author)2016-02-19

please send the code and schematics to my mail

alaa_seto2000@hotmail.com

author
adavenip made it! (author)2016-02-15

please send the code to my mail adaveniprashanth2@gmail.com

author
isaac8927 made it! (author)2016-01-31

hi am in China how can I get the code

author
Mk49 made it! (author)2016-01-24

Hi, great work. thumbs up. I need help in GSM kindly please if you can . I must mention that I don't have money to pay you for it. I am trying to receive reply from GSM when I request for something as you done it here.

author
Mk49 made it! (author)2016-01-24

Hi, great work. thumbs up. I need help in GSM kindly please if you can . I must mention that I don't have money to pay you for it. I am trying to receive reply from GSM when I request for something as you done it here.

author
bioenergiachile made it! (author)2016-01-11

Congratulation ...... !!!!

would you send me the code?

bioenergiachile@gmail.com

thanks!!

author
HudyP made it! (author)2015-12-29

would you send me the code please

hudypietersz@gmail.com

thanks

author
dmatosv made it! (author)2015-12-05

please send me the code: damirmatosevi@gmail.com

thanx

author
obaii1 made it! (author)2015-11-27

Hello , How i can to know the call number that the GSM receive? thanks

author
Timofte Andrei made it! (author)Timofte Andrei2015-11-28

it's written on the sim card when you buy it. or insert that sim card from the project into another cellphone and call your cellphone.

author
Timofte Andrei made it! (author)2015-11-21

Please do not send me requests for the code. Soon it would be available for sale because I need finance for my future projects. Thanks for understanding.

author
jaatbuddhi made it! (author)2015-11-17

Great project, great job, congratulations on both counts for getting "A" as well as for the neat and great presentation, only thing left out as an instructible, it stands incomplete without the code. Please do put the code in this instructibles and it would be complete, It would be very kind if you can email the code to me my email is mahibanquets@gmail.com thanks again.

author
Nguyễn QuốcC made it! (author)2015-11-12

HELP!!!!!!!Would you send me the code, please?

nguyenquoccuong1007@gmail.com

author
DwiS8 made it! (author)2015-11-09

please get the code

email : chouwey@gmail.com

author
KevinA50 made it! (author)2015-11-09

can i please get the code...dwiggymii@gmail.com

author
KevinA50 made it! (author)2015-11-09

can i get the code..dwiggymii@gmail.com

author
BuiT made it! (author)2015-05-12

help me!!!

Untitled.png
author
SlhX made it! (author)SlhX2015-11-07

please send me the code: slhrfs3@gmail.com

thanx

author
diozoli made it! (author)diozoli2015-05-14

Try to delete the space before and after the phone number so in the code should looks like :"+849xxxxxxxx" not " +849xxxxxxxx "

author
BuiT made it! (author)BuiT2015-05-14

thank !!!

author
SlhX made it! (author)2015-11-07

so great,

please send me the code am very intrested on this,

maybe like a reference to my final project this year.

good jop keep it up :)

my email: slhrfs3@gmail.com

author
Rafatahmed made it! (author)2015-10-30

Oh That's So nice Setup, its Great as a demonstration Automated Project, can you share the Code to let me work on it,

eng.rafatahmed@hotmail.com

regards, rafat

author
f_a_r_i_d made it! (author)2015-10-29

would you send me the code please

f_niknik@yahoo.com

thanks

author
Niklas4 made it! (author)2015-05-15

Hope you got a F for this code! so many bugs.. ex. Termostat part get stuck in an send new temp sms loop. Sms answer wont be sent properly etc... has spent so many hours to Try to fix it but now im giving up. Back to google... :(

author
Timofte Andrei made it! (author)Timofte Andrei2015-10-22

well the coding is good. but if you are too troll to use the latest Arduino IDE which btw it sucks from a lot of reasons, it's your problem. I'm aware that my coding experience it's not the best, but the project got A+ because it's working as it should. so stop crying me a river. When I've asked for help on arduino forums, nobody gave me the answer that I was looking for, so I've managed to found help using other ways. if my code it's not good, just use the codes from google, read the SMS messages letter by letter and everything should be just fine!

author
luciopedroc made it! (author)luciopedroc2015-10-26

Congratulations. That's a great project. Could you send me the code please? I'll thanks you a lot. email: lucio363@hotmail.com

author
Timofte Andrei made it! (author)Timofte Andrei2015-10-22

well the coding is good. but if you are too troll to use the latest Arduino IDE which btw it sucks from a lot of reasons, it's your problem. I'm aware that my coding experience it's not the best, but the project got A+ because it's working as it should. so stop crying me a river. When I've asked for help on arduino forums, nobody gave me the answer that I was looking for, so I've managed to found help using other ways. if my code it's not good, just use the codes from google, read the SMS messages letter by letter and everything should be just fine!

author
future_evolium made it! (author)2015-10-20

no problem if your communication is in romanian language. Just tell me please if that communication with arduino is through SMS?

author
Timofte Andrei made it! (author)Timofte Andrei2015-10-22

you send a command through SMS and if it's the right command the system will answer to your message ;)

About This Instructable

158,002views

239favorites

More by Timofte Andrei:Homemade flat Li-ion battery adapterArduino Temperature and Humidity logger with DHT11 and I2C DisplayArduino Universal Shield
Add instructable to: