Automatic System - Page 1
Forum section: electronics / projects

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 11:38:24 am
content: Hi All,I am not sure if I am posting in the correct place, so please move if incorrect placement.I am in mist of building an automatic system for my parents to help out with their daily lives and general maintenance, as I cannot always be around,and my dad has heart conditions.I am creating a stand alone system which will take sensors (ie to find time of day, temp, humidity, weather its raining or not that type of thing),in order to be able control things like lawnmower, curtains, high up windows, water systems etc.I have multiple components, both passive and active, multiple sensors, multiple micro-controllers ( such as msp430's, pic's, avr) and multiple arduino's.I have been coding for around 10 years, but I started off with php, then moved to .net, and for the past 2 years been learning C++, C#,I am electronically minded, and have made multiple small projects ( wireless, temperature, lcd and mp3 circuits) as well as a few arduino projects and onc qualified engineer I do have basic tools soldering station, oscilloscope etc.I am aware this will not be a quick or short project, and its also a good way for me to learn more programming skills, and reduce the amount of wires within the system.The problem I am having at the moment is knowing how to control the mcu, the best example I can give is:If I was to make a an ultra-sonic sensor for an arduino ( yes I know this already exists and there are libraries for this),how do I go from components on a board, to code which controls the module.The point of this project, is to help my parents out and learn how to build a moderate system from scratch, building my own modules and boards, as my other projects have all been small but mostly bread boarded.Any help is highly appreciated. any links, books I can get, vids etcThank you all for your time

author: Bendba
author_rank: Regular Contributor
timestamp: March 30, 2017, 12:11:34 pm
content: Hi,Here is my two cents (that's probably all is worth with the little experience I have)By yourself a 8 chanel logic analyser. I bought a cheap usb one on ebay ($12 I think) and it saved me a lot of headache figuring out timing, inversion and phase issues in digital circus.

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 12:23:09 pm
content: Thank you

author: rstofer
author_rank: Super Contributor
timestamp: March 30, 2017, 04:45:41 pm
content: The problem I am having at the moment is knowing how to control the mcu, the best example I can give is:If I was to make a an ultra-sonic sensor for an arduino ( yes I know this already exists and there are libraries for this),how do I go from components on a board, to code which controls the module.I'm not sure I understand the question but here goes... You follow the projects that came before. Find an example that is similar to your goals and copy it. I do a great job with copy & paste.What is more problematic is how to get multple uCs to talk to each other. Sooner or later, there will be a uC controlling the sprinkler system, another uC controlling the blinds (mine are electric) and perhaps another uC controlling yard lights, etc. Maybe there are motion sensors reporting in to another uC and that device wants to send a message to the lighting controller. Things like that!It would be nice if these could all be connected over WiFi (and they can) but it might be possible to hardwire a serial link. This is usually done using RS485 protocol and a multimaster scheme like ROBIN:http://www.bdmicro.com/code/robin/Using such a scheme allows a PC, for example, to communicate with any number of remote modules.I'm less enthusiastic about 802.11 WiFi if the area is larger. Inevitably, there are places where the uC will be in a dead zone.ZigBee might be a viable alternative for communications, there are a lot of home automation projects using ZigBee:http://www.zigbee.org/what-is-zigbee/https://www.sparkfun.com/search/results?term=zigbeeI suppose a uC could be used as a ROBIN to ZigBee bridge such that outdoor uCs could use Zigbee and inside stuff could use RS485. Or the whole thing can use ZigBee. You might want to read the book:https://www.sparkfun.com/products/10324Other than that, copy & paste...

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 05:36:30 pm
content: Hi thank you for your reply,You are in the right direction, as I am needing to control multiple uC's and thank you the links, I have a handful of wifi modules ( namely nRF240l's and ESP's).Allow me to try and give a better understanding of my questionif ((value & 0x03) != 0x03) {PCD_WriteRegister(TxControlReg, value | 0x03);}// Translate the int32_t into 4 bytes; repeated 2x in value blockbuffer = buffer[ 8] = (value & 0xFF);buffer = buffer[ 9] = (value & 0xFF00) >> 8;buffer = buffer = (value & 0xFF0000) >> 16;buffer = buffer = (value & 0xFF000000) >> 24;I dont get where the 0x03 and 0xFF00 etc is coming from.upto now, I have always used libraries of some type, but I want to do this entire thing from scratch, and more advanced than my others,also I am looking to be able to scale up further down the road, this is part of the reason why i want to build it module wise, also I find this helps with debugging, as well as repair, and modify later on down the road.I do apologise for badly phasing this question.

author: max_torque
author_rank: Super Contributor
timestamp: March 30, 2017, 06:50:44 pm
content: Quote from: warner on March 30, 2017, 11:38:24 amMy Suggestion? Start with the Curtains and not the Lawnmower.........

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 06:56:09 pm
content: Thank you all for your comments, highly helpful, and thank you for the suggestion max_torque

author: picandmix
author_rank: Frequent Contributor
timestamp: March 30, 2017, 07:22:29 pm
content: Nothing wrong with your techincal aspirations, should be an interesting and enjoyable journey for you.Though for simplicity of hardware building, upgrade or repair in the future , standardising on one type of micro board / programming language would seem an advantage.However, would suggest you run a non techincal view of your ideas past your parents first to see how they feel about each particular function/project and how they can control it.Your views of helpful automation and those of older folk may not always agree, particulalry if its just presented as a fait accompli.

author: rstofer
author_rank: Super Contributor
timestamp: March 30, 2017, 07:36:08 pm
content: Quote from: warner on March 30, 2017, 05:36:30 pmSo, the code checks that the low 2 bits of value are 0x03. If not, it sets the low 2 bits to 0x03 and writes the register. If they are already 0x03 then the register does not get written. Fine, that's what happens... But knowing this is quite close to useless! I understand perfectly what the code DOES but I have no idea WHY.Why are the two low bits set to 0x03? Why is the register being written and, more important, why do the low 2 bits need to be 0x03? What it the end game of setting these 2 bits to 0x03? These questions are answered in a datasheet or user manual. Sometimes there will be an explanation in library code but not often.

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 07:59:41 pm
content: Thank you all for your comments and thoughts,picandmix -- Thanks, and yes I have done that, neither of my parents are technical people, I have explained to my parents what the job of the circuits do ( the things they cant) they get the gist and understand what is supposed to happen, but fail to understand it, and also are aware it will be done automatically for them, when conditions are correct ( with fail safes) so no one can get hurt and so forth.Also I do agree with your comment regarding using the same uc's ( ie avr for example), the only reason at this moment why I have though about using different uc's over all, is to learn how to program different uc's, but I am also aware that will most likely mean learning multiple languages, such as assembly, which i dont know.evb149 -- I love the versatile thinking, but at the same time dont want to over think it too muchrstofer -- There is no end game to the code I have shown that is meant as an example ( I should of specified that, sorry dude, as this is the part i cant get where the 0x03 parts come from, as I dont see them defined with any code ( Oh the code I shown early is from a RFID library written in c++.I adore written OOP regardless of language, and I am very passionate about creating things, but not just anything, for me it needs to be functional, preferably helpful and useful to other people, others there is no achievement or satification or point.

author: warner
author_rank: Contributor
timestamp: March 30, 2017, 08:09:25 pm
content: The automatic system:The base design is toif its not rained, and the temperature is above say 50 C, the lawnmower will turn on and basically run around the garden, around the garden will have sensors and the lawn mower will have sensors and a small ish motor.High windows will open if its above a certain temperature, curtains will open in the morning and close at night.Lights will switch off if not in use ( if no one is in the room)CCTV will start recording if outside movement at night time.things like that, in order to both prevent any possible injuries as well as accidentally which could be more serious.as well as a alarmed pull cord, which sends a signal to me.

author: SL4P
author_rank: Super Contributor
timestamp: March 30, 2017, 11:55:42 pm
content: As well as the obvious sensors and actuators/motors...Consider some forms of feedback and fail-safe monitoring... (safety fence / sensors etc)e.g. N/C switch circuits can be used to determine if the wiring has been broken (i.e. open circuit)Similarly, when you tell something to happen, don'tassumeit's happening - implement some means of checking limit switches or valid activity.(Esp dangerous things like the lawnmower, or mains controlled devices.)

author: Brumby
author_rank: Unknown
timestamp: March 31, 2017, 11:42:21 am
content: The UI is going to be an important part of this. Think about that a lot before committing to hardware.I am really nervous about the lawnmower - specifically safety. Not just keeping it within its boundaries and avoiding obstacles - but also the unexpected things. Things that someone pushing a lawnmower would stop for. Fallen branches or a rock on the grass or even an injured animal ... the list can go on. Safeguarding against all contingencies is not going to be simple.

author: warner
author_rank: Contributor
timestamp: March 31, 2017, 06:08:03 pm
content: hey all, Apologises for the late reply, I have been doing some component farming,evb149 -- Yes I know exactly what you are saying there, there are 1001 bits of problematic obstacles to over come , and as you pointed out not just animals but nature as well. which will need alot of fail safe's, n/c switches etc, the list goes out, this is part of the reason its not going to be a short problems. However, I trust my skills both engineering wise as well as programming wise, more than I trust me parents to cut the grass without any harm, and of course, I will be doing it myself when I am around.However, this will be tested for a minimum of 6 months to a year before it gets close to being classified as safeBrumby -- Yes you are correct the UI, will be an important part, but my first concern is safety, as I can program this from anywhere around the world, I am not looking for my parents to operate this at all, I will be doing any and all repairs, mods, upgrades, re-coding etc.SL4P -- Completely agree with you, I will be writing up a list of functions, safe guards, checks, fuses, rcd's N/C switches, to try and prevent as many situations as possible, and I am also prepared to share everything about this project on here, in the hopes that I can cover everything, and try and ensure I can cover even the 1% things.Although I have some module based bits done, such as temp and humidity sensors,creating a mesh network around the house, timing events, night and day, water pressure etc.I am treating this like an assignment where I create reports, make lists etc in order to ensure nothing is left to chance, although I am aware that I can not account for everything.As for the lawnmower, this not be petrol, it will be motor run ( just enough to cut the grass for now, wheels and movement will be done with the same thinking as a r/c, and movement of wheels and rotor will be done from different motors.Once thinks are in line, I will put up some pictures, so you guys can see what I am thinking.I dont even think I will be using metal blades, maybe a trimmer type lawnmower

author: SL4P
author_rank: Super Contributor
timestamp: March 31, 2017, 09:57:00 pm
content: Good to see you're taking the challenges seriously!What you're doing is virtually identical to creating an autonomous 'car' for use in randomly changing environments. Search around Tesla and Google et al, they may have some published research that is not under lock and key.You still gave a lot of work to do!

author: warner
author_rank: Contributor
timestamp: March 31, 2017, 10:37:31 pm
content: Thank you SL4P,defo taking it seriously, I dont like taking chances with other peoples lives, as any good engineer should,and yes agree there, and I like the idea of the tesla research, and on that note, nikola tesla is a bit of a role model of mine.I dont expect this to be a quick project, I am expecting this to take a good year maybe even 2/3.Also there is no just the fact of natural, human and animal conditions, there is also the fact of mental conditions ( my dad has multiple conditions)which makes certain task hard or impossible for him to do, sometimes its like looking after a child.This is one of the key reasons I want to make this, so I have to make it as if these applications have to run around a child, as I have 2 children, this makes it slightly easier to understand what precautions I need to take, and another reason why I cant always be about.Also please dont get me wrong, I am still learning, I am not perfect, and I have virtually no friends who share my passion or understand me when I talk about electronics or coding, as it goes right over there heads, but the one thing I can tell you nothing makes me happier than designing, building and creating systems from scratch ( except my children of course), when i get engrossed in a project days, weeks and months can seem like 5 mins, #it is unusual for me to talk about projects, or even post questions / work with a team etc ( I am sure you get the idea), as most dont get me etc, I am used to googling, reading books, pdfs, doing experiments to find what I need and youtube lol.However, I know with a few aspects of this project, lives are on the line, due to the amount of things which could go wrong, and I am not one for taking chances with lives, tbh I am highly interested in medical things, and saving lives, not taking, but due to lack of Qualifications/ degrees, experience etc, I know the chances of me working within the medical electronics field is like 1%.But I do want to thank everyone for there input so far, I class it all as highly useful and very appreciated.Sorry for the long paragraph