Showing posts with label Electricity. Show all posts
Showing posts with label Electricity. Show all posts

Friday, February 14, 2020

My Smart Sprinkler System Part 2.


Introduction
You might be aware that I have been frustrated about forgetting to switch off appliances before leaving home. I guess its a sign of old age, my forgetfulness is becoming fairly pronounced. but instead of grumbling, as a technological determinist, I decided to create a smart home.

I have been tinkering with microcontrollers for some years, but creating a smart home got me jumping into the deep end of Internet of Things IOT. I have short listed several projects that I will need to create to have a smart home, and you can find them from looking through my blog for IOT and my smart home. here -

As you can see I have a whole lot of projects to keep me busy for a long long time. but not to worry, they are all simple modular systems that latch unto each other to create a smart system. I usually, will share them here with you. you can follow the steps and recreate them for yourself if you have the basic skills of soldiering and following simple instructions. I will also share Gerber files, circuit diagrams and a whole lot of information to help you build these circuit systems on your own.

To Sprinkle Or not to Sprinkle
for today, I will focus on the plants in my compound. I want to be able to automatically water the lawn, plants around the compound at preset times every single day of the year without much manual intervention. Yes one can easily buy a working water sprinkler off the shelve in any hardware store. but there is no fun in that. Plus, we can build a smarter system that takes cognizance of the weather to decided if it should give the plants their usual dose of water, or not water at all if it has rained in the last 24 hours. We could also throw on a Big Bank effect that brings in the watering sequence to a crescendo as part of the Christmas Lighting experience.

Examples of making of the Project Circuit Boards PCB abound on the internet. 1. Transfer a circuit trace from a Laser Printer to a paper and unto a PCB board. and 2. Rule traces manually by hand. 3. etch in an acid bath and 4. Solder on the components. etc.

Feel free to look them up and choose which one to use. For the 1st step - there are basically only two methods open to you, One, to carefully draw it with your hand using a permanent maker like a fine point sharpie, or two, to use a purpose built application to design the circuit and print it out using a Laser printer (not a bubble jet ink based printer). I have written an article on how to make a a PCB using the manual process. If you don't want to use that method, I will explain here how to follow another more precise method.

Laser Heat Transfer Method
If you desire a more professional end product, you can create professional PCB files using purpose built applications - there are a lot of applications that take away the stress of sweaty and shaky hands to deliver crisp looking products. See a list of the top 9 free PCB softwares. I have tried my hands on a couple of these, they all have their pros and cons, but I especially like Fritzing software. Its intuitive features allow you  make professional looking double sided PCB. Below is the image of the PCB I designed for the water Sprinkler. Along with its Gerber files if you wish to print it out and transfer it to the board.

Here are the Gerber files from my Fritzing design, for the sprinkler system.

After the traces have been printed on paper, they are ironed with high heat to melt the Laser Toner onto the board. As you may have noticed, this design was done on two sides - two sided boards are very difficult to make, the main problem is ensuring that the vias (the points where current passes from one side to the other side of the board. If the vias are not precisely placed, the PCB will not work.

Note: To esure that the vias line up, I utilize a light box to ensure that both sides of the mirrored print out match. I tape it on three sides before sliding in the measured fresh PCB. This way, when the PCB is etched and the holes are drilled, each trace matches. If the VIAS don't match point to point, all the vias will fail and your two sided board will fail.

After both sides are held in place, I iron both sides with a pressing iron until I can clearly see all the traces melted onto the board - most websites tell you to do this for about 5 mins, but I iron mine for longer periods than that. At the end you can clearly see that the traces have melted unto the PCB.

After allowing the PCB to cool down, I leave it in a bowl of water to soften the paper. softly rob off paper to reveal a perfect work of art...

Gloves On!!!
Handling or even inhaling chemicals is very dangerous. Please be careful with the following steps.

Choosing the etchant is very important. Boric chloride, off the shelve etchants, etc. are easily obtained in the west, but in the south, its not easy to come by. but not to worry, finding a chemical that corrodes copper is not very difficult. I use Hydrochloric Acid (easily obtained from any swimming pool shed) and Hydrogen Peroxide (From any pharmacy). One part peroxide, and two parts Hydrochloric Acid.



Please note that you should not dispose of the etchant in the drain - it could potentially corrode the pipes and sink. do not also throw it out indiscriminately as it could kill plants and pollute the earth. I use mine to clean concrete of moss. and water it down afterwards.


By now the PCB is looking very good. but we need to mark the points to drill each hole. I use a carbide score to nick the points for my pilot holes. these points are important to ensure the drill doesn't "runaway" and end up in the wrong place. scoring the PCB, only to make a dent, not to make a hole. Remember each via on the topside must match its corresponding via on the bottom. After the scoring, its time to drill the holes.


Thursday, March 1, 2018

Internet Of Things IOT

Hello Thinkers, Its been quite a while since I hooked up, but believe me, I have been very busy doing so many many things. I can only sum them up as my deep dive into the rave of the moment - Internet of Things (IoT). We have all had our share of that sad moment after driving hours into town only to realize that you didn't switch off the air conditioner at home. Or perhaps, there was no power when you left, but you know you left several appliances running before the power cut - meaning that you will be running (wasting) energy with no one around to enjoy them. In the 3rd world where these are scares resources, no body wants anything to go to waste. It could be anything;-

you forgot to close the garage door. you forgot to switch the generator to manual to prevent it from kicking in when there is a power cut. You forgot to switch off the TV, Fan, AC, etc. depending on where you are, your problem might be different.

The Problem
My problem was how to create a smart home, that allows me the freedom of switching these things off even after I have left home. Yes! without coming home, or calling in the neighbors. Literally from anywhere I am in the world. My plan is to create a smart home, capable of doing the following;-
  1. Open & Close the gate (electric gate already exist)
  2. Arm Electric fence
  3. Let the Dogs out of their kennel 
  4. Monitor the weather to ascertain steps to take for air-conditioning, watering plants, letting out dogs, switching on lights, notifying the pool maintenance guy,
  5. Switch off / on several equipment's
    1. Generator
    2. Air Conditioners
    3. Fence / Outside Lights
    4. Borehole pump
    5. Swimming pool pump
    6. Swimming pool lights
  6. Monitor the battery level of the inverter
  7. Monitor the temperature of the deep freezer
  8. Water the lawn and the plants at home
  9. Monitor the security alarm
  10. Track motion after hours
  11. etc.
As expected, I had to do some research, and I found several projects I could latch unto - one of the is My Sensors Project. MySensors is an open source hardware and software community focusing on do-it-yourself home automation and Internet of Things IOT. They provide easy to follow build instructions, ready to use code examples and adaptable open source hardware designs. All of this runs on the MySensors software library for secure communication that has been battle-tested with more than 20 of the leading home automation controllers on the market.


MyController?
Controllers as the name suggests are the brain behind an IOT architecture. The controller is the unit like a CPU is to a computer, that does the processing of data fed in by sensors like temperature sensor on a node circuit tucked away somewhere in the compound. The controller uses this data to make rule based decisions (as created by me) to set switches on or off as desired. For example, I could use the rain gage data that shows that it rained today to tell the water sprinkler not to come on as scheduled every 4:00pm. In addition, the controller can tell, the node that controls the fence light to come on as soon as it gets dark, this could be set at a specific time, or just based on day light, the latter being the preferred as it will switch on the lights both in summer or winter when day light is delays or even during a storm when it could get dark even at noon.

My choice of controller was stressful. I was looking for a neat easy to use (and understand) controller with an active community to help when I get stock. I settled on MyController another open source project by JKandasa. The system is based on pure java (back end) and angularJS (front end) it can run it in any platform supporting Java SE 1.8. I liked its look and feel. and as expected JKandasa himself was readily on hand to support newbies like me. but after a difficult start and several huddles I faced with frustration, I went back to the square one to look for an alternative... my research lead me to Domoticz.

Domoticz is a free/open-source Home Automation System that lets you monitor and configure various devices such as lights, switches, temperature, rain, wind, UV and meters (electric, gas, water). It appeared quite powerful and intuitive as it promised. In less than an hour after I downloaded and installed it, it had latched on to the flimsy MySensors Gateway that I had arranged on my breadboard. with that, my journey has begun.

IOT here we come1