Eight on-board relays, 8 12-bit ADC channels,12-bit DAC output, 8 opto-isolated inputs, 4 open collector outputs, 6 GPIO’s, stackable.
Home Automation 101
This project started with the challenge to integrate as many Home Automation functions as possible into a Raspberry Pi platform. The requirements were rather simple technically, but challenging due to the sheer number of I/O’s required:
- Eight relays for zone heating.
- Eight relays for zone cooling.
- Eight relays for irrigation.
- Eight analog inputs for measuring zone temperatures
- Eight analog inputs for measuring soil humidity
- Eight digital inputs for presence detectors
- Sixteen digital inputs for security sensors
An off the shelf solution was possible, but required too many components:
![Off-the-shelf possible solution](https://ksr-ugc.imgix.net/assets/017/656/058/65c27a9799311da763f291b478af8f9c_original.gif?w=680&fit=max&v=1501029688&auto=format&gif-q=50&q=92&s=e1f5209da60a41ecdb16dc82c5ccfa9a)
The cost was not the main concern, but the implementation. The first prototype used to develop the software resembled a small jungle.
![](https://ksr-ugc.imgix.net/assets/017/776/452/034a39891bd267d4deec09c9bead55d0_original.jpg?w=680&fit=max&v=1501773234&auto=format&q=92&s=43e294e2fef69ffa0c60aa673e2595fc)
Raspberry Pi in the lower left corner, two USB IO cards from eBay, two 16 relay boards from eBay also. Needed to add ADC channels, but ran out of space. So the team has built the Mega-IO card.
![Stack of three Mega-IO cards](https://ksr-ugc.imgix.net/assets/018/049/462/8f1aef087fb6a618a2f77b73d987ee33_original.jpg?w=680&fit=max&v=1503586688&auto=format&q=92&s=7d444d12e1aa2faf07f7470474e05ae3)
The small tower gives all the relays needed, and more than enough analog and digital channels. It also leaves the Raspberry Pi connector available for another card, if we ever need one.
Technically, the Mega-IO card is not a HAT, because it’s form factor is too big – it occupies all the real estate on top of the Pi. In all other aspects is HAT-compliant, so they call it an X-HAT (eXpanded HAT).
![](https://ksr-ugc.imgix.net/assets/017/725/503/ba38851aea61c1e8c66a5ec066752785_original.gif?w=680&fit=max&v=1501513516&auto=format&gif-q=50&q=92&s=22134ec02c3b3f0c8642e96e694247c9)
They have developed a command line utility which accesses all the IO functions, available for download HERE.
The easiest way to develop browser software for the Mega-IO card is using the Node Red, a drag and drop visual tool which runs on the Raspberry Pi and can be used for wiring the internet of Things. Click HERE to download a Raspbian operating system image which includes Node-Red and the following examples for accessing Mega-IO functions.
(Alternately, you can download and install Node-Red yourself following the instructions at https://nodered.org/docs/hardware/raspberrypi )
1. Setting the D/A output
2. Testing the A/D input
In order to show the Analog to Digital input function, and implemented a heating and cooling thermostat.
![Node-red workflow for heating and cooling thermostat](https://ksr-ugc.imgix.net/assets/018/049/509/6d757ab5d4b2ffae1acbb469c1814192_original.gif?w=680&fit=max&v=1503586917&auto=format&gif-q=50&q=92&s=26fe92af8fc1f52edaffecb849e342ed)
The User Interface consists of a text input for setting the target temperature, an analog gauge for displaying the current temperature, a fan switch and an on off system switch.
![Thermostat User Interface](https://ksr-ugc.imgix.net/assets/018/049/519/9719853b10b0fc33fb3cd37ca898ff28_original.gif?w=680&fit=max&v=1503586963&auto=format&gif-q=50&q=92&s=5f219861d602ac9e6647c54b4366edb7)
A status box shows if the system is cooling, heating or on standby.
A thermistor connected to an analog input of the Mega-IO card is used to measure the ambient temperature. Relays are activated for controlling the fan and the heating and cooling functions.
Multiple thermostat can be implemented using a single Mega-IO card.
3. Reading optically isolated inputs
The workflow consists of an inject node which sends a periodical signal to a function node which in turn sends a command to the Mega-IO card.
![Opto-inputs Workflow](https://ksr-ugc.imgix.net/assets/018/022/053/ea822c0ac6b949f47ad55f5af4526a1e_original.gif?w=680&fit=max&v=1503421647&auto=format&gif-q=50&q=92&s=2ada84e3fa49ecfd7c17edb38ab4bbc6)
The card response is parsed and displayed by text nodes.
![Opto-inputs Dashboard](https://ksr-ugc.imgix.net/assets/018/022/108/588944ec31fee6330dd598e4e3f7a9f7_original.gif?w=680&fit=max&v=1503421882&auto=format&gif-q=50&q=92&s=e74eca68d8c2b76f555d52624beb32d4)
4. Testing the Relays
The Relay Test workflow consist of Button Nodes for turning on and off a relay, and Numeric Nodes for selecting the card stack and the relay number.
Function Nodes are used for storing variables received from the Numeric Nodes and for passing the command line parameters to the Execution node, which in turn is passing the command line to Raspberry Pi.
A debug node is checking for error messages.
![Relay Test Workflow](https://ksr-ugc.imgix.net/assets/018/054/170/4f410b438ad7e0585fb663f7313a505b_original.jpg?w=680&fit=max&v=1503611372&auto=format&q=92&s=282f4f743c91996d3f9b9364ba86dc9f)
The User Interface has buttons for turning the relays on and off, and select boxes for the stack and relay number.
![Relay Test Dashboard](https://ksr-ugc.imgix.net/assets/018/054/194/ebce5b64d38f75f6818c01cdc2469e02_original.jpg?w=680&fit=max&v=1503611472&auto=format&q=92&s=91f270dbf0bac31074ebc67d283007bf)
Source code download
D/A Output; A/D Input; Opto-Isolated Inputs; Relays;
![Mega-IO Website](https://ksr-ugc.imgix.net/assets/018/022/205/01e1e72fd275957e34f2d4dc398cd062_original.jpg?w=680&fit=max&v=1503422288&auto=format&q=92&s=1c928a7f2f7ed2021f2466a8eef6b09e)
IO SPECIFICATIONS
- Operating voltage: 3.3V
- CPU frequency: 16 MHz
- Touch sensing capability
- Max. input voltage on any pin: 4V
- Series protection resistor on IO pins: 51 Ohms
- Output Low Level Voltage on I/O pins: Max. 0.45V
- Output High Level Voltage on I/O pins: Min. 2.6V
FOUR OPEN COLLECTOR OUTPUTS:
- Driver: ULN2003F12FN-7
- Output Low Voltage: 0.6V
- Max Pull Up Voltage: 20V
- Max sink per channel: 100mA @ 3.3V Logic Input
- 140mA @ 5.0V Logic Input
- ESD: 4kV HBM, 1kV CDM
EIGHT 12 bit ADC
- Sample rate: Up to 1 Msps
- Input low pass filter: 0.22µF/51 Ohms
OPTOISOLATORS: TLP293-4
- LED current limit resistor: 1 Kohm
- Input Forward Current: Typ. 5 mA, Max 50 mA
- Input Reverse Voltage: 5V
- Input Forward Voltage: 1.25V @ 10 mA
- Isolation Resistance: Min 10 exp(12) Ohms
- Isolation Voltage: Typ 10,000 V
RELAYS: SRD-05VDC-SL-C
- Relay max current/voltage: 10A/25V
- PCB max current/voltage: 2.5A/24V
You actually make it appear so easy with your presentation but I in finding this topic to be really one thing that I think I might never understand. It seems too complicated and very huge for me. I am looking ahead to your next post, I will attempt to get the hold of it!
LikeLike
I am just starting to learn about all of this. Thanks alot man!
LikeLike
Wonderful site. Lots of useful information here. I¦m sending it to a few pals ans additionally sharing in delicious. And naturally, thanks on your effort!
LikeLike
I have not checked in here for a while because I thought it was getting boring, but the last several posts are good quality so I guess I?¦ll add you back to my daily bloglist. You deserve it my friend 🙂
LikeLike
I’ll right away snatch your rss feed as I can not in finding your e-mail subscription hyperlink or e-newsletter service. Do you’ve any? Kindly let me know in order that I could subscribe. Thanks.
LikeLike
Well I sincerely enjoyed reading it. This article provided by you is very practical for correct planning.
LikeLike
I am just starting to learn about all of this. Thanks!
LikeLike
Very interesting points you have remarked, appreciate it for putting up.
LikeLike
Very interesting points you have remarked, appreciate it for putting up.
LikeLike
Some truly prime content on this website , saved to my bookmarks .
LikeLike
Very good article post.Really thank you! Will read on…
LikeLike
Very good article post.Really thank you! Will read on…
LikeLike
Hallo ,What are some step to make good web page links? thank u
LikeLike
Enjoyed reading through this, very good stuff, thankyou .
LikeLike
Say, you got a nice article post.Really looking forward to read more. Will read on
LikeLike
It as hard to come by well-informed people on this subject, however, you sound like you know what you are talking about! Thanks
LikeLike
I could not resist commenting. Exceptionally well written!|
LikeLike
I’m not that much of a internet reader to be honest but your blogs really nice,
keep it up! I’ll go ahead and bookmark your website to
come back later. All the best
LikeLike
I think this is among the most significant info for me.
And i’m glad reading your article. But want to remark on some general things, The website style is
wonderful, the articles is really excellent : D. Good job, cheers
LikeLike
An individual necessarily lend a hand to help make significantly posts I might state. This really is the first time I frequented your web page and to this particular point? I amazed using the analysis you made to make this actual submit extraordinary. Magnificent task!
LikeLike
I don’t have any idea the way i finished up here, having said that i thought this post was good. I don’t know who you really are but definitely you are attending a famous blogger if you aren’t already 😉 Cheers!
LikeLike
I simply want to say I’m newbie to blogging and absolutely loved your web page. Most likely I’m planning to bookmark your site . You amazingly have awesome article content. Thanks for sharing with us your webpage.
LikeLike
Hi there to all, how is everything, I think every one is getting more from this web page, and your views are fastidious in support of new people.
LikeLike
Excellent goods by you, man. I’ve understand your stuff previous to and you are just extremely wonderful. I actually like what you’ve acquired here, really like what you’re stating and how for which you say it. You will be making it enjoyable and you still take care of to help keep it sensible. I simply cannot wait to learn a lot more on your part. This is certainly really a great site.
LikeLike
I’m curious to determine what blog system you have been using? I’m experiencing some minor security issues with my latest website and I’d like to find something more safe. Are you experiencing any recommendations?
LikeLike
whoah this blog is magnificent i like studying your articles. Stay up the good work! You understand, a lot of people are looking around for this info, you could help them greatly.
LikeLike