Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Interfacing a 4X3 door key pad and sensor code with netduino

keypad sensors

  • Please log in to reply
9 replies to this topic

#1 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 13 February 2013 - 07:04 AM

Am a beginner, and i have just bought netduino for my project, i would like to interface it with a door key pad to control the arming and disarming the buzzer and at the same time interface it with sensors to detect motion through the windows. but i don't  know how to start with that.

I finished the netduino beginner project, now am looking forward to my project.

For any help i will be very grateful.

   Thanks



#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 13 February 2013 - 08:31 AM

Hi and welcome to the Netduino forums!

 

First thing you need to know is how the keypad works. The easiest way is to read the datasheet.

I once wrote a small tutorial about the cheaper keypads, which can be read here: http://stefan.co/ele...-keypad-driver/

 

Then you need to write (or download) a driver class.


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 20 February 2013 - 05:43 AM

Is it possible to have a driver class from you for the keypad, i need to look at your sample, Thank you so much for replying, iam happy bce you  responsed when i need your help. I have been having fun with my netduino by playing some tunes using the buzzer

Now i need to focus on my project.



#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 20 February 2013 - 07:57 AM

Of course! See also the final line of my blog post:

Downloads are available at this project page: http://netmftoolbox.codeplex.com/

 

;-)

 

To be precize; documentation at http://netmftoolbox....re.MatrixKeyPad


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 01 March 2013 - 07:54 AM

I have used the keypad driver and it works , but only key 4  and key 8 are right according to the output, i have tried changing the pins to give out the right keys according to datasheet of my keypad but it has failed to the other numbers right

The part number of my keypad is 88AB2-143.

  It has the same key and pin assignment as yours. 

 Please help me with this so that i can finish it and the i see how to send commands out 



#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 01 March 2013 - 12:51 PM

See attached datasheet. The important part is the truth table here.

It shows which pins are connectedfor each button.

 

For example, for button 1, pins F and J are connected.

Attached Files


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#7 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 05 March 2013 - 05:35 PM

Think you so much, now it works, Things are interesting because of you, i  appreciate   your help.

Now my next step is to detected the output on LCD, but as per now i want to first  blink on board led by pressing  different keys

and the led blinks, please can you help me, how i can pick the keypad code and interface it with any other display output.

Then i can interface it with my alarm system if a code is entered.

 Thank you, and am sorry to ask to much, am just learning.



#8 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 06 March 2013 - 08:37 AM

Could you please post your current code, and what exactly do you want to achieve at this point?


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#9 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 13 March 2013 - 06:46 AM

public class Program   {   static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);     static string[] password = { "1", "2", "3" };   static string[] entered_password = new string[3];   static int index = 0;     public static void Main()   {   //these are my key assigment     // Column pins .The keyPad exists out of 3 colums   Cpu.Pin[] ColPins = { Pins.GPIO_PIN_D5,Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7 };   //Row pins. The keypad exists out of 4 rows.   Cpu.Pin[] RowPins = { Pins.GPIO_PIN_D1,Pins.GPIO_PIN_D2,Pins.GPIO_PIN_D3,Pins.GPIO_PIN_D4 };   //initializes the new keypad       MatrixKeyPad kb = new MatrixKeyPad(RowPins, ColPins);   // Bind both events   kb.OnKeyDown += new NativeEventHandler(kb_onKeyDown);     //OutPins.OnInterrupt += new NativeEventHandler(output_OnInterrupt);   Thread.Sleep(Timeout.Infinite);   }       //Triggered when a key is pressed   //The key code   //Date and time of the event       static void kb_onKeyDown(uint keyCode, uint Unsed, DateTime Time)   {  // initializing a vailable;   string key = keyCode.ToString();   int j = 0;   //check at increment 2   if (index <=2)   {   // assign ke+y into an array       Debug.Print(key+ " : " + index);   entered_password[index] = key;   index++;   if (index >2)   {   if ( entered_password[0] == password[0] && entered_password[1] == password[1] && entered_password[2] == password[2])   {   while (j != 3)   {   led.Write(true);   Thread.Sleep(500);   led.Write(false);   Thread.Sleep(500);   j++;   }   }       }   }           }     }

sorry for taking long to respond but that worked for me, right now i have been trying to connect the infrared sensors but i can detect transmission from a tv remote, and the led transmitter seems not to work, i want to pick data if the connection of the infra red sensors to be used, it seems not working, i connected my output to the led just in case there's something detected.



#10 wmukasa

wmukasa

    New Member

  • Members
  • Pip
  • 7 posts

Posted 15 March 2013 - 08:05 AM

Hi Stefan, i hope you saw my code, it was successful 4 me, but now am working on infra red sensors, i need help with the circuit connection so that i can pick out and use it in code, so far i first wanted to use a led to blink if   there was any abstraction, then i can interface it to the netduino, for any suggestion i will be very grateful thinks.







Also tagged with one or more of these keywords: keypad, sensors

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.