Saturday, October 6, 2012

YAWS Assembly

Most of the rest of my hardware arrived yesterday, so Ive begun to assemble things. During my Live Tests outdoors with the Weather Board, I came across a few things which I feel I should note.

Ive revised the Sparkfun code to show the Wind Direction in Degrees (as in the code) and in Headings (N, S, E, W). This is a simple set of if-statements to display headings when the correct range is found.

Ive also updated the code to remotely reboot the board on command, as Ive found that it has issues with starting a connection once its out in the field. The software has to be running first before the Weather board, thus a reboot is required. This is simply including setup(); in the reboot function.

One of the things I wanted my Weather Station to do was display data via an LCD locally, so I can debug and view data in Real Time to make sure the station is functioning (and so I don't have to keep running back and forth to my computer). So I included a case in the code to display to the LCD screen and the serial port at the same time. I wont know for sure if this will work, but the code does compile. The way Im connecting the LCD screen to the Weather Board is via I2C using this tutorial. This requires a nifty little IC, the PCF8574P, an I2C 8-bit port extender and a 3.3V LCD screen. I'll post pics of it once its assembled and working.

I guess now is as good a time as any to warn about the importance of a grounding kit on the weather station. You don't want lightning frying your expensive electronics, or burning down the shed (or your house), so you'll want to take good grounding measures. Do plenty of research to make sure you know what you are doing. I am not liable if you ignore this warning and lightning does hit your stuff (God forbid it of course).

So that said, I used a 4-ft long piece of grounding rod (it comes in lengths of 8ft for about 10 bucks at Home Depot). Hammer it until about 1.5 ft of it is sticking out (the softer the ground, the shorter the rod should be; if the ground is hard, dry dirt, you might have to go to a 6ft rod or use the full 8 ft - this will change the amount of rod sticking out of the ground). You dont want to hammer it all the way in because the rocks in the ground will wear away the copper coating of the rod and that will accelerate decay of the steel rod. I also bought some #4 multi-stranded electrical cable, grounding clamps and a pencil-thin steel rod. All this stuff comes together as the grounding kit. A necessary expense to keep things safe.

It looks like the weather station meters will just be attached to the steel pole of the mounting kit using stainless steel pipe clamps (the image below simply shows the mounting kit, now how Im going to mount it).


Im still trying to work out all the minor things, like some extension cables for the sensors and the solar panel to reach where Im mounting the Weather Board.

FYI, There will be a post soon about setting up the Beaglebone, as Ive gotten half of the stuff I need to start that side of my project. Configuring it is a pain, but it has to be done.

Wednesday, September 26, 2012

Yet Another Weather Station

During my escapades as a Research Assistant, while I was working towards my Master's degree, I had the privilege of purchasing and setting up a weather station at UNT. The Campbell Scientific Weather Station did everything I wanted it to do, and it was well constructed, but it was also well out of my own personal budget. Thus my goal of this weather station was to keep the components within my budget while achieving good, solid construction and reliable software.

In addition to this, I found that if am to build a custom smart home system, I need to construct a weather station from scratch so that it will be compatible with the rest of my system.

One of my aims for this project is that it should be self powered and self sustaining as much as possible. The weather board listed here has a JST connector for power via a Li-Ion battery, and can also be powered via USB. I decided to go with a Li-Ion for the main power. To keep the battery charged, I will be going solar. The build is comprised of Sparkfun, Adafruit and Amazon components.

Since this weather station can be easily reproduced and since it is comprised of open source hardware, I'll fill you in on the tid-bits.

From Sparkfun Electronics:

From Adafruit Industries:
Since the weather station from Sparkfun doesnt come with a temperature/humidity external sensor, I may have to construct my own, using two sensors:
While the weather board makes the I2C headers from the micro-controller accessible via the expansion header, the Sensiron I2C sensor is out of my current budget, and therefore I will construct my own device out of sensors I already have. 

Finally there were a few things left to get from Amazon, since obviously thats the cheaper route to take for someone with a tight budget. I needed a mounting kit for the weather station so that I could place it somewhere high up, like on a roof, and an extension pigtail cable for the RPSMA connector:
With these items bought, I just have to assemble everything together, upload my own customized code to the weather station board, and set it up for operation outside. I have decided to use a 16x2 LCD screen for local debugging to make sure the sensors are working, and I have a Processing program running to log data on the computer.


Friday, August 31, 2012

Smart Home Prototype

Since last time that I posted, I went ahead and made a plan for the Smart Home System that I wanted to build. I found that I just didnt have the budget to make the full scale prototype, so I decided on making a 1/3 scale prototype to demonstrate functionality and features, and then try to get some grants or Kickstarter money to fund the rest of the prototype.

So I ordered a ton of parts from Sparkfun, Pololu, SeeedStudio and Pro-Advantage, as well as bought a bunch of stuff from my local electronics store. Everything came in today (minus the stuff from Adafruit which is on Backorder). I've already gotten started on the RFID Door Lock Module, which is simple enough, but surprisingly, with all the tutorials and examples out there, I still struggled a little bit in writing the code. I'll post the tag checker function on here once I get it working. Simply put, the main structure of my code follows this: ID-12 RFID Tag Reader Sample Code.

I plan to have an Arduino Fio (with its battery pack), the RFID reader and an electronic door strike to complete this module. The benefit here is that there is also an XBee attached to the Fio. So when the door opens, the Smart System is notified, and things start happening. I'll post code when I can: I plan to turn this into a sellable product, so I dont want to give away too much source code. 

Thats all for now. Peace Out.

Wednesday, July 25, 2012

Rensas RL78/G13 Promotion Board

Well, I got my Rensas promotion board today, so Im excited to see what features it can provide me, and if it can fit into my project. Great thing is, I made the sample request yesterday, and they sent it with 1-day shipping. You better get one while this lasts, even if you dont have a need for it, its free!

The features according to the RENSAS Website
  • World’s leading low power performance for equivalent MCUs in its class 
  • Scalability of line-up, including smart pin layout 
  • System cost saving features 
  • Wide voltage operation 
  • Wide temperature operation 
  • Built-in safety features
The RL78 MCUs‘ innovative “Snooze“ mode achieves ultra-low power by allowing ADC operation and serial communication, all while the CPU is turned off. This makes the RL78 MCUs best in class for low power applications.

Monday, July 23, 2012

Darlington Transistor Arrays

After a bumpy period in my personal life, I am back on this project. Its going to be a bit slow over the next few weeks due to Ramadan, but I feel like I am excited to get the project back on track.

The relay board did get assembled, but after finding a fault in the circuit design, Im having to fix it and make another revision. I have to say though, Im glad I came across this post on Adafruit about the ULN2003 Darlington Array, because that part (in its DIP or SMD packages) should allow me to shrink the dimensions of the relay board. 

Also, if you're interested, RENSAS is offering a free promotion board for their new RL78 chip, to those who are willing to provide some information on the project it will be used in. They describe, “The YRPBRL78G13 is a promotion board for the new Renesas RL78 microcontroller family. It supports on-board debugging, flash programming, and is pre-programmed to work with the GUI provided on the included DVD to demonstrate the low-power capabilities of the Renesas RL78 MCU.”<via DangerousPrototypes >

Thursday, June 7, 2012

G8P Relay Controller Part 2

Well I sent my boards off to the Fab shop, so hopefully they'll be in sometime next week.

In the meantime, Ive started coding for the board to control the relays remotely. I've also begun work on the Relay control library to make coding a lot easier. The goal is to get a VB GUI program to interface with the relay controller to flip relays on and off. If that works, then the I'll try to make a Web server PHP script to control the relays remotely. As much as it is nice to have control over lighting at each station, the end goal is to interlink all these relay boards so that the Smart Home system maintains each system rather than the user. I've already begun making plans to make the next revision of these boards XBee Wireless.

For the moment, I see a great need for single and dual relay controllers, but not so much for triple, quadruple or more relays per board. However, if the need arises, I can design larger sized relay controllers. Most people have one lamp here and another there; some just want control of their ceiling fans and lights. While the initial revision is dual relays, I see a future for making single relay boards. 

I've decided to say a little bit (benefits) about why I've selected the Omron G8P Automotive relays:

First, theyre capable of handling high currents at high voltages. An SPST relay can handle 30A at 220VAC, while an SPDT can handle 20A at 220VAC. That goes a long way for controlling devices in a home.

Second, there are quick connect pins on the top of the relays, which allow an electrician to use quick connect crimp connectors to wire each relay into a lighting circuit. This is beneficial, since they most electricians are already aware of this connector, and probably stock up on them. 

Third, the PCB board doesnt have to account for high currents running through it, so price of fabrication is lower, and thus price to sell a controller is lower. This is more a technical aspect, but its important for the user in that theres less of a chance of a fire in case of failure of the PCB. Fourth, these relays are already being used on production lines in manufacturing facilities and in automotive applications. They've proven their worth and their reliability. I can say from experience using these relays before in a couple of projects, that they never let me down. 

So benefits all the way around. Finally, there's only one company I'm aware of that sells relay controllers with G8P relays. As their pricing stands today, the boards are way over priced, and totally unaffordable by electronic hobbyists. The plan is to make my boards affordable, and still try to give the same range of features. 

Monday, June 4, 2012

G8P Relay Controller

Well I've been developing a dual relay controller board for use with my Smart Home system (its meant to be controlled via the Beagle Bone or Raspberry Pi). Its somewhat based on the NCD USB Relay board, but I've changed a few things and made it smaller. Trust me, my board looks nothing like theirs.

I wont go into too many details until I've gotten the board fabricated, assembled and tested. For now, I'd like to highlight some specs and code. The benefit of this board is that I've decided to embed a Teensy microcontroller into it, which means that this is a USB-to-Serial Relay board. So the Teensy is powered via USB. The relays however, will be powered via a 12VDC adapter. The relay power supply is separate from the Teensy power supply.

There are two Quick-Connect Contact G8P Relays on board. If I decide SPST, its rated at 30A at 250VAC, and if SPDT, its rated at 20A at 250VAC.

For reference, here is the ASCII byte command chart:

//The first is the command mode byte (not implemented); The second is the command byte. 

          (254),0-1 Turn ON Individual Relays
          (254),2-3 Turn OFF Individual Relays
          (254),4-5 Get the Status of an Individual Relay
          (254),6 turn all on.
          (254),7 turn all off.