Author Topic: New kid on the block that needs a little push.  (Read 3913 times)

emkowale

  • Newbie
  • *
  • Posts: 3
    • View Profile
New kid on the block that needs a little push.
« on: October 26, 2011, 10:31:46 AM »
Hello,

     This summer I bought a home that has simple door and window contact switches everywhere.  My goal is to have a device that simply tells me the state of these switches either via SNMP or my own polling software.  I purchased a SBC65EC and a PT24E-ASMI.  I got the boards, put them together, powered it up and logged in via the internal webserver.  This is just the sort of fun project I love to do.  However, I think I need a little push to get me started.  I've been programming for years.  I just need this device to tell me if the contact switches on my house doors are open or closed.  Can you point me in the right direction?  For starters, where to I plug the two wires from each switch?

  Thanks,
    Eric

Rick314

  • Hero Member
  • *****
  • Posts: 55
  • SBC65EC/66EC, PT24E, LCD2S-204FHB, PICkit 3, MPLAB
    • View Profile
Re: New kid on the block that needs a little push.
« Reply #1 on: October 26, 2011, 02:50:24 PM »
The online data sheets and schematics for the SBC65EC and PT-24E-ASM allowed me to write a Java program to set the LEDs on the PT-24E-ASM using UDP.  Since it was for a school project I tried to comment the code well.  See http://forum.modtronix.com/index.php?topic=1409.msg4471

I also spent significant time on SNMP with the SBC65EC/SBC66EC, but abandoned them in favor of the Microchip PIC32 Ethernet Starter Kit: See http://forum.modtronix.com/index.php?topic=1370.msg4287

I think that with no actual firmware programming of the SBC65EC needed, its existing HTTP or UDP control interfaces can configure its digital I/O pins and use them for what you want.  Hopefully someone else will comment that has already done closer to what you want.

emkowale

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: New kid on the block that needs a little push.
« Reply #2 on: October 27, 2011, 08:37:04 PM »
I looked at your example.  It will help me out once I can get past one simple and probably obvious thing that I am missing.  Where do I plug in the switch?  There are 24 screw terminals on the pt24e-asm.  Do I use 1 and 2?  Once the switch is plugged in and I close the circuit, I should see a 1 or a 0 in the web interface somewhere.  Correct?

  Eric

Rick314

  • Hero Member
  • *****
  • Posts: 55
  • SBC65EC/66EC, PT24E, LCD2S-204FHB, PICkit 3, MPLAB
    • View Profile
Re: New kid on the block that needs a little push.
« Reply #3 on: November 02, 2011, 11:02:18 PM »
There is more work involved than I think you are imagining, but it is definitely within the capabilities of the SBC65EC and PT24E-ASM.

http://www.modtronix.com/products/sbc65ec/sbc65ecr3.pdf is the 16-page SBC65EC Data Sheet.  Section 4 "Daughter Board Connectors" lists the signals between the SBC and the PT24E-ASM Proto Board.  http://www.modtronix.com/products/pt32e/pt24er1.pdf is the 4-page schematic/layout of the PT24E-ASM.  You will need to spend time understanding both documents.

One option for your window switches is given on the first page of the PT24E-ASM document, labeled "8 Way DIP Switch - NOT ASSEMBLED".  If you were to get and load those parts onto your PT24E-ASM, you would then be able to read the 8 DIP switches (or substitute window switches).  The 74HC165N shown on the schematic is a shift register, and reading the 8 switches involves shifting them in a single bit at a time, similar to what my Java program does for the LED outputs -- It is not trivial.  Maybe someone else has done this and posted software on the Forum somewhere that reads the switch shown in the schematic.  I didn't look.  You *can* do all the required operations from the SBC web pages, and in fact that is how I developed my Java program.  It isn't practical for actual use though.  For example, "set C0 to 0, then set C0 to 1" (2 manual operations using the web pages) puts an edge on it and does a single "shift".  Many such operations are required to get all 8 bits.  It is tedious for a human but easy for a program.

Sheet 2 of the PT24E-ASM shows the terminal blocks X1 and X2, with all pins being No Contact.  You have to connect them to other signals that come from the SBC.  Notice the signals from the SBC are labeled on the PT24E-ASM board itself, near the two connectors that the SBC mounts on.

If you wanted to avoid the shift register, some of the PIC I/O pins (RA0-RA5, RB0-RB7...) could be wired to the X1 and/or X2 terminal block using wires added to the PT24E-ASM board, and high/low levels put on them using pull-up resistors and window switches to ground.  I am summarizing here, and assuming some digital design knowledge.  Hopefully this just gives you an idea of a general path to be taken.

emkowale

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: New kid on the block that needs a little push.
« Reply #4 on: November 03, 2011, 08:19:50 AM »
Hmmm,

     You're right.  This may be a bit more than my background allows.  However, I am still excited about this little project so I'll throw this out there...  Can I pay you to handle the low level stuff and get it to the point where I can interact with the system at a higher level?  I had some assembly and machine language stuff back in college, but I'm a PHP/database guy.

  Eric

Rick314

  • Hero Member
  • *****
  • Posts: 55
  • SBC65EC/66EC, PT24E, LCD2S-204FHB, PICkit 3, MPLAB
    • View Profile
Re: New kid on the block that needs a little push.
« Reply #5 on: November 03, 2011, 08:54:30 AM »
Eric,

Sorry, but I am not interested in doing this for hire.  I did post a new thread to see if anyone else has done the coding to read the non-loaded DIP switch and shift register given on the PT24E-ASM schematic, here: http://forum.modtronix.com/index.php?topic=1503.0

Rick
« Last Edit: November 03, 2011, 09:18:06 AM by Rick314 »