HOME > > DALLAS MICROLAN SECTION INDEX > > HARDWARE VENDORS

Building Hobby-Boards Mini Motion Sensor (PIR) for 1-Wire (aka MicroLan)

This information is meant to help anyone assembling the 1-Wire Motion Detector module designed and sold by Eric Vickery via www.hobby-boards.com. The experienced electronics constructor certainly won't need these notes... the board is not hard to assemble, but even he/ she may find that the notes help a little. It should be noted that these instruction are from a third party. Any faults are not Mr. Vickery's!

There is a circuit diagram and photographs which will help you at www.hobby-boards.com

In the course of this document, you'll see "top", "left", etc. These references assume you are looking at the pcb with the location for Reg1 at the upper right.

Everything except the PIR goes on the side of the board with the legend "Mini Motion Detector", i.e. the side with the pads for the smt 555 timer. (smt: "surface mount technology"... little black rectangle with 8 legs)

Start by installing the 555 timer. You'll need a steady hand, at least a fine-tipped soldering iron, and probably some way to magnify what you are doing. Some very fine solder is also a help. There are various guides on the web to smt work. I'm afraid I must confess to building my Motion Detector with nothing fancy, just a little care. Would I want to do a lot of smt work with my very basic tools? No... but don't buy a $150 soldering station to do a few hobbyist kits! If you are doing something more extensive than the Motion Detector kit, you might find the notes I did for Atkins Bray barometer assembly helpful.

Going back to the Motion Detector kit: First, I used a knife to GENTLY scrape the pads for the 555 on pcb. I also VERY gently scraped the "feet" of the 555. Having both surfaces clean and bright before you start helps get a good solder joint.

If you look closely, you'll find that one edge of the top of the chip has a chamfer (bevel). That side goes towards bottom of board. (It tells us where pin 1 is). (qto edit: show with arrow in illustration.)

If you are of the "clean the board after soldering" school of thought, this is a good time to do it.... if you have the proper solvent. Beware isopropyl alcohol sold for cosmetic purposes as it may have skin moisturizers (oils) which may make subsequent soldering harder.

There are two blobs of plastic with three legs. One is the voltage regulator. Mine was marked K401 LM78L05ACZ. The other is the 1-Wire (MicroLan) DS2405. Mine was marked "DS2405", helpfully enough!

Install DS2405, in the U1 position, using the silkscreen to guide you as to orientation.. it is not hard to accidentally insert it rotated 180 degrees from how it should be facing.

Before I go on, I should mention: Don't drill out any holes in the pcb, if you feel the "need" because something is a tight fit. In some cases, there is a film of metal lining the hole, and it is a vital part of the circuit, linking traces on one side of the board with those on the other.

Next insert and solder in place the 3 way terminal block. Normally, I'd leave something so bulky until the end, but there are no "fiddly things left for this kit, and we can test the DS2405 (already), so making connections easily is good.

If you now connect the module to a PC (via the usual 1-Wire adapter), you can test now with iButtonViewer. It should see a DS2405, (code ends in "05"). To make this test, you connect the 1-Wire 0 volts to the bottom terminal (it's marked "3"), and the 1-Wire Data/Power or "DQ" wire to middle the terminal of the module.

From the 1-Wire adapter that you have (or will have!) plugged into the computer come two wires. The easiest way to make sure you're doing the hookup right is to connect a voltmeter to them, after plugging the adapter into the computer and turning it on. (You don't have to shut off the computer to plug in the adapter if the computer is already running. Also, the 1-Wire units are "hot-swappable".) One wire will be carrying a nominal 5v (from an iButtonLink adapter I was using I was seeing 7.8v when the wires were not connected to anything.) The other wire is the 0 volts, "ground", wire. (Note for beginners: If your voltmeter shows NEGATIVE 5v, it means that you have the "positive" lead from the voltmeter connected to the 1-Wire "zero", and the other lead from the voltmeter is connected to the 1-Wire "(positive) 5v". Don't worry... nothing is "wrong", and no harm will have come to anything.) The wire carrying 5v is usually called the 1-Wire Data, or Data/Power, or "DQ" line. It is PRIMARILY a data line, but some 1-Wire chips can "collect" the little power they need from the data line, hence the second name.

Install R1, vertically. It is the cylinder with colored bands, a wire out each end. If your kit came with two, one is a 1 meg resistor, the other is a 10 meg. Their bands are brown-black-green and brown-black-blue, respectively. The PIR at the heart of your sensor module switches "on" briefly when it sees someone. The smt device, etc, "stretch" that pulse.... to about one second if you use the 1meg resistor, or about 10 seconds if you use the other. I can think of no "downside" to using the 10 meg resistor, and think that the other would be a problem, in some circumstances. (Your software can be less sophisticated with the longer pulse.) The resistor is not a "polarized" component, i.e. it can be inserted either way "around".

Install C3, the "odd" component, unlike any others in your kit. It is likely to be yellow. It is not "polarized".

R1, C3 and IC1 between them achieve "pulse stretching". If the PIR senses someone's presence, even briefly, the signal to the 1-Wire chip will persist for a period of time determined by the values of R1 and C3. With 1 meg and 1 microfarad, the values supplied in the kit I received, the pulse is stretched to about one second.

Install the voltage regulator, discussed previously, in position "Reg1". As with the DS2405, which it looks like, the silkscreen shows you the correct alignment. Again, be careful it isn't rotated 180 degrees from it's correct orientation.

Besides the PIR, you should have two other, identical to one another, components left. They each have two wires coming out of them. They ARE polarized components, and need to be soldered into C1 and C2 the right way "around." On the component, one wire will be marked "negative", or maybe just marked with a minus sign. Alternatively, or in addition (rare!), the other will be marked "positive", or "+". On the circuit board, the hole for the positive wire is marked with a tiny + sign. It is the left hole for C1, the top hole for C2. If you mount C1 a little "loosely", i.e. not quite flush with the pcb, you can clip voltmeter leads to the capacitor leads. The left one gives you access to the board's zero volt rail, and the right hand one is a good place to connect to check that the output of the voltage regulator is as it should be.

This is another time you might want to clean the board to remove left over soldering flux.

Install the PIR. N.B.: It goes on the "back" of the board, i.e. the side with "(c) Electronic Visions".

Ta da! Assembled. Now we can connect the power, hookup to a MicroLan, and test your work!

You will be connecting two things, each requiring two wires, to the Motion Detector (which I also call the "PIR module"). There is the 1-Wire connection, discussed earlier, and you will also have to connect power to the PIR module. While the DS2405 can be powered parasitically, the PIR sensor cannot. I'll try to refine my spec eventually, but if you have a source of 7.5-12 volts, DC, 200mA, that should do. It doesn't have to be a regulated source. You might even get away with sources outside of this spec. (Higher, lower voltages. A higher current capability will do no harm, but the extra capability will just go to waste.) A typical "wall wart" power adapter will often report a higher voltage than you expect if you check the voltage when nothing but the voltmeter is connect to the wall wart.

Connect the zero volt wire of the 1-Wire connection AND the zero volt wire of the power supply to terminal 3 of the screw terminal block. (The terminal nearest the corner.) Be careful not to let the two not-yet-connecter wires short to anything.

Connect one lead of your voltmeter to some convenient zero volts point in the circuit. The left hand lead of C1 is one candidate.

Connect the other lead of the voltmeter to the right hand lead of C1 (or similar.) In a moment, the voltage should be very nearly 5 volts (certainly no more than 10% off, and probably closer to 5.0 than that.)

Now just touch the wire supplying voltage to the board to terminal 1 of the screw terminal block. That's the terminal at the top of the block. Your voltmeter should read nearly 5v. If it doesn't, then there's a problem, perhaps a short somewhere on your circuit, or you have the voltmeter connected wrongly. Disconnect the wire asap and hope everything survived! (I'm afraid I can attest to the fact that you MAY get away with installing the voltage regulator 180 degrees wrong... I did! (Whew! Hurrah for the robustness of silicon!))

Check the voltage on the center terminal of the block. It should be zero at the moment.

Start iButtonViewer on the computer. It should start, but not at this point "see" any devices on the 1-Wire, unless you have other things connected, which would be okay, if it were the case. If you have an ID chip in your adapter, that would show up in the Viewer display.

Connect the 1-Wire Data line to terminal 2, and the Viewer should soon "see" the chip.... regardless of the PIR's state.

My version of the iButtonViewer (3.20) was not capable of telling me what the 2405 was "seeing"... but it WAS able to tell me that a 2405 was present on the MicroLan, and the device's individual ID.

Even without software, though, there are things you can check:

Look at the voltage on the PIR's pin which is "in the right-angle corner" of the PIR's pins, i.e. the one between "U2" and "MS" of the silkscreen. This pin will normally be high, and will go low briefly when the PIR "sees" something.

If that much is working, you should also find that the lower pin of U1, the 2405, the pin nearest C2, will normally be low. When the PIR "sees" something, the lower pin of U1 goes high for about 1 second if you have a 1 meg resistor in R1, or for about 10 seconds if R1 is 10 meg. If you want an even longer pulse, a bigger capacitor at C3 would help. With 10 microfarads there, and a 10 meg resistor at R1, the pulse would be about 100 seconds long.

If you decide to replace R1, and you only have a quarter watt 1 meg resistor to hand, don't give in to the temptation to drill out the holes for R1 to accommodate the thicker leads. It is a particularly unsatisfactory "solution" in this specific case. (Extend your quarter watt resistor's leads with some finer wire which WILL fit the holes!)

If you want to add a "walk test" LED to the device, it could be done, mechanically, on the same side of the pcb as the PIR sensor. Remember you'd need to add a current limiting resistor, too. I'm not sure if the power regulator and the 555 timer could cope with the extra demand for power, but I suspect that they could. You'd put the LED and resistor in series, between the lower pin of U1 and the zero volt, "Gnd", rail, which so conveniently runs along the bottom of the board near where you need it. Remember the board is double sided if you drill holes!

I hope that helped.

Tom Boyd

Sheepdog Software Homepage

Matters 1-Wire / MicroLan

Tutorials on Delphi programming, including lessons on 1-Wire.



Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Here is how you can contact this page's editor.
Click here to go up to general 'electronic projects' page by editor of this page.