18 Temmuz 2013 Perşembe

Create your own matrix keypad

Creating Matrix Keypad
To construct own matrix keypad is very easy. Only you have to know logic of Matrix and keypad. Normal switches are being used for one application. For more, what is necessary? We use keypad applications for micro controller for more useful projects. Keypad is necessary to use our projects for more functions and reliable applications.

MATRIX
we generally remember the showing matrix as [ 3 2 1 ; 2 2 2; 2 2 1] as 3x3 matrix it has 9 elements. It has 3 rows and 3 columns. This basic informations are needed for constructing matrix keypad. 

First of all, you have to know how many buttons do you need? After that we can choose mxn matrix keypad. Then we will construct it. For example I have an project that needs 12 buttons. First question is answered. Next is, which matrix keypad is needed? 3x3, 4x3, 4x4 etc. For 12 buttons, 4x3 (=12) is enough (exactly). And final part is constructing our matrix keypad.

CONSTRUCTION KEYPAD
As you see in matrix, you place elements in an coordinate system. for each element you have to know row and column number. So it gives us an idea to categorise cables as rows and columns. Each switch has 2 pins. One for input cable to the switch, other is output cable from switch. so we make S/C to input pins as one row( or column) on same line. And similarly, we solder the column pins as one column (or row). And we have matrix keypad. 

Attention: Don't forget to check all switches and components are stable before soldering.

Example for 2x2 matrix keypad. Attention on switch's pins. They are regrouped for rows or columns.




R1 and R2 represent rows and C1 and C2 represent columns. As this example you can make mxn matrix keypad. Only you have to regroup columns and rows pins.

If you make your own matrix keypad, you'll have chance to make it as you want. (buttons, dimensions etc. What ever you want. Enjoy it.

TESTING KEYPAD
you bought a new keypad but you don't know which cable is row or column. To learn that you have to check each button from cables. First, use DMM(digital multi meter as diode test) check cable 1 and 2 while use pushing button 1, later 1 and 3 etc. you can find all rows and columns with this way if you have no chance to check soldering way or circuit diagram.

Also you can watch my video about it in http://www.youtube.com/hasansnk . (Subtitle will be added)

My keypad's cost is only near $1


In pictures above, I make my own 4x3 keypad which has 6x6x4.3 (mm) buttons and its dimensions 4.5x3 (cm). I used one core cables. Ethernet cable has 8 small cables inside which is ideal to use for PCB applications. If you buy 1 m ethernet cable (Cat5), you will have 8x1 m one-core cables.

COMPONENTS:
12 pcs 6x6x4.3 mm push button switches, 20cm length one-core cable, solder and soldering iron, 4.5x3 cm PCB, stackable header which is 8 pin female header.

18 Nisan 2013 Perşembe

EEE499 Project: Digital FM Receiver with a Micro-Controller ( Arduino )


Hello Friends,
I am an Electrical and Electronics Engineer student. It is my first project of this year. As you see, it is my graduation project from University of Gaziantep, Turkey. In this project I tried to construct a digital FM receiver with a micro controller. I used 16*2 LCD display, Si4703 FM receiver, 4*3 keypad and micro-controller Arduino UNO R3. 

I met Arduino with this project and I find it is very easy for programming. I learned too much things from arduino.cc , forums and I decided to make more project after my first experiment. I used Si4703 digital FM receiver kit for my project. I think that RBDS could be more attractive on my project but, I couldn't success to run RBDS. I haven’t found the problem yet. FM kit has 150mW amplifier but it may not enough to hear some FM station voices so, I suggest an amplifier, too. Also at soldering process you need to be quick and careful to not give harm to kit. I had to use another one. Of course, I bought 2 of them so, I did not need to give another order. Voice is clear enough but, Kit can’t find quickly to another FM station. You have to push button more times to catch strong signal while scanning. Overall it has good performance. I used 16*2 LCD display to show current frequency, Sound quality; Mono or Stereo, current station is favorite or not (in quick button memory or not) , Voice level; 0 to 15 (min-max). By using 4*3 keypad, you can scan signals by 0.1 MHz (buttons 4,7) or jump to the other strong signal (up or down; buttons 5,8). Also you can use mute button (6) to voice off directly and can be listen again by same button to voice up to the last voice level. Also you can use voice up and down buttons for preferred voice level. For setting, you have to enter submenu by 9 and increase sound # and decrease sound level by * and to quit submenu, you have to use 0. And I used 3 direct memory buttons (1,2,3) to tune on FM stations to listen directly. Also you can change this favorite FM stations by using 0.

I tried to have same functions as normal digital FM radio on my FM receiver. Except RBDS, I succeed all. Also I prepared a video on youtube. You can see it by there http://www.youtube.com/watch?v=G3NxUwJzl24 . I added a subtitle in English to more help to you. I hope it will help you, too. 



15 Mart 2013 Cuma

Smart Home Project

Hello Friends,
I am student at Gaziantep University from Turkey. It is my last semester (I hope) and I want to add more project untill graduation. It is my second project and it is a task right now. Later I will give you what process is going on this project. Date and date...

***March 15th, 2013
I am still preparing plan of my project and I planned to have these specifications on my project.

Energy Source: In daylight, it provides using renewable energy source as solar power by using PV panel(s). Otherwise I planned to supply normal process.

Sensors and Applications
1) Lighting System: If daylight is enough, lights will be turned off automatically. And if it is not enough, lights will be turned on.
2) Energy System: If daylight is enough PV panel(s) move(s) for best angle to take daylight efficiently on the roof.
3) Alarm System: If somebody does not keep out enough to the door, alarm system will be on and in a narrow time you have to enter password otherwise security will be activated. Also fire alarm can be added.
4) Weather Control System: If outside is fine enough, windows are opened by system. If there is rain or not good enough, windows are closed. Also system can be connected to the climate system.
5) Safety System: When you at bathroom and no move for long time, system warns you by a buzzer. If you don't reply the system,, security will be activated. This specification for older people. Activation can be classified as turning on/off the tap or adusting the flow rate etc.

By a LCD and keypad, you can control system for on/off and you can observe inputs.
Micro controller and PLC will be used (if has enough time).

***April 30th, 2013
Introduction video is added https://www.youtube.com/watch?v=BTkDKYWLrhI . English subtitle is added.

***May 14th, 2013
3) Alarm System: I finished the algorithm of Alarm System by using PIR- motion sensor. Alarm system is activated by controller on menu interface. If Alarm system is on and motion is detected. You have to enter 4 characters/numbers by using 4*3 keypad correctly. You have 30 seconds to enter true numbers. if you enter 3 times wrong combination or you wait 30 seconds. Alarm system will worn to security guards and buzzer will be run. After that point if you enter true combination(e.g.1400), you can only shut down buzzer and alarm system but also security guards still be worned. Security will come and check your situation. If they think no problem and everything ok. they shut down their warning system by using their own codes (1408). All delay times can be changed by obtaining on C codes. Alarm activation time is 5 seconds to show on example video, entering alarm system deactivating code time by user is 30 seconds.

Components:
Arduino Mega R3 micro controller, 4 lines 20 columns LCD (4*20 LCD TC2004A), 4*3 keypad, buzzer, 2*green LEDs (5mm), PIR sensor, 4*10kΩ resistors (for keypad Over current protection), 1*22kΩ trimmer( for LCD contrast adjustment), jumpers or cables.

let's see the run process of Alarm system on youtube.com/hasansnk
http://www.youtube.com/watch?v=6WDS0GjUMNI


***May 19th, 2013
1) Lighting System: Objective is to control LEDs (represent LAMPs) by micro controller Arduino Mega 2560 R3, I used LDR to check envirement's light level. Arduino checks light level. If light is not enough LED will be turned on otherwise it turns off LED.

I used two LDRs for two LEDs to be independent to each other. By using DIP switch you can turn on/off system and LEDs manually. I used 1N4001 diodes two protect Arduino pins while LEDs are turned on manually. 1N4001 diodes can be used up to 35V DC applications. LED resister can be calculated by that formula. (Supply voltage-LED voltage)/(20*10^-3). LED voltage values are different dependent to their type and colors. but current which flows on LED is constant; 20mA. By using these conditions, you can calculate resister value. Also you can adjust threshold value for best usage. I also connected extra cables to Arduino on LED brenches to check LED is on or off. I used DIP switch to control system, LEDs on/off. System can be controlled by DIP switch #1. It is connected to Arduino pin, +5V source and to protect Arduino 10KΩ. DIP switch #2 and #3 are connected to the LEDs to turn on/off them manually. For manual usage 90Ω resister have to be used. but I have minimum 120Ω.

To control system I used 4*20 LCD and 4*3 keypad.

 


Components:
2*LDRs, 2*LEDs, 2*1N4001 diodes, 2*90Ω resisters, 1*10KΩ resister, 2*4.7KΩ and cables/jumpers.


*** May 25th, 2013
1) Energy System: A controlling PV panel(s) by servo motor
As I mentioned before, I think to use photovoltaic panels to supply my smart home voltage. And for best efficient at this process, I have to adjust panels' position for best angle to the sun so, I have to design an automation to control panels' position. At this point, I think cheaper and best way to use LDR components for using them as sensors. For each panel, I used one servo motor for one motion axis. 2*LDR sensors will enough to check servo motor's motion direction CW or CCW. Arduino controls servo motor to the which sensor has more voltage value. so best angle (vertical to the sun) is provided by sensors. you can use 2 servo motors and 4 LDR sensors for 2 different axis. I programmed my Arduino for this purpose. I also added timer function to the Arduino, because I don't want that servo always runs. I used 2 time integers. first is to start pause time, second is to finish pause time for the servo motor. With this way motor will run for a narrow time and stays on standby. For some adjestments you can follow my directions. They are,

First of all, you have to read analogRead() function value for each LDR sensor on the screen for offset adjustment when you use light source to the 2 of LDR sensors in the same time in same angle to the light.

Secondly, I used a threshold value for panel to not run always. If enough light is exist, panel will run. In same logic, I used again a threshold value to compare two sensors' value to decide turn or not. For example; if digital value difference is bigger than 15, panel turns CW or CCW. Otherwise, there is no motion.

As you know servo motor has 3 cables; Black (brown)  for ground, red for +5V supply and orange (yellow) is for data cable to connect micro controller pin.

Third of all, I think to determine a start position to the servo motor. It is 40 degrees If there is no enough light, servo motor turns to the start positon (40 degrees) and keeps its position. You can change it for your purpose. And I can observe SYSTEM ON/OFF information. While SYSTEM is ON, Angle value also can be observed. Also my servo motor runs between 20 degrees and 160 degrees.

For second part of Energy System video, I will mention about supplying home voltage by PV panel(s).

To control system I used 4*20 LCD and 4*3 keypad.




Components:
2*LDRs, 2*4.7KΩ  resisters, servo motor and cables/jumpers.