The Kynix Blog - IC Chips
Stay Ahead with Expert Electronics Insights,
Industry Trends, and Innovative Tips
- Electronic Components
- News Room
- General electronic semiconductor
- Components Guide
- Sort by
- Robots
- Transmitters
- Capacitors
- IC Chips
- PCBs
- Connectors
- Amplifiers
- Memory
- LED
- Diodes
- Transistors
- Battery
- Oscillators
- Resistors
- Transceiver
- RFID
- FPGA
- Mosfets
- Sensor
- Motors, Solenoids, Driver Boards/Modules
- Relays
- Optoelectronics
- Power
- Transformer
- Fuse
- Thyristor
- potentiometer
- Development Boards
- RF/IF
- Semiconductor Information
- Sensors
- PCB
- transistor
Catalog IntroductionComponentsArduino Code Introduction The idea of this project is to create an Arduino based home security alarm system that can be used to monitor and control the various appliances in the house. The main purpose of the system is to detect any unusual activity and notify the user about it in an efficient manner. The system will also use a web server to push notifications to mobile devices such as smartphones and tablets. The project consists of an Arduino Uno board connected to a Debounce shield which contains a piezo buzzer, LED, power supply and other components necessary for interfacing with Arduino Uno board. A passive infrared sensor, or PIR, is a Pyroelectric device that senses motion. For this reason, it is sometimes referred to as a motion detecting sensor. It may be able to detect motion by detecting variations in the infrared levels emitted by nearby objects. This gadget is a basic motion-activated alarm. Its brain is an Arduino microcontroller. It is connected to a PIR motion sensor, a buzzer, a resistor, and two external connectors. The system is very portable because it is entirely battery-powered. As soon as you get the code, you may link all of the external components. This is the easiest thing to do with a breadboard. To check everything out, you can create bogus connections. The whole system Is powered by 12V DC power supply which powers all other components except Arduino Uno board itself. The MCU receives digital commands from Arduino Uno through SCI interface and sends appropriate analog or digital signals on its pin according to the command received by it. This project has been inspired by many previous projects that use Arduino boards for controlling various electronic devices such as lamps, lights etc., but this project focuses more on controlling various appliances. The Arduino Uno Is based on the ATmega328 chip, which has built-in USB support for serial communications. It also has a built-in 5V power regulator that allows it to be powered directly from the USB connection or from a battery. Components 1Arduino2Motion Sensor3LED’s4Buzzer5LCD Module Arduino Code#include <LiquidCrystal.h> int ledPin = 13; int inputPin = 7; int pirState = LOW; int val = 0; int pinSpeaker = 10; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { pinMode(ledPin, OUTPUT); pinMode(pinSpeaker, OUTPUT); Serial.begin(9600); lcd.begin(16, 2); lcd.setCursor(2, 0); lcd.print("P.I.R Motion"); lcd.setCursor(5, 1); lcd.print("Sensor"); delay(4000); lcd.clear(); lcd.setCursor(2, 0); lcd.print("Displaying"); lcd.setCursor(2, 1); lcd.print("A"); delay(5000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Processing Data."); delay(3000); lcd.clear(); lcd.setCursor(3, 0); lcd.print("Waiting For"); lcd.setCursor(3, 1); lcd.print("Motion...."); }void loop(){ val = digitalRead(inputPin); if (val == HIGH) { digitalWrite(ledPin, HIGH); playTone(300, 300); delay(150); if (pirState == LOW) { Serial.println("Motion detected!"); lcd.clear() ; lcd.setCursor(0, 0); lcd.print("Motion Detected!"); pirState = HIGH; } } else { digitalWrite(ledPin, LOW); playTone(0, 0); delay(300); if (pirState == HIGH){ Serial.println("Motion ended!"); lcd.clear() ; lcd.setCursor(3, 0); lcd.print("Waiting For"); lcd.setCursor(3, 1); lcd.print("Motion...."); pirState = LOW; } }}// duration in mSecs, frequency in hertzvoid playTone(long duration, int freq) { duration *= 1000; int period = (1.0 / freq) * 100000; long elapsed_time = 0; while (elapsed_time < duration) { digitalWrite(pinSpeaker,HIGH); delayMicroseconds(period / 2); digitalWrite(pinSpeaker, LOW); delayMicroseconds(period / 2); elapsed_time += (period); }}
Kynix On 2023-02-07
The goal of this project is to design and build an automated paint mixer that can accurately and efficiently mix various types of paint to a consistent and predetermined color and consistency. This machine will be able to handle a wide range of paint types, including water-based, oil-based, and specialty paints, and will be able to mix small and large quantities of paint with precise control. Mixing paint by hand can be a time-consuming and labor-intensive process and achieving a consistent color and consistency can be difficult and require significant trial and error. In addition, the manual process is prone to errors and inconsistencies, which can lead to wasted materials and costly rework. An automated paint mixer is a machine that is used to mix different types of paint in a precise and consistent manner. The main components of an automated paint mixer include a linear screw actuator, a mixer, a controller (such as an Arduino, PLC, or other type of controller), a DC gear motor, a DC pump, a flow sensor, a relay module, an impeller, and a webcam (ESP-CAM). Materials1Controller (Arduino, PLC, ARM controller, Raspberry Pi)2DC Gear Motor3Photoelectric IR Sensor4DC Pump5Flow Sensor6Esp Cam7Linear Screw Actuator8Mixer Actuator (Impeller)9Conveyor Belt The linear screw actuator is a type of mechanical device that converts rotary motion into linear motion. It consists of a screw that is turned by a motor, which drives a nut along the length of the screw. In an automated paint mixer, the linear screw actuator is used to move the mixer up and down, allowing it to mix the paint thoroughly. The mixer is the component that actually mixes the paint. It can be a simple paddle mixer, or it may be a more complex device with multiple blades or other mixing elements. The mixer is typically powered by the DC gear motor, which is a type of electric motor that is commonly used in automated paint mixers because of its high torque and low speed. The controller is the "brain" of the automated paint mixer. It receives input from the various sensors on the machine (such as the flow sensor) and uses this information to control the various components of the mixer (such as the DC pump and the linear screw actuator). The controller can be an Arduino, a PLC, or any other type of device that can receive input and controlling output. The DC pump is used to move the paint from one location to another within the mixer. It is typically powered by the DC gear motor and is controlled by the controller. The flow sensor is a device that measures the flow rate of the paint as it is being pumped. This information is used by the controller to ensure that the correct amount of paint is being mixed. The relay module is a device that is used to control the flow of electricity to the various components of the automated paint mixer. It is activated by the controller and allows the controller to turn different components on and off as needed. The impeller is a component that is used to mix the paint more thoroughly. It is a type of rotor with blades that is placed inside the mixer and is rotated by the DC gear motor. The impeller helps to break up any clumps or lumps in the paint, ensuring that it is fully mixed. Finally, the ESP-CAM (or webcam) is a camera that is used to monitor the mixing process. It is connected to the controller and can be used to view the mixer remotely, allowing for easy monitoring of the mixing process. Overall, an automated paint mixer is a complex and sophisticated machine that is designed to mix different types of paint in a precise and consistent manner. Its various components work together to ensure that the paint is mixed properly and that the final product is of the highest quality.
Kynix On 2023-01-11
Catalog Resistors and Capacitors Electrolytic capacitors Transistor & diode packages Integrated circuit SMD packages Ball Grid Array Small Outline Packages Flat Packages Surface Mount Technology (SMT) is a technique for mounting electrical components directly to the surface of a printed circuit board (PCB). The component that is mounted on the surface of the PCB using surface mount technology is called Surface Mount Device (SMD). SMT has essentially replaced the through-hole PCB manufacturing technology to reduce cost, and increase efficiency and productivity. Since the size of SMD components is very small, compared to through-hole components many more SMD components can be arranged in a given place. Selecting and knowing the right SMD component for your PCB is very necessary. SMD components have standard codes and sizes which as a PCB designer one should know. Kynix offers all sorts of SMD components for PCB manufacturing which can be found here. This article will help you choose the right SMD component from the Kynix library. SMD components come in various packages and sizes to facilitate the automated manufacturing of PCBs. Most of the SMD components are standardized to make manufacturing easy. The most commonly used SMD components are capacitors and resistors. The standards of these components are set by Joint Electron Device Engineering Council. There are different types of packages. When a new package is introduced in the industry, it is named after its initials such as Quad Flat Package (QFP). While some packages have no name, it creates confusion in the industry. Below we have discussed flat chip SMD resistors, capacitors, diodes & transistors, and IC packages. The size of the SMD chip for resistor, capacitors, and some of the diodes is given by a 4 digits code, which represents the dimension of the flat chip either in inches or in millimeters. In the US it is represented in inches while outside the US it is represented in mm. The first two digits represent the length (L) of the component while the last two digits represent the width (W) of the component. While the thickness is also an important factor in manufacturing, it is not mentioned in the 4 digits code, for this, the actual datasheet of the component provided by the manufacturer should be used. Many PCB components such as resistors, capacitors, diodes, FETs, and other transistors are available in SMD. SMD resistors and capacitors, also known as passive devices, come in different sizes. Depending upon the availability of space, soldering capability, and environment temperature, different packages can be used. The names of these packages given in the table below are derived from the size of the components in inches. Resistors and Capacitors Below are the most common size codes for capacitors and resistors. You can find these resistors and capacitors here. S. NoPackageDimensions (in)12010.02x0.01220160.2x0.1632020.02x0.0242040.02x0.0452070.02x0.0763030.03x0.0373060.03x0.0684020.04x0.0294040.04x0.04104060.04x0.02115020.05x0.05125050.05x0.08135080.05x0.1145100.05x0.1156030.06x0.03166060.06x0.06176120.06x12187050.07x0.05198050.08x0.05208080.08x0.08218150.08x0.15228160.08x0.16238300.08x0.32410100.1x0.12510200.1x0.22610500.1x0.52712060.12x0.062812100.12x0.12912160.12x0.163012180.12x0.183112200.12x0.23212240.12x0.243312250.12x0.253414050.14x0.053515050.15x0.053615060.15x0.063715100.15x0.13815750.15x0.753916080.16x0.084016320.16x0.324118120.18x0.124220100.2x0.14320120.2x0.124420180.2x0.184520300.2x0.34622080.22x0.084724090.24x0.094824120.24x0.124925100.25x0.15025120.25x0.125125150.25x0.155226150.26x0.155327250.27x0.255427260.27x0.265527280.27x0.285628160.28x0.165728170.28x0.175828180.28x0.185930140.3x0.146030200.3x0.2 At present most manufacturers can manufacture PCBs with SMD components up to 0603 easily, going below this size to such as 0402 or 0201 is still difficult for the manufacturers, and thus the cost of manufacturing increases if these components are included in the design. Therefore, most of the manufacturers recommend using 0603 components for PCB design. Electrolytic capacitors The electronic industry adopted EIA and IECQ standards for molded tantalum capacitors. These packages are named A, B, C, D, and E. These correspond to different sizes in millimeters. Package height is not included in the size code. EIA codeMetric codeDimensionA32163.2 x1.6 mmB35283.5 x 2.8 mmC60326.0 x 3.2 mmD73437.3 x 4.3 mm Several other electronic devices can not follow any standard because of their unique nature. SMD components like an inductor, transformers, crystals, resonators, and temperature-controlled oscillators require different packages often larger than the standard packages. It is very unlikely that these packages will be standardized because of their unique nature. However, the package must be chosen in a way to make pick and place possible. These capacitors can be found here. Transistor & diode packages SMD transistors and diodes have the same package type. Transistors have three pins while a diode has two pins. The third pin is added to the diode package to keep the orientation right. Diodes are packages that come in different varieties. Some packages follow the standards of capacitors and resistors that we discussed above. Some of the most common diode and transistor packages are SOT-23 - Small Outline Transistor: It is the most common diode and transistor package. It has three pins and measures 3 mm x 1.75 mm x 1.3 mm. It is used for low-power applications.SOT-223 - Small Outline Transistor: This diode package is used for high-power applications. It is bigger than SOT-23. It measures 6.7 mm x 3.7 mm x1.8 mm. It has four pins with which the fourth one is used for heat dissipation. Integrated circuit SMD packages IC packages are found in many packages and can be classified in many different ways. It is very common to hear the terms DIP, SOP, SIP, TSOP, QSOP, MSOP, SOIC, QFP etc. These are the different packages of IC. They can be categorized as. There are three main package types for surface mount integrated circuits: Ball grid array (BGA)Small outline package (SOP)Quad flat pack (QFP) Ball Grid Array Ball Grid Array package has solder balls attached to the underside of the package. Beneath the balls are electrical traces of IC. Ball Grid Array has further the following types. Molded Array Process Ball Grid Array (MAPBGA)Plastic Ball Grid Array (PBGA) Thermally Enhanced Plastic Ball Grid Array (TEPBGA)Tape Ball Grid Array (TBGA)Package on Package MicroBGA. Small Outline Packages Small Outline Package is another IC package in which pins come out from the sides of the IC. The convention used for SOIC or SO package is the name followed by the number of pins used in the package. i.e SO-12 means the IC has 12 pins. Further types of SOP/SOIC are SOJ - Small Out-Line J-Leaded PackageTSOP -Thin Small Outline PackageVSOP -Very Small Outline Package).TSSOP -Thin Shrink Small Outline Package SSOP -Shrink Small Outline PackageQSOP -Quarter-size Small Outline Package Flat Packages Flat IC package have pins arranged on its side in L or J shape. These pins are arranged on the side of the package with the leads coming out. This package further has many subtypes. QFP (Quad Flat Package)TQFP (Thin Quad Flat Package)STQFP (Small Thin Quad Plastic Flat Package)FQFP (Fine-pitch Quad Flat Package),(Low profile Quad Flat Package)VQFP (Very-small Quad Flat Package)ETQFP (Exposed thin quad Flat Package)PQFN (Power Quad Flat Package)PQFP (Plastic Quad Flat Package)QFJ (Quad Flat J-Leaded Package)QFN (Quad Flat Non-Leaded Package)
Allen On 2022-11-29
Keypads are input devices that are being widely used in many embedded system projects. It can be found in appliances, door locks, and industrial machines. Keypads are used to take input from the user in the form of numbers or characters which can further be used for processing such as password, menu selection and navigating among different options. One of the most common and low-cost keypads is the matrix keypad with 4×4 or 3×3 buttons. In this article we will discuss how a low cost 4×4 matrix keypad can be used in STM32. Before proceeding further, we will need to know few things.Materials14×4 matrix keypad2STM32 F401How a 4×4 keypad works? 4×4 keypadIn microcontrollers usually a pin is used to take input from the user. This input can be either 1 or 0. Multiple 1’s and 0’s can be combined to store more information. For this purpose, multiple input pins will be required. However, this becomes impractical when the input pins required exceed certain number such as 16 or 9 as the microcontrollers do not have this many pins available.The 4×4 matrix keypad solves this problem and reduced the required number of pins to 8 or 6. It is made of a thin and flexible membrane. The 16 keys of the 4 x 4 keypad module are arranged in a matrix of rows and columns. A copper trace connects each of these switches to the others. The rows and column are not connected to each other in normal condition. When we push a key, a column and a row come into contact with each other. In matrix keypads the buttons are divided among rows and columns. Four buttons lie on each row and each column. Thus, columns are connected to external input pins of microcontroller while the rows are connected to output pins of microcontroller. The output pins are high all the time. When a button is pressed the corresponding column goes high and the microcontroller detects it. Finding which column has been activated is easy as each column is connected to a separate pin, however, finding a row is difficult. Once both row and column are identified then the corresponding button can be identified. A clever method to identify the pressed key is to switch off all output pins except one, and then check which input pins is high. Doing this for all the output pins will identify the row. Once the row number is found out, the button can easily be traced out.matrix keypad in STM32STM32 F401 implementationSTM32 F401In CubeMX the relative microcontroller of our choice is selected which in our case is STM32 F401CDU6. The GPIOs that need to be selected as output or external interrupt input are given in the figure above. In the NVIC tab the interrupt should be enabled. Other necessary settings are given below.RCC → Crystal/Ceramic ResonatorSYS → Debug → Serial WireClock Configuration → HCLK → 84 MHzClock Configuration → PLL Source Mux → HSE Once the CubeMX code is generated the following code should be added to the /* USER CODE BEGIN PV */ section./* USER CODE BEGIN PV */ GPIO_InitTypeDef GPIO_InitStructPrivate = {0}; uint32_t previousM = 0; uint32_t currentM = 0; uint8_t key = 0; uint8_t InputData[5] = {0}; int i = 0;/* USER CODE END PV */This code section defines the necessary variables that will come handy later.In the main.c section in /* USER CODE BEGIN 2 */ the output configured pins should be set to 1. /* USER CODE BEGIN 2 */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); /* USER CODE END 2 */ While the interrupt callback function void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) should be added to /* USER CODE BEGIN 4 */ section.void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){ currentM = HAL_GetTick(); if (currentM - previousM > 10) { /*Configure GPIO pins : PB6 PB7 PB8 PB9 to GPIO_INPUT*/ GPIO_InitStructPrivate.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9; GPIO_InitStructPrivate.Mode = GPIO_MODE_INPUT; GPIO_InitStructPrivate.Pull = GPIO_NOPULL; GPIO_InitStructPrivate.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStructPrivate); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 68; //ASCII value of D } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 67; //ASCII value of C } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 66; //ASCII value of B } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 65; //ASCII value of A } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 35; //ASCII value of # } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 57; //ASCII value of 9 if (i == 4) { //Send Data } else { InputData[i] = 9; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 54; //ASCII value of 6 if (i == 4) { //Send Data } else { InputData[i] = 6; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 51; //ASCII value of 3 if (i == 4) { //Send Data } else { InputData[i] = 3; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 48; //ASCII value of 0 if (i == 4) { //Send Data } else { InputData[i] = 0; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 56; //ASCII value of 8 if (i == 4) { //Send Data } else { InputData[i] = 8; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 53; //ASCII value of 5 if (i == 4) { //Send Data } else { InputData[i] = 5; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 50; //ASCII value of 2 if (i == 4) { //Send Data } else { InputData[i] = 2; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 42; //ASCII value of * } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 55; //ASCII value of 7 if (i == 4) { //Send Data } else { InputData[i] = 7; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 52; //ASCII value of 4 if (i == 4) { //Send Data } else { InputData[i] = 4; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 49; //ASCII value of 1 if (i == 4) { //Send Data } else { InputData[i] = 1; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); /*Configure GPIO pins : PB6 PB7 PB8 PB9 back to EXTI*/ GPIO_InitStructPrivate.Mode = GPIO_MODE_IT_RISING; GPIO_InitStructPrivate.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOB, &GPIO_InitStructPrivate); previousM = currentM; }} In the callback function the two linescurrentM = HAL_GetTick(); if (currentM - previousM > 10)takes care of the debouncing of the buttons. In keypad it is a common problem that a but hits once is recorded twice or thrice. So, take of that, a little delay is added at the beginning of callback function.The complete code is given below.#include "main.h" /* USER CODE BEGIN PV */ GPIO_InitTypeDef GPIO_InitStructPrivate = {0}; uint32_t previousM = 0; uint32_t currentM = 0; uint8_t key = 0; uint8_t InputData[5] = {0}; int i = 0;/* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/void SystemClock_Config(void);static void MX_GPIO_Init(void);/* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*//* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); /* USER CODE BEGIN 2 */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */} /* USER CODE BEGIN 4 */void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){ currentM = HAL_GetTick(); if (currentM - previousM > 10) { /*Configure GPIO pins : PB6 PB7 PB8 PB9 to GPIO_INPUT*/ GPIO_InitStructPrivate.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9; GPIO_InitStructPrivate.Mode = GPIO_MODE_INPUT; GPIO_InitStructPrivate.Pull = GPIO_NOPULL; GPIO_InitStructPrivate.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStructPrivate); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 68; //ASCII value of D } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 67; //ASCII value of C } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 66; //ASCII value of B } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 65; //ASCII value of A } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 35; //ASCII value of # } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 57; //ASCII value of 9 if (i == 4) { //Send Data } else { InputData[i] = 9; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 54; //ASCII value of 6 if (i == 4) { //Send Data } else { InputData[i] = 6; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 51; //ASCII value of 3 if (i == 4) { //Send Data } else { InputData[i] = 3; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 0); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 48; //ASCII value of 0 if (i == 4) { //Send Data } else { InputData[i] = 0; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 56; //ASCII value of 8 if (i == 4) { //Send Data } else { InputData[i] = 8; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 53; //ASCII value of 5 if (i == 4) { //Send Data } else { InputData[i] = 5; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 50; //ASCII value of 2 if (i == 4) { //Send Data } else { InputData[i] = 2; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); if(GPIO_Pin == GPIO_PIN_6 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_6)) { key = 42; //ASCII value of * } else if(GPIO_Pin == GPIO_PIN_7 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_7)) { key = 55; //ASCII value of 7 if (i == 4) { //Send Data } else { InputData[i] = 7; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_8 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_8)) { key = 52; //ASCII value of 4 if (i == 4) { //Send Data } else { InputData[i] = 4; } if(i <= 4) { i = i + 1; } else { i = 0; } } else if(GPIO_Pin == GPIO_PIN_9 && HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_9)) { key = 49; //ASCII value of 1 if (i == 4) { //Send Data } else { InputData[i] = 1; } if(i <= 4) { i = i + 1; } else { i = 0; } } HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, 1); /*Configure GPIO pins : PB6 PB7 PB8 PB9 back to EXTI*/ GPIO_InitStructPrivate.Mode = GPIO_MODE_IT_RISING; GPIO_InitStructPrivate.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOB, &GPIO_InitStructPrivate); previousM = currentM; }}
Allen On 2022-10-17
Introduction Everyone is familiar with Cameras. Owning a mobile phone is equivalent to owning a smart camera device that is very portable. So what does the camera use to image? And how do you get a clear picture of the object? Here we take you to understand the secrets hidden in the camera. Figure 1. Camera Image Processing Catalog Introduction Ⅰ Photomultiplier Tube (PMT) Ⅱ Charge-coupled Device (CCD) 2.1 CCD Terminology 2.2 CCD Chips 2.3 CCD Types Ⅲ Complementary Metal Oxide Semiconductor (CMOS) 3.1 CMOS Invention 3.2 CCD vs CMOS Ⅳ Imaging System 4.1 Key Elements 4.2 Calculation of Image/Video Data Volume 4.3 Storage Space Calculation 4.4 Camera Composition and Principle 4.5 Intelligent Camera Image Processing Hardware Ⅴ Smart Camera Interfaces and Communication Protocols Ⅵ Image Signal Processor (ISP) Ⅶ FAQ Ⅰ Photomultiplier Tube (PMT) PMT is the earliest image sensor, which is very mature, and it is the sensor with the best performance at present. A photomultiplier tube, useful for light detection of very weak signals, is a photoemissive device in which the absorption of a photon results in the emission of an electron. Because it has multiple electrodes built-in to convert incoming light signals into electrical signals, and even very weak light can be accurately captured. Its highest dynamic range can reach 4.2, compared with other types of sensors that can only reach 3.2~3.6. And it can operate for more than 100,000 hours. However, due to its high cost, it can only be used in professional printing, publishing industry scanners and engineering analysis. Figure 2. Photomultiplier Tube (PMT) Ⅱ Charge-coupled Device (CCD) 2.1 CCD Terminology CCD was invented by Bell Labs in the United States in 1969. It is similar to computer chip CMOS and can also be used for computer memory and logic operation chips. CCD is a special semiconductor material composed of a large number of independent photodiodes, which are generally arranged in a matrix form (except Fuji's Super CCD). The photosensitive ability of CCD is lower than that of PMT, but in recent years, CCD technology has made great progress, and because of its small size and low cost, it is widely used in scanners, digital cameras and digital video cameras. The image sensors used in most digital cameras today are CCDs.Early CCDs were interlaced (Interline Transfer), which increased the shutter speed, but the image accuracy was greatly reduced. New CCDs are generally progressive scan (FullFrame Transfer). Figure 3. Charge-coupled Device Semiconductor 2.2 CCD Chips It integrates a light-sensitive device on a single piece of semiconductor: a photodiode and some circuits. Each unit is arranged in a neat matrix, CCD pixel = number of rows multiplied by the number of columns. About 30% of each pixel cell is used to make photodiodes, and in the remaining available area, a transfer register is placed. After receiving a command, the light intensity sensed by the photodiode is placed in this transfer register and temporarily stored here, which is an analog signal. The next step is to convert the light intensity value in each pixel into a digital signal, which is then combined into a digital image by the processor in the camera.Since in each pixel unit, only about 30% of the area is actually used for light-sensing, its light-sensing efficiency is relatively low. So in the real finished product, a small optical lens will be placed on top of each pixel unit, which we call "microlens". In terms of structure, it is directly placed above the photodiode, and its area is relatively large, so that more incident light can be concentrated on the photodiode. Therefore, the equivalent photosensitive area reaches about 70% of the pixel area. 2.3 CCD Types Primary color CCD and complementary color CCD: In fact, the CCD itself cannot distinguish colors. Therefore, color filters are required in practical applications. Generally, the filter layer of the CCD device is coated with different colors. The different color blocks on the filter are arranged like a mosaic in the order of G-R-G-B (green-red-green-blue), so that the pixels under each mosaic can sense different colors. Figure 4. Color Filter Array Sensor For example, a 1.3-megapixel CCD has 325,000 pixels sense red, 325,000 pixels sense blue, and 650,000 pixels sense green. In a digital camera with a resolution of 1280x1024 using this CCD, there are 640x512 red pixels, 640x512 blue pixels and 640x1024 green pixels, having more green pixels due to the human eye's sensitivity to green and other color is not the same. Finally, when the image is recorded, the true color of each pixel is the average of its blending with the surrounding pixel image. At present, most digital cameras use this kind of CCD.Linear CCD, different from matrix CCD, may be arranged in a linear arrangement of photosensitive elements, so it is a strip, like barcode scanners. Ⅲ Complementary Metal Oxide Semiconductor (CMOS) 3.1 CMOS Invention CMOS was not used to make image sensors until 1998. The advantage of CMOS is that the structure is simpler than that of CCD, the power consumption is only about 1/3 of that of ordinary CCD, and the manufacturing cost is lower than that of CCD. Since Canon adopted CMOS in the professional digital SLR camera EOS D30, more and more digital SLR cameras have used it, and almost half of the digital SLR cameras now use CMOS as the image sensor. Figure 5. Complementary Metal Oxide Semiconductor (CMOS) 3.2 CCD vs CMOS CCD and CMOS sensors are different in "internal structure" and "external structure". The imaging points of the CCD device are arranged in an XY vertical and horizontal matrix, and each imaging point consists of a photodiode and a charge storage area controlled by it. Where the CCD can only output analog electrical signals, which need to be decoded by subsequent addresses. Further more, it also needs to provide three-phase power supply and synchronous clock control circuit with different voltages.CMOS devices have high integration, small size and light weight. Its biggest advantage is that it has a high degree of system integration. Because of the digital-analog signal mixed design, in theory, all functions required by image sensors, such as vertical displacement, horizontal displacement register, sensor array drive and control system (CDS), analog-to-digital converter (ADC) interface circuit, etc. can be fully integrated to achieve single-chip imaging, avoid the use of external chips and equipment, and greatly reduce the size and weight of the device.The charge information stored by the CCD needs to be read after being transferred bit by bit under the control of the synchronization signal. The charge information transfer and read output need to be coordinated by a clock control circuit and three sets of different power supplies. slower. The CMOS photoelectric sensor directly generates a voltage signal after photoelectric conversion, the signal reading is very simple, and it can also process the image information of each unit at the same time, which is much faster than CCD.From the perspective of power consumption and compatibility, CCD requires external control signals and clock signals to obtain satisfactory charge transfer efficiency, and also requires multiple power supplies and voltage regulators, so the power consumption is large. While CMOS-APS uses a single operating voltage, with low power consumption (only equivalent to 1/10-1/100 of CCD) and good compatibility, can also be compatible with other circuits.CCD sensors require special processes, use special production processes, and have high costs; while CMOS sensors use 90% of the same basic technologies and processes as semiconductor devices, and have high yield and low manufacturing costs. Currently, 500,000-pixel CMOS sensors are used for cameras.CCDs use charge shift registers, and when the register overflows, it leaks charge into adjacent pixels, causing the bright light to spread out and create unwanted streaks in the image. In CMOS-APS, the photodetector and the output amplifier are both part of each pixel. The integrated charge is converted into a voltage signal in the pixel and output through the XY output line. This row-column addressing method makes the window operation possible. You can also perform on-film translation, rotation and zooming, without smear, halo and other false signals, to get high image quality.High speed is an inherent characteristic of CMOS circuits. CMOS image sensors can drive the column bus of the imaging array extremely fast, and the ADC operates at an extremely fast rate on-chip, and has low sensitivity to output signals and external interface interference, which is beneficial to next level processor connection. CMOS image sensors are highly flexible and can perform random access to local pixel images, increasing flexibility. Camera Image Sensors as Fast As Possible Ⅳ Imaging System 4.1 Key Elements 1) Field of View: The portion of an object that can be seen on a display.2) Depth of Field: The difference between the nearest and farthest distances at which an imaging system can remain in focus.3) Working Distance: When observing an object, the distance from the vertex of the last lens to the observed object.4) Distortion: The optical error caused by the lens makes the magnification of each point on the image surface different.5) Parallax: It is caused by the traditional lens, the change of each point on the object outside the best focus point, the telecentric lens can solve this problem.6) Image Sensor Size: The effective working area of the image sensor (usually CCD or CMOS), generally refers to the horizontal size. This parameter is important in determining the pre-magnification factor (PMAG) for the desired field of view. Most image sensors have a length to width ratio of 4:3.7) Pre-magnification: It refers to the ratio of the field of view to the size of the image sensor, which is done by the lens.8) System Magnification: It refers to the ratio of the image on the display to the actual size of the object, that is, the magnification of the entire system. It can also be written as the product of pre-magnification and electronic magnification, which is the ratio of display size to image sensor size.9) Resolution: The distance between two points on an object that can be minimally distinguished, indicating the ability to distinguish details. 4.2 Calculation of Image/Video Data Volume Definition of picture resolution in different camera pixels (number of photosensitive elements of CCD/CMOS sensor):FCIF (Full Common Intermediate Format) Resolution: 352*288=100,000 pixels DCIF Resolution: 512*384=200,000 pixelsD1(4CIF) Resolution: 704*576=400,000 pixels720P Resolution: 1280*720=1 million pixels1080P Resolution: 1920*1080=2 million pixels Figure 6. Camera Pixel Art The computer's true color pixels are stored according to the RGB three-color principle, and each color of red, green and blue is 256 (2 to the 8th power, one byte length), so a pixel needs 3 bytes and 24 bits. Now that the calculation capacity is large, a 256 grayscale is added on the basis of RGB storage, so 4 bytes are needed, that is, 32 bits. In addition, such pixels are now also called true color.Bit rate refers to the number of bits transmitted per second. The unit is bps (bit Per second). The higher the bit rate, the larger the data transmitted. The bit rate indicates how many bits per second the encoded (compressed) audio and video data needs to be represented, and a bit is the smallest unit in binary, either 0 or The relationship between bit rate and audio and video compression is simply that the higher the bit rate, the better the quality of audio and video, but the larger the encoded file. If the bit rate is lower, the situation is just the opposite.DataRate refers to the data flow used by video files in unit time, also called bit rate, which is the most important part of picture quality control in video coding. Under the same resolution, the larger the code stream of the video file, the smaller the compression ratio and the higher the image quality.1) 720P single image data volume = 1280 × 720 × 24/8/1024 = 2700 KByte.2) The amount of data of the moving image3) H.264 compressed payload data volumeThe biggest advantage of H.264 is that it has a high data compression ratio. Under the same image quality, the compression ratio of H.264 is more than 2 times that of MPEG-2, and 1.5 to 2 times that of MPEG-4. For example, the original file is 88GB, 3.5GB after MPEG-2 compression, the compression ratio is 25:1, and the H.264 compression is 1.1GB, from 88GB to 1.1GB, the compression ratio of H.264 reaches 80:1. For example, in the video conference, the original code stream is encoded and compressed by adopting H.264.4) The amount of transmitted data compressed by H.264Adding network overhead, the amount of data transmitted = the amount of payload data * 1.3At 20%, the amount of data transmitted after compression = 1.6 * 1.3 = 2.08 Mbit/s5) Home monitoring storage capacityBandwidth Calculation:The required bandwidth of the CIF video format: 512Kbps (the bit rate of the video format) × 50 (the total number of cameras at the monitoring point)=25Mbps (downlink bandwidth). That is: the network downlink bandwidth required by the monitoring center using CIF video format is at least 25Mbps.The required bandwidth of the D1 video format: 1.5Mbps (bit rate of the video format) × 50 (the total number of cameras in the monitoring point) = 75Mbps (downlink bandwidth). That is: the network downlink required by the monitoring center using D1 video format bandwidth is at least 75Mbps.The required bandwidth of 720P (1 million pixels) video format: 2Mbps (bit rate of video format) × 50 (the sum of the total number of cameras at the monitoring point) = 100Mbps (downlink bandwidth). That is: adopting 720P video format monitoring, the network downlink bandwidth required by the center is at least 100Mbps.The required bandwidth of the 1080P (2 million pixel) video format: 4Mbps (bit rate of the video format) × 50 (the total number of cameras at the monitoring point) = 200Mbps (downlink bandwidth) That is: adopting 1080P video format monitoring, the network downlink bandwidth required by the center is at least 200Mbps. 4.3 Storage Space Calculation Stream size (unit: KB/s; namely: bit rate ÷ 8) × 3600 (unit: second; seconds in 1 hour) × 24 (unit: hour; length of one day) × 30 (days saved) × 50 (the total number of camera recordings to be saved at the monitoring point) ÷ 0.9 (10% space loss from disk formatting) = the size of the required storage space (Note: unit conversion 1TB=1024GB, 1GB=1024MB, 1MB=1024KB)The required storage space for 50 channels to store 30 days of CIF video format video information is: 64 × 3600 × 24 × 30 × 50 ÷ 0.9=8789.1GB ≈ 9TBThe required storage space for 50 channels to store 30 days of D1 video format video information is: 192 × 3600 × 24 × 30 × 50 ÷ 0.9=26367.2GB ≈ 26TBThe required storage space for 50 channels of 720P (1 million pixels) video format recording information for 30 days is: 256 × 3600 × 24 × 30 × 50 ÷ 0.9=34.33GB ≈ 35TBThe required storage space for 50 channels of 1080P (2 million pixels) video format video recording information that can be stored for 30 days is: 512 × 3600 × 24 × 30 × 50 ÷ 0.9=68.66GB ≈ 69TB 4.4 Camera Composition and Principle The working principle of the camera is to project the optical signal obtained by the optical component onto the image sensor, complete the conversion from the optical signal to the electrical signal, and then convert it into a digital image signal, and finally perform the algorithm processing of the signal. The main components of the camera are optical components lens, CMOS sensor, DSP, module assembly and other components. 4.5 Intelligent Camera Image Processing Hardware Image processing capability: FPGA<DSP<High-end CPUASICs are ideal for performance and power consumption. Develop a dedicated SoC (system on chip) for a given application, implement a custom architecture to accommodate data flow, and optimize power consumption. However, the development cost is high and it is suitable for consumer products (i.e. production volumes of thousands of units). ASIC devices have very little or zero flexibility and programmability due to their specificity.FPGAs are the best choice for low- or medium-volume high-performance applications. They are very flexible and can meet the requirements of almost any application. Due to the ever-increasing number of available logic elements per device in FPGAs, increasing clock frequencies, and the possibility to exploit massive parallelism, it is possible to achieve processing performance close to ASICs, with the advantage of being fully reconfigurable. However, the power consumption of FPGAs is relatively high, and even if design methodologies and development environments exist, FPGA-based solutions require more development time and expertise than CPU-based solutions (DSP, microcontroller, etc.).DSP devices and media processors share many characteristics with embedded general-purpose RISC processors (PowerPC, ARM, etc.) and microcontrollers. All these devices are CPU based, i.e. based on processor cores. Therefore, they all have excellent programmability, using programming tools such as C/C++ and dedicated development environments. NRE (non-recurring engineering) is very low cost and has good flexibility, so it is suitable for most applications.The main difference between CPU-based devices comes at the performance level. A microcontroller can be seen as an enhanced RISC processor by adding CPU core memory (RAM, ROM, Flash), peripherals and I/O interfaces (ADC, DAC, etc.). In addition, the DSP core provides a dedicated architecture and some specific hardware structures to optimize the execution of arithmetic operations, such as MAC (multiply-accumulate) and SIMD units. Finally, media processors are a class of DSP devices dedicated to audio and video processing, suitable for processing data streams. DSPs and media processors may have a VLIW (Very Long Instruction Word) architecture, such as NXP TriMedia processors. Figure 7. Camera Color Coding Ⅴ Smart Camera Interfaces and Communication Protocols Wired Interface and Wireless Interface Table 1. Most Common Wired Communication Protocols Protocol Theoretical Bandwidth in bits per second (bit/s) RS-232 serial link USB 1.x Full-speed USB 2.0 Hi-speed FireWire or IEEE 1394a/b Camera Link Ethernet, Fast Ethernet GigE Vision (Gigabit Ethernet) 19,200 bit/s 12 Mbit/s 480 Mbit/s 400/800 Mbit/s 2.04, 4.08, or 5.44 Gbits 10/100 Mbit/s 1 Gbit/s Table 2. Most Common Wireless Protocols Protocol Theoretical Bandwidth (bit/s) Wireless Range (m) WiFi IEEE 802.11a WiFi IEEE 802.11b WiFi IEEE 802.11g Bluetooth ZigBee (IEEE 802.15.4) 54 Mbit/s 11 Mbit/s 54 Mbit/s 1 Mbit/s 250 Kbit/s Up to 10m ~50m indoor, ~200m outdoor ~27m indoor, ~75m outdoor ~10-100m ~10-100m indoor, up to 150m outdoor For example, if the camera is equipped with the MT9M413 image sensor from Aptina Imaging (formerly Micron Imaging), capable of delivering images up to 660M pixels/s, a camera interface is required to take full advantage of the sensor (5.44 Gbit/s (680 M Bytes/s in full configuration) ). However, if there are other constraints, the rules of keeping data rates compatible between sensors and communication interfaces may be broken. For example, with a battery-operated smart camera, even real-time video transmission with a bandwidth of 250 Kbit/s makes no sense. There are two workarounds:1) Wireless ZigBee protocol, because its power consumption is very low.2) Another solution to reduce bandwidth requirements is an image compression algorithm. However, compressing and decompressing images places additional processing burden on the camera and host, and can result in loss of picture quality, depending on the desired compression ratio.And bandwidth isn't the only deciding factor. For example, GigE Vision systems are inexpensive to implement, but the end result can hinder application responsiveness and development time. GigE Vision is still in its infancy, while Camera Link and IEEE 1394 have proven. The integrity of the standard must also be considered. GigE Vision and IEEE 1394 cameras are compatible between vendors and are easier to configure than Camera Link. Ⅵ Image Signal Processor (ISP) It is widely used in mobile phone cameras and car cameras and other fields, and is the core chip of image signal processor.ISP pipeline process: The light passes through the lens, after lens correction and color correction, is projected onto the sensor, photoelectrically converted into an analog electrical signal, and then converted into a digital signal by A/D, and then handed over to the ISP chip for processing. Then, the obtained image of the bayer pattern goes through BLC (black level compensation), lens shading (lens shading correction), BPC (bad pixel correction), CIP (demosaic), DNS (denoise), AWB (automatic white balance), color correction gamma correction, color space conversion (RGB conversion YUV), and then output data in YUV (or RGB) format, and finally transmitted to the CPU for processing through the I/O interface.The functions of each module are briefly described as follows:1) Bayer PatternThe filters that cover the surface of the image sensor are usually called Color Filter Arrays (CFA). At present, the most commonly used filter array is in checkerboard format, and the primary color Bayer Pattern CFA RGB represents the filter array unit of red, green and blue. Since human vision is most sensitive to green, the G component in Bayer CFA is twice that of R and B, and only one color component information can be obtained on each pixel, and then an interpolation algorithm is passed according to the color component information, finally get a full color image.2) Black Level Correction (BLC)Physical devices cannot be ideal. Due to impurities, heat and other reasons, even if no light is irradiated to the pixel, the pixel unit will generate charges, and these charges generate dark current. Moreover, dark current is difficult to distinguish from the charge generated by light. Black Level is used to define the signal level corresponding to 0 for image data. An effective way to reduce the influence of dark current on the image signal is to subtract the reference dark current signal from the obtained image signal. Generally, in the sensor, the first few lines of the pixel area are used as the non-photosensitive area. This part of the area is also used for RGB color filter. The average value is used as the correction value for automatic black level correction, and then the pixels in the following area are subtracted from this. Pay attention to, the brightness of the picture is reduced after black level correction.3) Lens Shading Correction (LSC)Due to the physical properties of the lens itself, the brightness around the image gradually decreases relative to the center brightness. When the image light shines on the pixel through the lens, the focus angle at the corners is greater than the center focus angle, resulting in loss of light at the corners. In order to compensate for the surrounding brightness, Lens Shading correction is necessary. The method is to calculate the brightness correction value corresponding to each pixel according to the algorithm, so as to compensate the brightness of the surrounding attenuation.4) Bad Pixel Correction (BPC)Under normal circumstances, the RGB signal should have a linear response relationship with the brightness of the scene. However, due to the bad pixels of senor, the output signal is abnormal, and there are dead spots: white spots in the output image in a dark environment, and black spots in the output image in a bright environment. There are usually two methods of repairing dead pixels: one is to automatically detect and repair the dead pixels, and the other is to establish a linked list of dead pixels to repair bad pixels at fixed positions. This method is the OTP method. 5) DNSUsing CMOS sensor to acquire images, light level and sensor issues are the main factors that generate a lot of noise in the image. At the same time, when the signal passes through the ADC, some other noise is introduced. These noises will blur the image as a whole and lose a lot of details, so the image needs to be denoised. The traditional methods of spatial denoising include mean filtering, Gaussian filtering and so on. However, the general Gaussian filter mainly considers the spatial distance relationship between pixels when sampling, and does not consider the similarity between pixel values, so the blurring result obtained in this way is usually a blur of the entire picture. Therefore, a nonlinear denoising algorithm, such as bilateral filter, is generally used, which not only considers the relationship between pixels in spatial distance, but also considers the similarity between pixels, so that the general segmentation of the original image can be maintained to keep the edge. In practical applications, wavelet denoising is more suitable, and each segment in the entire pipeline will be more or less applied to DNS, which is particularly important in the entire process of ISP, and exists in almost every part of it.6) Color InterpolationWhen the light passes through the Bayer-type CFA array, the light hits the sensor, and the BGR data is obtained respectively. Here, the data sampling ratio of BGR is 1:2:1, because the human eye is more sensitive to green light (550nm). Among them, G is also called luminance information, and BR is chrominance information. It can be seen that in the above Bayer diagram, each pixel has only one of the BGR data, so it is necessary to use CIP interpolation to supplement the color information of the other two channels to form a normal full-color image.7) Automatic White Balance (AWB) The basic principle of automatic white balance is to restore white objects to white objects in any environment, that is, by finding white blocks in the image, and then adjusting the ratio of R/G/B.The AWB algorithm usually steps as follows:Color temperature statistics, according to the image statistics color temperature.Calculate channel gain: Calculate the gain of R and B channels.Correction of color cast: Calculate the correction of color cast according to the given gain. Grayscale world method and perfect reflection method are more commonly used and effective.8) Gamma CorrectionThe sensitivity value of the human eye to the external light source is not linearly related to the input light intensity, but is exponentially related. Under low illumination, it is easier for the human eye to distinguish the change of brightness. With the increase of illumination, it is difficult for the human eye to distinguish the change of brightness. However, there is a linear relationship between the light sensitivity of the camera and the input light intensity. In order to help the human eye to recognize the image, the image collected by the camera needs to have Gamma correction. It is a nonlinear operation on the gray value of the input image, so that the gray value of the output image has an exponential relationship with the gray value of the input image.9) Color CorrectionDue to the difference between the spectral responsivity of the visible light of the human eye and the spectral responsivity of the semiconductor sensor, as well as the influence of lenses, etc., the color of the obtained RGB value will be biased, so the color must be corrected. The usual method is to pass a 3x3 Color change matrix for color correction.10) RGB Conversion YUV Color Space ConversionYUV is a basic color space, and the human eye is much more sensitive to changes in brightness than changes in color. Therefore, for the human eye, the brightness component Y is much more important than the chrominance components U and V. Therefore, some U and V components can be appropriately discarded to achieve the purpose of compressing data.Laplacian operator: YCbCr is actually a scaled and offset modified version of YUV, Y represents the brightness, Cr and Cb represent the color difference, which are the red and blue components respectively. In the YUV family, YCbCr is the most widely used member in computer systems, and its application fields are very wide. For example, JPEG and MPEG both use this format. Generally speaking, YUV mostly refers to YCbCr.The color space conversion module converts RGB to YUV444, and then performs subsequent color noise removal, edge enhancement, etc. on the YUV color space, which also provides convenience for subsequent output conversion to JPEG images. Ⅶ FAQ 1. Does photomultiplier tube PMT scan images?Photomultiplier tubes (PMTs), also known as photomultipliers, are remarkable devices. While a PMT was the first device to detect light at the single-photon level, invented more than 80 years ago, they are widely used to this day, particularly in biological and medical applications. 2. Why are photomultiplier tubes so sensitive?Photomultipliers (sometimes called photon multipliers) are a type of photoemissive detectors which have a very high sensitivity due to an avalanche multiplication process, and also exhibit a high detection bandwidth. 3. What does CCD stand for in cameras?CCD stands for "charge coupled device", a semiconductor image sensor used in digital cameras to convert light into electrical signals. In place of the film used in conventional film cameras, digital cameras incorporate an electronic component known as an image sensor. 4. What are CCD sensors used for?CCDs are used in optical microscopes because they can possess over 10 million pixels, which enables many samples to be seen clearly, as well as a low noise ratio, ability to image in color, high sensitivity and a high spatial resolution which all contribute to the high-quality images that are necessary for modern-day. 5. What is good camera pixels?A decent 6-megapixel camera is good enough for most normal camera usage. Go for higher megapixels only if you wish to use your images for canvas-sized prints or large hoardings. If your interest is in night sky photography, then too a higher megapixel camera can be important. 6. What is resolution in camera settings?A picture's resolution describes how many pixels, or dots, are in the image. The more dots, the better the image looks and prints. Megapixel is a measurement of the amount of information stored in an image. 7. What is a good camera resolution?A Camera Resolution Reference Chart Resolution Avg. Quality Best Quality 0.5 megapixels 2x3 in. NA 3 megapixels 5x7 in. 4x6 in. 5 megapixels 6x8 in. 5x7 in. 8 megapixels 8x10 in. 6x8 in. 8. What is H264 format?H. 264 is a well-known video compression standard for high-definition digital video. Also known as MPEG-4 Part 10 or Advanced Video Coding (MPEG-4 AVC), H. 264 is defined as a block-oriented, compensation-based video compression standard that defines multiple profiles (tools) and levels (max bitrates and resolutions). 9. Which is better H 264 or H 265?265 codec compresses information more efficiently than H. 264, resulting in files of comparable video quality that are about half the size. The benefits of this are twofold: H. 265 video files don't take up as much storage space, and they require less bandwidth to stream. 10. What is a camera chip?Able to leap photographic obstacles with a single computer chip. It's a camera. It's a chip. It's a camera-on-a-chip. ... Most of today's digital cameras use charge-coupled device (CCD) sensors rather than the far less expensive complementary metal-oxide semiconductor (CMOS) chips used in most computing technologies. 11. Is CCD better than CMOS?For many years, the charge-coupled device (CCD) has been the best imaging sensor scientists could choose for their microscopes. ... CMOS sensors are faster than their CCD counterparts, which allows for higher video frame rates. CMOS imagers provide higher dynamic range and require less current and voltage to operate. 12. What is camera image sensor?The image sensor of the camera is responsible for converting the light and color spectrum into electrical signals for the camera to convert into zeroes and ones. All commercially available digital cameras (still, movie, or security) use one of two possible technologies for the camera's image sensor: CCD or CMOS. 13. How do photomultiplier tubes detect light?The reflection mode photocathode is mainly used for the side-on photomultiplier tubes which receive light through the side of the glass bulb, while the transmission mode photocathode is used for the head-on photomultiplier tubes which detect the input light through the end of a cylindrical bulb. 14. Which interface is used for camera?The most common USB 3.1 connector used in the machine vision camera industry is the USB 3.1 Micro B connector. Gradually being introduced to the market is USB-C (USB Type C), the connection type designed for the future. 15. Which of the serial communication standard is used in digital camera?Camera LinkCamera Link is a serial communication protocol standard designed for camera interface applications based on the National Semiconductor interface Channel-link. It was designed for the purpose of standardizing scientific and industrial video products including cameras, cables and frame grabbers. 16. What does image signal processor do?As the name implies, the Image Signal Processor (ISP) is used for processing images in embedded vision camera systems. The ISP also performs other operations on the captured image such as demosaicing, denoising, and auto functions that help deliver an enhanced image. 17. What is image and signal processing?The field of signal and image processing encompasses the theory and practice of algorithms and hardware that convert signals produced by artificial or natural means into a form useful for a specific purpose. ... Image processing work is in restoration, compression, quality evaluation, computer vision, and medical imaging. 18. Where are DSP processors used?DSP is used primarily in areas of the audio signal, speech processing, RADAR, seismology, audio, SONAR, voice recognition, and some financial signals. For example, Digital Signal Processing is used for speech compression for mobile phones, as well as speech transmission for mobile phones. 19. What is RGB conversion?RGB to hex conversionConvert the red, green and blue color values from decimal to hex. Concatenate the 3 hex values of the red, green and blue togather: RRGGBB. 20. What is AWB setting?One of the white balance settings, "Auto White Balance" (AWB) automatically adjusts to correct the changes in color under different light sources. The function adjusting the color tone so that white objects look white in the picture is called white balance (WB).
Ivy On 2022-02-18
Ⅰ Introduction What exactly is a microprocessor? As our lives are becoming increasingly tech-centric and thus tech-dependent, we have to examine this critical component closely. After all, microprocessors are built into computers, laptops, and smartphones, as well as smart home devices, gaming consoles, and self-driving cars. Microprocessors are what allow these devices to function. In this blog, we will discuss microprocessor basics and their applications across industries. Catalog Ⅰ Introduction Ⅱ What is a Microprocessor? Ⅲ Microprocessor Related Video: Ⅳ Features of Microprocessor Ⅴ Evolution of Microprocessors Ⅵ Microprocessor Types Ⅶ Characteristics of CISC and RISC Ⅷ Differences Between CISC and RISC Ⅸ Applications of Microprocessor 9.1 Practical Diagram Examples Ⅹ Microprocessor vs. Integrated Circuit--What’s the Difference? Ⅺ FAQ Ⅱ What is a Microprocessor? A microprocessor is a Central Processing Unit (CPU) built on a single Integrated Circuit (IC) in a computer. A microcomputer is a digital computer with one microprocessor that serves as the CPU. It is a programmable, multipurpose, clock-driven, register-based electronic device that reads binary instructions from memory, accepts binary data as input, processes data according to those instructions, and outputs the results. The microprocessor is composed of millions of tiny components that work together, such as transistors, registers, and diodes. Figure1:Block Diagram of a Microcomputer A microprocessor contains three parts: an ALU , a control unit, and a register array. The ALU performs arithmetic and logical operations on data from an input device or memory. The control unit manages the computer's instructions and data flow. Furthermore, a register array is composed of registers denoted by letters such as B, C, D, E, H, L, and accumulator. Ⅲ Microprocessor Related Video: How to easily use HMC5883L Compass Sensor Microprocessor Video Description: In this video, we will understand the difference between microprocessor and microcontroller. Visually both microprocessor and microcontroller almost look identical but they are different in many aspects. They are different in terms of the application in which they are used, processing power, memory, cost and power consumption. So, in this video, you will understand the difference between microprocessor and microcontroller in all these aspects. Ⅳ Features of Microprocessor Ⅴ Evolution of Microprocessors We can classify microprocessors based on generation or size: First Generation (4 - bit Microprocessors ) Intel Corporation introduced the first generation of microprocessors in 1971-1972. Because it was a 4-bit processor, it was dubbed the Intel 4004 . It was a single-chip processor. It was capable of performing basic arithmetic and logical operations such as addition, subtraction, Boolean OR, and Boolean AND. I had a control unit that could fetch an instruction from storage memory, decode it, and then generate control pulses to execute it. Second Generation (8 - bit Microprocessor) Intel introduced the second generation of microprocessors in 1973. It was the first eight-bit microprocessor capable of performing arithmetic and logic operations on 8-bit words. It was known as the Intel 8008 , and an improved version was known as the Intel 8088 . Third Generation (16 - bit Microprocessor) The third generation microprocessors, introduced in 1978, were Intel's 8086, Zilog Z800, and 80286, which were 16-bit processors with minicomputer-like performance. Fourth Generation (32 - bit Microprocessors ) The 32-bit microprocessor was introduced by several companies, but the most popular is the Intel 80386. Fifth Generation (64 - bit Microprocessors) From 1995 to the present, we have been in the fifth generation. Following 80856, Intel released a new processor, the Pentium processor, followed by the Pentium Pro CPU. which enables multiple CPU s in a single system to achieve multiprocessing. Celeron, Dual, Quad, and Octa-Core processors are also improved, 64-bit processors. Ⅵ Microprocessor Types Microprocessors are classified into three types: CISC (Complex Instruction Set Computer) The instructions are in a complex format, as the name implies. This means that a single instruction can contain several low-level instructions. Loading data from memory, storing data in memory, performing basic operations, and so on. Furthermore, a single instruction can have multiple addressing modes. Furthermore, because there are many operations in a single instruction, they use a small number of registers. Intel 386, Intel 486 , Pentium, Pentium Pro, Pentium II, and other CISC processors are examples. RISC (Reduced Instruction Set Computer) As the name implies, the instructions in this are quite simple, and thus they execute quickly. Furthermore, the instructions are completed in a single clock cycle and only use a few addressing modes. Furthermore, it employs multiple registers, resulting in less interaction with memory. Examples include the IBM RS6000, DEC Alpha 21064, DEC Alpha 21164, and others. EPIC (Explicitly Parallel Instruction Computing) It enables parallel computation of instructions through the use of compilers. Furthermore, the complex instructions operate at lower clock frequencies. It also encodes the instructions in 128-bit bundles. Each bundle contains three instructions encoded in 41 bits each, as well as a five-bit template. This 5-bit template specifies the type of instructions and which instructions can be executed concurrently. Ⅶ Characteristics of CISC and RISC Characteristics of CISC are as follows: Because the instructions are complex, so is the decoding of instructions.The size of instructions is larger than the size of a single word.It is possible for an instruction to take more than one clock cycle to execute.Because most operations are performed in memory, the number of registers is reduced.Address modes are also complicated.There are more data types. Characteristics of RISC are as follows: Because the instruction is simple, so is the decoding of instructions.The size of the instructions is less than one word.It takes one clock cycle to execute an instruction.The number of registers has increased.The address modes are also straightforward.There are fewer data types.It has the potential to be used for pipelining. Ⅷ Differences Between CISC and RISC RISCCISCIt focuses on the software.It focuses on the hardware.Uses the hardwired control unit.It uses a hardwired as well as a microprogrammed control unit.Uses transistors for more registers.Transistors are used for storing the complex instructions.The instructions have a fixed size.The size of instructions vary.It performs only register to register arithmetic operations.Besides the register to register operations, it can also perform register to memory or memory to register operations.Fewer registers are used.It requires more number of registers.As the instructions are individual the code is large.Multiple operations are present in single instruction hence, the code is small.Executes in one clock cycle.Takes more than one clock cycle for execution.Instructions have a size of one word.The size of instructions is greater than the one-word size.Examples are IBM RS6000, DEC Alpha 21064, DEC Alpha 21164, etc.Examples of CISC are Intel 386, Intel 486, Pentium, Pentium Pro, Pentium II, etc. Ⅸ Applications of Microprocessor Household DevicesIndustrial Applications of MicroprocessorsTransportation IndustryComputers and ElectronicsIn MedicalsInstrumentationEntertainmentEmbedded Systems at HomeOffice Automation and PublicationCommunication 9.1 Practical Diagram Examples As stated by the term microprocessor typically refers to a microcomputer's central processing unit (CPU), which contains the arithmetic logic unit (ALU) and control units. Typically, it is implemented on a single LSI chip. This separates the operation's "brains" from the rest of the computer's units. An example of microprocessor architecture The arithmetic logic unit (ALU) and the control unit for a microcomputer are housed in the microprocessor. It is linked to memory and I/O via buses, which transport data between the units. Figure2: microprocessor architecture Microcomputer Example A microprocessor unit (MPU), a clock, and interfaces to memory and external input/output devices are typical components of a microcomputer. The units are linked by buses that transfer data between them. Figure3: Microcomputer Buses: The exchange of information Information is transferred between microcomputer units via buses, which are groups of conductors. Each bit of information to be passed will have one conductor, e.g., 16 lines for a 16-bit address bus. Address, control, and data buses will be present. Figure4: microcomputer units via buses Ⅹ Microprocessor vs. Integrated Circuit--What’s the Difference? Integrated Circuit An integrated circuit is a semiconductor chip component that contains thousands to billions of transistors. It's difficult to imagine how this is possible, but it's not done by shrinking scores of typical 3-legged NPN transistors. An integrated circuit is instead constructed by assembling the basic structure of MOS transistors on a small piece of the silicon wafer. The MOS transistors are connected in such a way that they perform the same function as a larger setup. Microprocessor An integrated circuit is a microprocessor, but not all integrated circuits are microprocessors. The microprocessor, like Professor X, is an intelligent piece of integrated circuits. It serves as the brain of circuits that require computing power. The first microprocessors had thousands of transistors on a silicon wafer, but the number has now reached billions. The AMD Epyc Rome chip, which was released in 2019, contains over 39 billion transistors. A microprocessor, unlike other integrated circuits, serves as a computing brain. It can execute logical and arithmetic instructions that have been programmed into it. A microprocessor is made up of three parts: an arithmetic and logic unit (ALU), a control unit. and a register array. Microprocessor vs. Integrated Circuit in Electronics Design Figure5: Mind the speed when working with a microprocessor. In electronics design, you're likely to work with integrated circuits. Working with a microprocessor can be a herculean task on occasion. It's a mistake to think that designing with a microprocessor is the same as designing with traditional integrated circuits. If you skip a couple of best practices in PCB design, you can still create a successful design if you're working with common ICs like differential transceivers or logic gates. In terms of power supply and speed, these passive ICs are typically quite robust. However, if you make the same mistakes in a design with a microprocessor, you will almost certainly encounter a slew of problems in the prototype. Microprocessors are notoriously power-hungry devices that typically operate at hundreds of Hertz or Gigahertz. It should go without saying that a microprocessor is extremely sensitive to the voltage applied to it. Ripples or a sudden drop in voltage can have a significant impact on the microprocessor's stability. Because the microprocessor communicates with memory via high-speed data buses, EMI is also a concern. High-speed data exchange can be a source of EMI, affecting nearby sensitive components. When designing with a microprocessor, you can't afford to make even the smallest mistake, so using the right PCB design and analysis software is essential. Cadence OrCAD supports high-speed signal simulation to identify problems early in the design process, as well as a plethora of other tools to help you get the job done right the first time. Ⅺ FAQ 1. What is microprocessor in simple terms? A microprocessor is an electronic component that is used by a computer to do its work. It is a central processing unit on a single integrated circuit chip containing millions of very small components including transistors, resistors, and diodes that work together. 2. Are microprocessors used today? One or more microprocessors are used today in everything from the smallest embedded systems and handheld devices to the largest mainframes and supercomputers. 3. Are microprocessors in phones? Smartphones and other mobile devices have multiple microprocessors and microcontrollers. The main processor is a microprocessor with a bus to communicate with memory on separate chips (although often included in the same IC package) and buses to communicate with the rest of the equipment. 4. Do phones have RAM? Android phones have jumped from 4GB to 8GB RAM as standard, and we're now seeing phones with 12GB and 16GB of RAM — but Apple's iPhone has always gotten by with less. 5. How do microprocessors execute instructions? The instructions which are to be executed by microprocessor are first stored in the memory of the processor and then executed. But the processor does not execute the instructions directly. It reads the instruction byte by byte and then executes it. 6. What is microprocessor chips? Microprocessor chips (MPU) are silicon devices that serve as the central processing unit (CPU) in computers. They contain thousands of electronic components and use a collection of machine instructions to perform mathematical operations and move data from one memory location to another.
kynix On 2021-12-29
Join our mailing list!
Be the first to know about new products, special offers, and more.
Feature Posts
How Resistors Work: From Basic Principles to Advanced Applications2025-07-30
DC Switching Regulators: Principles, Selection, and Applications2025-05-30
FPGA vs CPLD: In-depth Analysis of Architecture, Performance and Application2025-05-07
MOSFET Technology: Essential Guide to Working Principles & Applications2025-05-04
SMD Resistor: Types, Applications, and Selection Guide2025-04-30