10 December 2020

R2D2 DIY Project with Wifi

Another nice project I did last year was operating our R2D2. It is actually a (useless) clock that also made some sounds like it does in the Star Wars movies, but you had to press a button for that. So I decided to have a look if I could fix it someone to do this in an automated way. So first things first. I took it apart to see what is inside. And that didn't look too complicated. My first idea was to put in a relay over the switch, but then that would make a clicking sound I rather not have.

So the most sensible thing to do was to try and put in a Arduino like mini computer called an ESP-12. It has several IO pins so I started by attaching the button to one of the inputs of that ESP and started measuring voltages on the electronics to see what happens when you press the button. It turned out I could easily attach the wire that came from the switch to an output of the ESP and done. I could control it. The original sound it made was way too long to be funny (like 30 seconds). So I was already happy I could make the sound shorter. 

And you do that of course by writing software. The nice things about these ESP chips is that they also have WiFi Build-In so I started by logging it in to my home network and writing a small web server to run on it. So now I could control it over the network. I do have a Home Automation System in my house. So the next thing was to have that system to control R2D2.

And then we get to the hardest part of course: Putting everything back together. Luckily there was plenty of space to put the small ESP in and the leads of the SMD board I soldered it one just fitted over the original battery compartment. I attached it with some double sided tape to it. After that I had to put the legs in hold everything together and put the screws back in. Well that took me a while. I'm quite good with electronics, but not so much with mechanical stuff. But I got it. I decided with my girlfriend to put it in the hall and have it triggered by a sensor on the front door. So R2D2 now act as a welcoming committee when we open the door for guests.

And to conclude a small video of R2D2.


No comments: