Zedomax DIY 108 – Make an alarm system in 3 minutes! (Part II) add motion sensor!


Do it yourself !

Zedomax Alarm System IIMake an alarm system in 3 minutes!

(Part II)Add a motion sensor!

Here’s a video of Zedomax Alarm System II in Action:

[gv data=”tsRT6wdaXks”][/gv]

Parts List:

1 RadioShack Motion-sensing Door Chime/Alarm $27

Other parts from Zedomax Alarm System Part I

Estimated Time to Assemble: 3 minutes

Estimated Time to Program: 10 minutes (or none if you use my source code)

The other day I was walking through RadioShack and found this neat little Motion-sensing Door Chime/Alarm.

Since I already had an alarm system, I decided I could simply add a motion-sensor to my existing alarm system.


1) First disassemble the motion-sensor like shown in above picture.

2) Now disconnect the speaker wires, we don’t need the speaker on the motion sensor since we already have one on our alarm system.

3) Solder 2 wires to the speaker wires. Make sure to mark one of the wires as ground for later. I used a black tape to mark it.

4) When you measure the speaker outputs, you should get around 8V DC, we will need this information in order to not burn up our CB280 module.

5) You can take the wires outside of the casing through the battery connectors.

6) Assemble your motion-sensor now like shown above.

7) Now you have a motion sensor w/ 2 wires you can use to sense motion!

8) Connect the the Positive wire of the motion sensor to the middle of a 3804 TR.

Connect the GND of motion sensor to GND of the study board.

Now you can connect 5V of the study board to the right side of the 3904 TR and the P21 of the study board to the left side of the 3904 TR as shown in the above picture.

Connect a LED Output to P21 to check that motion sensor is working and the CUBLOC module will receive correct digital signals.

Now check that your motion sensor is working by turning the motion sensor to “Chime” and try flickering your hands in front of it.

The LED on the motion sensor and the study board should go off together in harmony.

Now simply unzip and download this program using CublocStudio:


You should get a nice Motion line added to your existing alarm system.

Try turning On your alarm system, the password is 1234.

Now make some movements on the motion sensor to set it off.

The alarm system will go off and the only way to turn it off is by entering your password again.

Press the CNCL button if you mess up your password.

Program Source…

(Bold for added code)

Const Device = CB280

#define MyPass 1234

Set Pad 0,1,10

Const Byte KEY_TABLE=(0,0,14,16,0,15,0,0,0,0,13,9,8,7,0,0,0,0,12,6,5,4,0,0,0,0,11,3,2,1)

‘Key table if Keypad inserted backwards to the Keypad Controller

‘Const Byte KEY_TABLE=(0,0,1,4,7,10,0,0,0,0,2,5,8,11,0,0,0,0,3,6,9,12,0,0,0,0,13,14,15,16)

Dim X As Byte

‘Status of Alarm

Dim AlarmON As Byte

Dim AlarmStayON As Byte

‘Status of Door

Dim Door As Byte

‘Status of Motion Sensor

Dim Motion As Byte

Dim Password As Long






Input 0

Input 1

Input 2

Input 3

‘Set port P5 to output

Output 5

‘Set Magnetic Switch to input

Input 20


Set int0 2

Input 21


Set int1 2

On Pad Gosub PAD_RTN

Set Ladder Off

Set Display 2,0,0,128


Delay 100


Locate 0,0

Print “Zedomax Alarm System”

‘Add motion sensor LCD commands

Locate 0,1

Print “Motion: “

If In(21)=1 Then

Print “movement”


Print “none”

End If

Locate 0,2

Print “Door is: “

If In(20)=1 Then

Print “open”


Print “closed”

End If

If AlarmON=1 Then

Locate 0,3

Print “Alarm Status is ON”


Locate 0,3

Print “Alarm Status is OFF”

End If


If (AlarmON=1 And Door=1) Or (AlarmON=1 And Motion=1) Then


End If

If AlarmStayON=1 Then


End If




Debug “Door: “,Dec Door,Cr


If Door=0 Then

Locate 9,2

Print “closed “

Debug “door closed”,Cr


Locate 9,2

Print “open “

Debug “door open”,Cr

End If

Delay 500




Debug “Motion: “,Dec Motion,Cr

‘Add motion sensor LCD commands

If Motion=0 Then

Locate 8,1

Print “none “


Locate 8,1

Print “movement “

End If

Delay 200





If X>29 Then Return


Debug “Key Pressed: “, Dec X,Cr

If X < 10 Then


If Password > 9999 Then Password=X

Debug “Password: “, Dec Password,Cr

If Password = MyPass Then

AlarmON=AlarmON Xor 1

If AlarmON=1 Then

Locate 0,3

Print “Alarm Status is ON “


Locate 0,3

Print “Alarm Status is OFF”


End If

End If

‘If ENTR pressed

Elseif X=11 Then

‘If CNCL pressed

Elseif X=15 Then


End If



Sub Alarm()

Out 5,1

Delay 100

Out 5,0

Delay 100

End Sub

Sub Peep()

Out 5,1

Delay 5

Out 5,0

Delay 5

End Sub

Taking it Further…

Now you can take it further, maybe add a SMS messaging capabilities when the alarm goes off, or hack a wireless motion-sensor to do the same thing.

You can always build from scratch but sometimes I feel you can simply hack stuff from RadioShack and save yourself the trouble.

If you are having any trouble with above app, please e-mail max@zedomax.com

If you have any cool apps you’d like to share or want some kind of DIY, please e-mail to max@zedomax.com

We do accept free samples for DIYs, please email max@zedomax.com 🙂

3 Responses to Zedomax DIY 108 – Make an alarm system in 3 minutes! (Part II) add motion sensor!

  1. Pingback: DIY - Make an alarm system in 3 minutes! (Part II - Add a motion sensor) | zedomax.com - blog about emerging technologies, diy, gadgets, and more!

  2. Jonney_iqg says:

    Hi, my name is Jonney, I am from Zaire.
    Just like your resource :).

  3. Anonymous says:

    So how could you add SMS? That would be great!

Leave a Reply

Your email address will not be published.