Welcome to my
Wall Lighting Motion Controller Project

Page Started: 11-11-2003
Last Modified: 6-23-2005


PDRM0210.JPG (82114 bytes)

The Wall

I took on a major retaining wall construction project for my home.  Before I get started on the micro controller end of things, I should give a basic over view of this entire project.

The block wall was conceived because of a steep slope around the entire parking area of my driveway.  The north side would have been at least a 5' drop, so we decided to cut that in half, and create a tiered section which now has become a flower garden.  This area measures 4' x 35'.  (This will keep my wife busy come spring.)  The east side is a sloping wall that starts at about 5' high and quickly slopes to about 3' then slopes to about 1' which I carry on out my driveway a ways.  The pictures below give a good idea of the magnitude of this project.

We had looked at a few different manufactures that supplied the interlocking blocks, and finally select E.P. Henry as our supplier.  Their blocks were available in what I thought was better coloring, and they supplied both a 3" and a 6" block that could be inter mixed giving the wall a more natural look.  They also were the only manufacture that I found at the time that had the lights that mounted flush and were slightly textured like the stones used.

A challenge, was the round steps I put in that step up into the back of my yard.  I did screw up here though.  I made them to steep.  I originally had to make them steeper than normal because of the slope of the land, but then I changed the slope and added a small section of wall which enabled me to back fill the wall and level it off, hence the steps no longer had to be quit so steep.  I whish I would have thought about this sooner, but no way was I going to rip those steps up.  Most of the materials used for the risers was left over from the retaining wall.  The steps themselves are cap stones cut precisely to fit.  I even impressed my self here.  These steps alone took about a month of designing, planning and building.

In this wall, I placed 14 low voltage lights.  The off white looking blocks, are in fact lights, and not decorative blocks.  The lights are not blinding, in fact they are really dim.  They make great night lights.

pdrm0018.jpg (187175 bytes) pdrm0023.jpg (150364 bytes) pdrm0341.jpg (152273 bytes) pdrm0368.jpg (113112 bytes) pdrm0088.jpg (174750 bytes)

The lights themselves have a single 11W, 12V bulb in them.  The original wiring had the wires coming out the back of the light.  This was meant for an underground, vampire type splice.  This in my eyes, in unacceptable.  Instead, I ran conduit and daisy chained the lights together.  This way, I could do the wiring splice inside the box.  I used 10awg wire to reduce the voltage drop to the lights.  This may have been over kill, but I am pretty much guaranteed that the lights should be of the same relative brightness from the 1st to the last.  The total current draw for these lights is 14 amps at approx 14VAC.

When this project first started, I simply used an X10 Wireless Motion Detector Model MS16A.  It worked OK.  I had a receiver module that simply plugged into a standard house outlet.  I used a step down transformer that plugged into this receiver.  The low voltage output side of the transformer, simply fed the lights.  Simple, and straight forward.  It worked.

I did have some problems with it.  First of all, I do not like battery operated devices.  I do not like having to buy batteries, then turn around and replace them every so often.  I wanted a more permanent solution.  Second, and the most annoying, my X10 receiver would sometimes go brain dead and the lights would either stay on, or stay off.  The only remedy was to pull the receiver from the wall, and plug it back in.  I never did figure out what was causing the interference.

I had long time plans anyway.  My goal was to build my own light controller.  Giving it different functions/modes like . . .

  1. Dusk to dawn
  2. Motion detect
  3. Always On
  4. Always Off
  5. Preset Time (I did not incorporate this feature.)

I also had the idea of tying this controller into my door locks, so that when dusk would fall, or after a certain time of night, the doors would automatically lock.  I didn't implement this yet either.  Another idea, would be for guys that work 2nd shift, and that come home at the same time every evening, unlock the door for a preset amount of time when it sees headlights, signaling that you have arrived, but only during certain timer periods.

 

The Transmitter

Motion Detector Transmitter.jpg (160837 bytes) Transmitter_Circuit_Board.jpg (61617 bytes) 

If you have Express PCB Software, you can download and view my files below.  The software is free.

Download the Circuit Board here.
Download the Schematics here. (This file contains the Transmitter, Micro Controller, and some other stuff I was trying.  Some good, Some not so good.)

Above is a picture of the circuit board that I designed and built for inside of the transmitter.  As mentioned earlier, this circuit board replaces the original circuitry that is in a Model MS16A, X-10 Home Motion Sensor.  This redesigned circuit board also incorporates a light sensor, so that I can tell when dusk arrives.  Both the motion sense output, as well as the light output are analog outputs in the range of 0 to 5V.  The reason for this, is that I feed these signals into a micro controller.  Now I have full control of the system, and set points from a remote location, my garage.  My micro controller has 10 bit resolution, so this gives me a digital signal from 0 to 1023.

The following 3 pictures show the original, un-opened MS16A, the original internal PCB, and the final pictures shows what it looks like with my home-brew board.  My home-brew board as pictured here is not complete, I did not cut the access holes through the case yet for my wiring.  Also, the circuit board pictured is of an older revision.

MS16A-FrontView.jpg (30246 bytes) MS16A-OpenView.jpg (58142 bytes) MS16A-OpenViewMyBoard.jpg (57863 bytes)

The heart of this transmitter centers around a cheap LM324N Op-Amp.  The electrical schematic is also available for you to look at, but as mentioned above, you will need to download the Express PCB Software.  The electrical schematic is nothing complicated.  The LED is used as an indicator that it saw movement or that headlights triggered it.  Notice that I had to put shrink tubing on the LED to cut down on the amount of light that was radiating from the sides.  This stray light was getting picked up by the photo cell and was making it think it saw headlights, every time the LED would light up for movement.  Also the LED illuminates now only bright enough to see.  It is in series with a 22K ohm resister.  (I think that is what I finalized on using.)  The picture above shows something different. 

In order to get the full range of 0 - 5V from this Op-Amp, I had to supply it with 6volts.  At the time of design, I did not have a 6V regulator, so instead I biased a 5V regulator with two diodes and this brought the voltage up to around 6.1V.  Close enough.  Since then I have ordered some 6V regulators and now stock them for future projects.

This motion detector can "see" people at about 40 feet.  It is mounted off the ground about 5 feet.

I currently have one of the sensors up and running perfectly, and will be adding a 2nd sensor come spring at the start of the wall closer to the street.   This may also see anybody walking around the yard, but I won't know for sure until it is mounted and tested.  This sensor will only be about 12" off the ground, so it will not have near the range that the other does.  This sensor is mainly for early detection of headlights.

The circuit I am using now, I found on the internet.  I was going to design my own, but I found that someone had already figured it out, and he shows all of the formulas he used.  Go here if you would like some really good information for designing the circuit for a PIR. (Passive Infrared Detector.)

 

The Micro Controller

PDRM0209.JPG (245156 bytes) Micro_Controller_Circuit_Board.jpg (131707 bytes) 

Download the Circuit Board here.

The micro controller that I used is called a BasicX micro controller manufactured by Netmedia.  I used this controller because it programs in basic, and a very powerful basic it is.  This processor also has 8 analog inputs. It is also relatively fast.  Plenty fast for this application.  The cost for this type of processor is approx $49.00.   Not cheap, but the benefits for a beginner out way the cost.  This processor can be programmed in circuit and has serial communications which worked well to interface to the LCD that I used.  This LCD also was purchased through Netmedia.

 

Circuit Boards

The circuit boards were created using the Express PCB Online Service and the software if free.  It is kind of like an AutoCAD program.  It does not support auto-routing, so you have to lay all the traces by hand.  Takes a little bit of time, but hey, it cheaper than purchasing the software, and it allows maximum flexibility since you do it your self.  The cost at this time was about $64 dollars for 4 of the Transmitter boards, and about $112 for 2 of the micro controller sized boards.  Again, this wasn't cheap, but makes for a good looking project.

 

What Would I have Done Different?

I have recently been studying the PIC series of micro controllers, and for the next project of this magnitude, I will probably use a PIC16F877 Micro controller.  The price is around $8.00, instead of the $49.00, and the speed is incredible since you are compiling directly to assembly language and the program is stored in the micro controller, instead of having to be serially accessed from an external memory chip.  Programming is a lot harder, since you have to find a Basic Compiler.  But I over came that by using a program called PIC Simulator IDE created by Vladmir Soso.  This guy is a genius, and best of all he sells his software for around $25.00 online.  This guy has opened a whole new world for guys like me.  Many Thanks.

I may have tried using smarter sensors.  This I could have accomplished by using a PIC micro controller out at the sensor.  This way, I could have sent the information back serially, instead of the analog signals, reducing my I/O required at the micro end of things.  And giving me more flexibility at the transmitter.  Or, maybe this would have just been over kill.  With a little more thought, I'm sure I could have thought of some more functions that I could have implemented at the transmitter. 

From this project forward, I will be sure to put spare pushbutton mounting holes on the main boards, even if I do not intend to use them.  I would like to build a door and mount the LCD in the door along with the buttons, but I did not get that far yet, and may not get there for a while yet.  By having the buttons already imposed on the micro controller board, would have saved me the hassle of getting another board made just so I could mount buttons.  (Actually, the board I am using now was added to the end of a 2nd revision making of the transmitter boards.  This way, I didn't have to get them specially made.)

 

Conclusion

Would I do a project like this again?  Maybe, maybe not.  I did learn an incredible amount about both building with pre-manufactured stones, and micro controllers.  This wall took about 5 months to build.  Keep in mind, I never did anything like this before and I had no idea how much effort goes into something like this.  When I ordered my building materials, the landscaping distributor was surprised to see a home owner taking on such a large project.  He said that a project of this magnitude would be considered a large project for his commercial contractors.

The information gained in the micro end of this project will help fuel my next project.  I have already started experimenting with the PIC series of micro controllers from Microchip.

At this time, I'm not sure what the next major project will be, but if we can think it, we can make it happen.  J

If you have some questions on this project, send me an e-mail. 

Later
-Shins

Following is more information and what I am doing to date.

6-15-2005

Added the 2nd Motion Detector.  Doesn't work at all.  The wiring was very hard to pull, so I believe I broke the conductors.  I have run out of ambition at this moment, and I have other projects.  The main sensor is working, so I'm not really in a rush.  I will look at it some other time.

  PDRM0107.jpg (49810 bytes) PDRM0108.jpg (59690 bytes) PDRM0109.jpg (58827 bytes)
Here are some construction pictures.
This is the edge as you go towards the house.

6-16-2005

I am currently building a simple herb garden for my wife using the same block building material.  I will get pictures of this project in the near? future.