There are a lot of projects today trying to help aged people to stay more independent. As my grandmother is now 95 and she still lives by herself in her apartment, I wanted to check how I could help her staying at her place as long as possible.

One of the main problems for old age people is keeping their balance while walking. It is getting more and more difficult to move, and if they fall down it's very complicated to get back up. My family is calling my grandmother every evening to check for this kind of problem. There are some emergency buttons that can help, but you often have an expensive monthly payment for the call center. In addition, most old people don't like to wear some gray plastic technologies around their neck.

So my question is :

How to make a device cheap, reliable, easy to integrate, discret and with no monthly payment?

Step 1: How Does It Work

In most apartments today, you can easily reach 10 or 20 wifi connections. So I decided to build a wifi connected device, which make things easy to communicate with the external world. As a lot of old age people don't actually have a wifi, i decided to ask the neighbors for wifi access. Most of them were very happy to help and even asked to add their Email address to the list so they can quickly help in an emergency.

If a person is in distress for a reason, he or she has to press a simple button on the device. A LED turn on to confirm the emergency is activated. The device will connect to the internet box and send an Email to a pre-entered Email address. As a lot of people receive Email on their phone and check their phone 30 times a day (like me :s), the emergency can be quickly followed by calling the person or knocking at the door.

The device has to be easy to wear and to integrate. Therefore, it was important to reduce dramatically the size and the weight. As a result, the device is 2.5 * 1.5 * 1 cm in size ( 1*0.6*0.4 inch) which can be easily integrated to bracelets, necklaces or clothes. As some aged people are trembling a lot, the button is quite big, which makes it easier to press.

The price is also a very important question. If you want to make a wifi connected device today, the ESP8266 board is a very good choice! It costs only a few dollars and it has its own 32bit reprogrammable micro-controller (The Atmega328p on the Arduino UNO is only 8bits). A big community is now using this device and it recently became Arduino IDE compatible.

The electronic cost is around 8$ which is affordable for most people and you have to add a battery of your choice. All the components are easy to find and to adapt if you want to make a new design by yourself. A standard 110 mA battery should work more than 2 months, a CR2032 for 5 months and a 1000mA for 2 years.

Step 2: Part List

For this project, i used the cheapest and smallest components I could find. The ESP8266 is a great tool for any microcontroleur/wifi application today. Plus, it's now Arduino compatible!

As i was adding program inside the ESP8266 100 times a day, I decided to also build a user-friendly programmer. You actually don't really need it if you don't want to change a lot of thing on the code.

Device Part List :

  • ESP8266 7$ uC, Wifi and Wifi antenna.
  • Button 0.5$ choose the one fit the best in your model, I used a "pushbutton 12*12*8cm".
  • LED 0.35$Resistor 0.02$ (I used a flat top 3mm bought on Ebay)
  • Battery 6.95$ In a bigger device you could use a CR2032 to multiply the autonomy by 2.3 or even this bigger Battery to multiply by 9 !
  • SMTP2GO Account FREE. It forward the mail between the device and your mail account (the Free version is limited to 20 mails a day).
  • Email Adress FREE. I used a GMAIL one with this code.

To program your device, you gonna need a few wires and :


  • Arduino board with removable chip like UNO (but not the SMD version!).

On the second part of this Instructable, I explain how to make a more reliable programmer. You need to add the following components if you want to build it :

Step 3: Programming Your Board

There are many ways to program your ESP8266 board :

The most important component for programming is a Serial to USB converter like the FTDI FT232RL. You can find one in a special device like a FTDI board but you also have one in every Arduino Board that you can program over USB (On the UNO the FTDI has been replaced by a 32u2, but it worked exactly the same).

If you have a UNO board for exemple, if you remove the microcontroleur you can use the RX, TX, GND, 3.3V Pin to reprogram the ESP8266. Of course, the Arduino board has to have a removable chip...

The second important note is you have to change the GPIO 0 Pin to be able to program (Ground state) and use (3.3V state). It's sometime a bit confusing because after programing the new device code will start automatically even if GPIO 0 is still grounded. But if you restart the program you have to make sure that GPIO 0 is 3.3V or it will not work!

So with few wire, an Arduino UNO you can program your ESP. But this technique can easily give you headache if you are programming the board a lot, because when it's not working or when you need to add other components you never know if the problem is hardware or software... So you spend a lot of time checking if no wire got unplugged or plugged in the wrong place! That's why I have built a prototype board.

Step 4: Software

The first thing to do is to install the Arduino IDE for the ESP8266. You have all the information you need here

Now we have the programer for the board, we have to take a look at the software. The device need to connect to the WIFI network and send a Email throw SMTP. As GMAIL (and many other Mail serveur) doesn't accept SMTP protocol, i used a SMTP2GO server as a mediator. So the device send a mail to SMTP2GO and then it is forwarded to your Email account. To open an account on SMTP2GO, it's free and take only few minutes.

As this project is using Internet connection over Wifi and need to send Email, we have to change few lines of code for every applications. In this case it's gonna be all the places with some ******** on the code :

- Your SSID of the internet box, the name of your wifi network

- Your password of the internet box (WPA2/PSK in mine), so the device can connect

- Your network setting, you have to add a fixed IP address on your internet box corresponding to the MAC address of the board. You can also program your board and read with the Arduino IDE on Serial and see when the device connect. The IP address will appear. (The problem is, it can sometime change, depending on the internet box). I think those line are actually not really useful :s

- Your Email Address, to receive Email from the device. I used a GMAIL account and it worked fine, you have to check that your mail address is compatible with SMTP2GO.

- The mail address and the password of the smtp2go account in base 64. You have to translate it from this website for exemple

- You can also change the object and contents of the Email.

Once you have done this, you can compile your file and send it to the ESP8266. Now, every time the ENABLE PIN is getting LOW and then HIGH the device will restart, turn the LED ON, connect to your Wifi, send a mail, turn the LED OFF and go to a sleep mode. The process can take between 10 and 30 seconds depending on how fast it connect.

The only difference between the device code and the programer board is in the second one, it send a mail only when you press the button.

Step 5: Device Board Assembly

So, now the ESP8266 is programed, it's time to build the Hardware part of the device.

The circuit is quiet simple, I drew a schematic on Fritzing to understand how the components are connected. You can adapt the 1k resistor (brown, black, red) depending on how bright you want your LED.

Step 6: Prototype Board Assembly

How to build a good and stable programer board?

As i said in the Parts List, it can be useful to build a programer board to ease the communication with the ESP8266.

Here is the components I used :

- A protoboard to solder the components so everything has good and reliable connection,

- Two buttons : one for the Enable (to reset) and one plugged on the GPIO Pin 2 (if you need to easily control an action, in my case "Send a mail") One LED on the GPIO Pin 0, it can help a lot on debugging. Plus in my case, it show that the sending mail action is processing.

- Two male Header to switch from Pull Up, Pull down and nothing for the GPIO Pin 0 and 2. The GPIO 0 configuration is essential to load a program on the ESP8266. I used a three Pin Header and I plugged the GPIO in the middle and change a Jumper positions depending on what i need. I also used some angle Male Header to be able to plug the power supply and the FTDI board.

- Some Female Header to plug the ESP8266.

- A regulator and a 10uF capacitor to have a clean 3.3V signal. The ESP can have some 200mA power peak, it is way better to have an external power supply than use directly the one from the FTDI. Lots of people have reboot problems with the ESP8266. The power stability is a first key to avoid this. You can power with a 5V power supply or USB, but also with a 1cell 3.7V Battery (I used an old Iphone cable at the beginning and then a Battery) On the pictures you can see how i plugged all this.

Now we have a nice little device, that send mail and turn LED when you push buttons. The second code I posted is for this programer. The only difference is it read the GPIO Pin 0 and connect only if it's pushed. So you can control better when you want to activate the device.

Step 7: Battery Management

In every embedded device, you always ask yourself a question : how long will my device be autonomous?

To answer this, we can go in this tutoriel. The 7.1 section of the technical documents seems to specify a consumption of 75mA when it's operating and 60uA in deep sleep mode. But this tutorial also add a very important information : the LED consume around 8mA which is huge compare to the 60uA we are trying to reach. So the best solution is to unsolder those two onboard LED (specially the power one, which is ON all the time!).

When you start the device with the code, it will turn the LED on (on GPIO 0), connect to the wifi and send a Email. And then we call the function :

ESP.deepSleep(0, WAKE_RF_DEFAULT);

This will set the ESP8266 into a deep sleep mode with no waking up (the 0 here means no wake up). The button is solder on the ENABLE line of the ESP8266, so when it's pushed the all system restart. In this solution we don't need any other hardware modifications than the unsolder LED to reach our deep sleep mode.

A delay is following the deepSleep function, it's important to let the uC the time to enter in the sleep mode. Without this it will probably not sleep.

If we calculate now the autonomy in a ideal state when we don't press the button with a full 110mA battery:

Time (H) = 110 000(uA) / 60(uA) = 1833 hours.

1833 / 24 = 76 days

On a CR2032 accus which has around 250mA we can reach around 173 days so almost 6 months

On a 1000mA battery we have almost 2 years!

With those calcul we can see how the choice of the battery is important when you design a device!

Step 8: Covering

I really like drawing electronic project, but I have to admit that it's not very esthetic... especially for aged people.

A friend helped me to find a CAO of a band and to draw with SolidWorks the top and bottom part. The device perfectly integrate in this "watch shaped" plastic cover with the 110mA battery. As it's been print on the side, the band is really strong and flexible.

I little bit of painting give a final touch to the housing. ;)

Step 9: How to Improve the Project

When i am designing a project, i feel like it's never gonna be done... the longer you work on it, the more functionalities you want to add! Here are some ideas :

- The button hit the Enable signal, which means if you press it every few seconds, the message is never gonna be send until you stop! An interrupt would be better, but in this case we can't come out from deep sleep mode. Another solution could be designed.. But i am not sure it can be done with those chip.

- To add or change your mail or internet box configuration, you have to reload the entire code in the chip. A configuration mode could be designed to push this information through the WIFI for example.

- We could add a recharge circuit for the battery.

- A low battery indicator could be nice too. If we use the ESP8266-12 for example, we have access to more Pin. We could easily add another LED with a red color to warn from low battery.

- The integration of the electronic is a bit difficult right now with small wires and resistors, I could design a little board to ease the solder.

Step 10: Conclusion

I hoped you all enjoyed my first Instructable.

As you can see on the last step, there is many ways to improve this little device... If you have any ideas or any questions, I ll be glad to work with others people on making it more reliable and efficient.

I ll present the results to my grandmother next week and probably post some new pictures soon. :-)

<p>Can you plz look at this</p><p><a href="https://www.instructables.com/community/security-system-not-responding-after-combinin-ultr/" rel="nofollow">https://www.instructables.com/community/security-s...</a></p><p>small help thanks</p>
<p>Why you dind not connect VCC of the FTDI USB to the capicitor ?</p><p>here is mine ...i dont know where i will connect the VCC of the FTDI !!!!</p><p>does the openLog wires are True or not ? and the auther GPIO ?</p><p>and how to add the battery after programming and removing the FTDI ?</p><p>i'm beginner :) i need help and thx lot brothers</p>
<p>Hi, </p><p>Your schematic seems to have a little problem. The input VCC and the ground are linked. Is your regulator 3V or 5V? A three volt regulator transform a higher voltage to a smaller one. For example a 3V regulator will transform 4V ( or more as input) in a 3V.</p><p>You want your circuit to be able to charge the battery when the USB is plugged, and use the battery when the USB is unplugged? In this case, you are going to need a battery &quot;switch&quot; to make the electricity goes in the good direction... (for example a MCP73831T). </p><p>Using an ESP with an FTDI board directly powered by the VCC is a bit unstable. The FTDI board isn't suppose to give enough current to power the ESP. Adding an external power supply is a better solution. </p>
<p>i fix some wires...what about this diagram ....this diagram is when flashing the ESP ..it will be Power up by FTDI USB (3.3v) ..does it is enought or must add a battery but this will be dangerous on the components !!! </p><p>Also i have problem with the Blue Led it must light when the send Data Button in ON ..does it is possible to add Led+push button is same Gpio when the led=digital output and the pushButton= digital input !!!!! ???</p>
<p>If you power your device from FTDI, you will sometime have problems when you send datas. The device will disconnect because it drain to much power... </p><p>If you want to add a battery, to use your device autonomously, you can check this board. It uses a very nice way to switch between the USB, the battery and the circuit</p><p><a href="http://www.theairboard.cc/wp-content/uploads/2015/12/theairboard_schematics_rev2.1.pdf">http://www.theairboard.cc/wp-content/uploads/2015/...</a></p><p style="margin-left: 20.0px;">For the blue LED. I don't think you can wire it this way. Basically you added a pull up to a pin of the ESP. So this Pin is HIGH. When the button is press, the ESP pin is Low BECAUSE of the resistor with VCC. </p><p style="margin-left: 20.0px;">This resistor has to be pretty high (we usually use more than 10kohm). If the resistor is too low, the circuit will be shortcut when you press the button. </p><p style="margin-left: 20.0px;">As you need a big resistance, the LED can't be powered... </p>
<p>getting error:</p><p>334 VXNlcm5hbWU6</p><p>334 UGFzc3dvcmQ6</p><p>Sending From</p><p>535 Incorrect authentication data</p>
<p>Hi,</p><p>I have the same problem. Can you fix it?</p>
<p>Hum, I have to do some testing. </p><p>Can you give me more details? You have uploaded the code on the ESP8266 and connected it to your internet network? Or not yet? </p>
<p>Hi Jeano,</p><p>getting error:</p><p>334 VXNlcm5hbWU6</p><p>334 UGFzc3dvcmQ6</p><p>Sending From</p><p>535 Incorrect authentication data</p>
<p>nice...good explanation and clarity is awesome...</p>
<p>Thanks ^^ </p>
<p>Hi. Nice project : </p><p>what is : EHLO</p><p>??</p><p>thank you :)</p>
<p>Hey, thanks! </p><p>I forgot to mention, you have to add your IP address there. I am not actually sure what the word EHLO stand for... </p>
<p>In case anyone are still interested, &quot;EHLO&quot; is a command using in the email protocol (smtp) for identifying yourself. The server will then respond with its capabilities.</p>
<p>Didn't know that! thanks :)</p>
<p>Hi Jean, I got an email, so everything is OK!!! Thank You!</p><p>I moved the block &quot;byte sendEmail()&quot; before the &quot;void setup()&quot;, as You mentioned, but it was not enough. I had to move the block &quot;byte eRcv()&quot; and the block &quot;void efail()&quot; . I have some more smaller problems, but I can manage them.</p><p>How can be upgraded this program, that can send an SMS to a phone?</p><p>Thanks once again.</p><p>Pali</p>
<p>I am glad I could help ;) </p><p>I didn't work on the process on sending text message yet, but there probably many possibility. You can check the comment from <a href="https://www.instructables.com/member/Bighatgmw">Bighatgmw </a>on this tuto from 4 months ago, he was talking about this...</p><p>I have another big project to finish on the next few weeks, so i am not gonna have time to implement text message soon. But if you find any solutions, keep me in touch :) </p>
<p>Hi <a href="https://www.instructables.com/member/jeanotP1314" rel="nofollow">jeanotP1314</a>, congratulation for the good idea, I want to make the same project.</p><p>I have some problems, please help me. I can not send the program (Emergency_Final) to the board, I get the following message:</p><p>Emergency_Final:44: error: 'sendEmail' was not declared in this scope</p><p>-so something is missing. Thanks!</p>
<p>Hi, </p><p>I just checked my program and it seem that your Arduino compiler doesn't see the function sendEmail(). The function sendEmail() exist, it's on line 58. </p><p>Sometimes, the program doesn't check the function located under the setup and the loop. Maybe you can try to add the line</p><p>byte sendEmail(); </p><p>on line 24. He should see that a function actually exist... </p><p>Is this doesn't work you can try to copy the entire function &quot;sendEmail()&quot; (from line 58 to line 127) and add it above the setup (line 24) </p><p>The program should see it </p>
<p>Nice project, consider this for upgrade!</p><p>It adds a periodic ping and continues to deep sleep. And it activates the &quot;panic&quot; segment of the loop only on button press. <br>For now im stuck without the best battery choice and becouse of that, didn't jet make a suitable housing.</p><p>My project: </p><p><a href="http://hacklabos.org/2015/10/project-gem-panic-button-with-esp8266-openwrt-linux/">http://hacklabos.org/2015/10/project-gem-panic-but...</a></p>
<p>Sorry for the late reply! </p><p>I didn't really work on the software the last few weeks, but i am very happy to see someone helping me to improve it :) </p><p>By adding a periodic ping, do you keep the wifi connection with the internet box? If yes, how often du you have to do it? </p><p>Thanks! </p>
<p>Nope, the device sleeps and consumes a bare minimum of energy, when it wakes up it connects to wifi network and sends a ping. the ping is there to ensure that the battery and the device are still working even tough the button is not pressed. You can experiment with deep sleep and put the optimal time delay for the ping, but if the device does not send a ping for a day, then the battery can die and you won't notice for a whole day.</p>
<p>Hello Jeano, I made it, it worked in 1st shot itself, without giving the MAC ID of esp. esp is able to send the mail by pressing RESET switch.</p><p>When the MAC ID is required?</p>
<p>Great! Congratulation!! :)</p><p>I think the mac ID is useful when you keep a internet connection active. It's suppose to be the unique &quot;hardware&quot; ID of your device. As you are just connecting for few seconds, you don't have much risk of interference with another device with the same ID. </p><p>But I think it's still a good idea to randomly change it (if several people use my code to connect to smtp2go with this ID it could probably create some problems...) </p>
<p>I am sorry, maybe I am mistaken but isn't CR2032 a 3.0V batery ?</p><p><a href="https://en.wikipedia.org/wiki/CR2032_battery" rel="nofollow">https://en.wikipedia.org/wiki/CR2032_battery</a></p><p>If so, It won't work, because it doesn't have enough power for the chip to connect to the AP right ?</p>
<p>Hi, </p><p>That's a good question, I actually tried with a fully charged CR2032 and it worked, but sometime it randomly doesn't connect to the AP. So I guess when the battery is going to drop down it will get worse... The solution is probably to add two batteries in serial so you can have 6V. </p>
<p>Even that will not help you. The problem is the current. Those type of batteries can only deliver several mA. There are also 3V batteries like the cr2 or cr123 that can deliver much more current. And this is required because the Wifi chip can use approx. 200 mA at peak times.</p>
Great work! Congrats.<br>I've used your function sendemail in my project http://inventosychapuzas.blogspot.com.es/2015/12/caldera-wifi.html?m=1<br>Thanks a lot!
<p>haha, so you built a communicating boiler?? That's cool :) Glad I could help! </p>
<p>Thanks for the mention! We love being part of the Arduino community experiments. Feel free to grab yourself a free account with SMTP2GO - you can send 25 messages per hour and a total of 1000 per month. Paid plans offer more, of course! :)</p><p>www.smtp2go.com</p>
<p>Thanks a lot, that's awesome!! I will definitely use your service in other projects! </p>
<p>Really cool!</p>
<p>Thanks :) :)</p>
<p>Really cool!</p>
<p>Hey <a href="https://www.instructables.com/member/jeanotP1314" style="">jeanotP1314</a></p><p>Great Instructable. Indeed it can be used in many practical situations with only the slightest modifications.</p><p>I have built the prototype board as per your fritzing image and have just a few questions before I add any load to this. Please do excuse my ignorance. I am a complete #ArduinoBeginner or noob as some might say ;-)</p><p>Q1:<br>The buttons on your fritzing image. Are these not supposed to go in one end and out the other?</p><p>Q2:<br>The red lead that comes from VCC and passes over the capacitor. Are these connected?</p><p>Q3:<br>Your fritzing diagram shows 4 resistors where your build image only has 3. Very confusing for an #ArduinoBeginner</p><p>Q4:<br>There seems to be no VCC (red line) on the fritzing image from the FTDI. Please indicate how this wiring should be done.</p><p>Looking forward to your response. Eager to power up.</p>
<p>Haha, it look nice :) </p><p>Q1: On many pushbutton the connection is like I show on the Fritzing. With a multimeter you can easily check if it connect when you press the button. (if you have no multimeter, power up a led and see in which position the current is passing)</p><p>Q2: Yes those two lines are connected. </p><p>Q3: I actually have 4 resistors. It's just that one is under the ESP8266 so we don't really see it on the picture.. </p><p>Q4: the idea is to have an external power for the ESP8266. So you don't need to plug the one from the FTDI. The ground must be plugged so the ESP and the FTDI are based on the same power level.</p><p>Be careful with the regulator, there is so many of them and they don't have always the same connection, i can't see which one it is from your pictures. To check the datasheet of your regulator write &quot; the name + datasheet&quot; on google, it will tell you the INPUT(where 5V is entering), THE OUTPUT (The 3.3V for the ESP) and the GROUND. </p><p>Hope I could help ;) </p>
<p>Hehe, Thanks. many hours for me.</p><p>Q1: Thanks I will do this</p><p>Q2: Thanks</p><p>Q3: Cool</p><p>Q4: Very confusing for me. So in this image &gt; <a href="https://www.instructables.com/file/FMO1E60IG2JHW1W/?size=LARGE">https://www.instructables.com/file/FMO1E60IG2JHW1W/...<br></a>... your VCC is not wired up?</p><p>My regulator is LD33CV &gt; It looks like the same pinout as yours?</p><p>Are you able to send me the fritzing design. I'd like to move things around as I have it wired up on my board and ask you more questions.</p><p>Currently the ESP does not power-up when I plug USB in. I have checked wiring many times over. I am not sure which of the pins to use and when. Can you elaborate on these please.</p><p>I am determined to get this working. Your help is appreciated.</p><p>Cheers</p><p>Dale</p>
<p>Q4: yes on the picture, the circuit isn't power up. You need to add a 5V power supply. A one cell (or two) battery should work too.</p>
<p>So on the image <a href="https://www.instructables.com/file/FMO1E60IG2JHW1W/?size=LARGE">https://www.instructables.com/file/FMO1E60IG2JHW1W/...</a> ...where is this getting power from if it is not powered up. I understand that you need a 5V power supply but your image does not have one either. Surely the FTDI should be wired to the 5V.</p><p>You answered my question regarding the capacitor in a private message to me. I think it is imperative that you answer questions here on the instructable so others can see the mistakes I have made and learn from them. Your capacitor is is not the same as mine (LD33CV) so I will have to swop around my INPUT and OUTPUTS pins. I hope I have not fried anything. #WARNING to others trying to build this instructable.</p><p>Are you able to send me the fritzing design? I'd like to move things around as I have it wired up on my board and ask you more questions.</p>
<p>Hi, </p><p>You can link the power from the FTDI. But it's not gonna be very stable as the FTDI cannot give enough current. But it will probably work as long as you don't transmit a lot. </p><p>When I tried to answer yesterday, the Reply button was not working to send a big text, that's why I sent you a private message... </p><p>I didn't give any references for the regulator, in this case you have to adapt your parts. Reading a datasheet of the components is very important if you want to understand what you are doing.. Never plug a circuit before checking how to use every component.</p><p>I add the Fritzing to the step 6 if you want to build your own design. </p>
<p>Thanks for your valued input.</p><p>Back to the drawing board. I will let you now when I make progress.</p><p>Have a great weekend</p><p>Cheers</p>
This project could work inside a mail box and instead of that button you can connect a reed switch or a different type of switch to detect when there's something inside the box. :)
<p>The ESP8266 can be used in so many different project. In few weeks playing with it, everything in my apartment is getting connected ;) </p>
Great job. It seems your work is more than just amateurish. It looks professional.
<p>Thanks, But still a lot of work to do! </p><p>My friends told me the same ^^ I actually plan to use it like any professional device so I had to make it stable and good looking ;)</p>
Great job
<p>What a great idea. And having the possibilty of no monthly fee is wonderful too because costs for many people are just too high. This is also good for not only the aged but many people suffer from illness that causes unstable balance. Great work jeanotP1314</p>
<p>My grandmother pay 50$ a month for the call center... so expensive! </p><p>I really have to build the programme by wifi part. So you can easily adapt the message and the internet box configuration. One of my friend want to adapt it to quickly tell his girlfriend he will stay late at work... Any kind of message is possible :) </p>
<p>And you received my vote as well :-)</p>
awesome job and write up. voted.

About This Instructable




Bio: Born in the Alps, I love travelling, paragliding, trekking and, of course, designing projects. :) I learned a lot from open source project on the last ... More »
More by jeanotP1314:Virtual Reality on Raspberry Pi with BeYourHero! Healthy, Smart & Natural Air Cleaner with Arduino, WIFI and Blynk Touch Screen coffee table DIY with 32" TV and low cost CCD sensor 
Add instructable to: