Showing posts with label electrical engineering. Show all posts
Showing posts with label electrical engineering. Show all posts

Sunday, May 19, 2019

Calculate the length of monopole antenna

We have the formula for wavelength

in which c is the speed of light = 3*10^8 m/s

Practical Example:
A student has a receiver (MX-RM-5V) and a transmitter (FS1000A) in the 433MHz band. When he/she run the basic code sending "hello world", the distance between them is less than 10 cm. In order to increase the transmission distance, what is the length of the antenna should he/she add?

3*10^8 / 433 * 10^6  =  0.6928 meter

so for half-wavelength antenna: 0.5 * 0.6928 = 0.3464 meter
and for quater-wavelength antenna: 0.25 * 0.6928 = 0.1732 meter or 17.32 cm

That is the reason we want to add the carrier frequency to reduce the length of the antenna.

The range is improved significantly after the antennas are inserted



Tuesday, December 19, 2017

Q&A from embedded programming [P1]


  1. What is volatile and when, and why we should use it?
    • volatile is a variable that compiler will not optimize and it can change unexpectedly.  
    • It's used for hardware interaction such as operation in OS/RTOS, hardware register access, interrupts, or multi-core processor. (source: stackoverflow, prof. Ken Arnold at SDSU)
  2. Timing specs:
    • Tphl: propagation delay from high to low
    • Tplh: propagation delay from low to high
    • Tsu: set up time, minimum time before the clock arrive
    • Th: hold time, minimum time after the clock arrive 
    • Tpckq: propagation delay from clock to Q (in flip flop)
  3. What is the UL in preprocessor for example #define FPT 16000000UL
    • UL is unsigned long, we use that expression because 16 000 000 is greater than 2^(bit of microprocessor, 16, 65536). 
      • similar to #define F_CPU ((unsigned long)1200000)
    • so how many bit can UL store? 2^16
  4. I have a pointer and want to assigned it to an absolute address: 0xabcd with a value 12345 how can I implement it?
    1. int *ptr;//declare pointer
    2. ptr =(int*)0xabcd;// cast the address to pointer 
    3. *ptr = 12345;//assign value to pointer
  5. Interrupt: from https://rmbconsulting.us/publications/a-c-test-the-0x10-best-questions-for-would-be-embedded-programmers/
    1. interrupt can't return value
    2. ISR can't be passed by parameter but the interrupt service vector 
    3. ISR should be short, floating point should be avoided.
  6. How can we represent signed number in 8bit - AVR?
    • For example, what is the value of variable of x in hexadecimal?
    • signed int x=-1, -5, 1, 0, 127, 128,
    • Note: remember in AVR we use two's complement for signed number 2^8 = 256 will range from  -128 to 127, and unsigned will range from 0 - 255
      0 --binary--> 0000 0000 --2s_complement--> 0000 0000
      1 --binary--> 0000 0001 --2s_complement--> 1111 1110 + 1 = 1111 1111
      -1 --2s_complement--> 0000 0001 - 1 = 0000 0000 --binary--> 1111 1111
      -5 --2s_complement--> 0000 0101 -1 = 0000 0100 --binary--> 1111 1011
      5 --binary--> 0000 0101 --2s_complement--> 1111 1011
  7. Given var = 0xD6
    1. Question: what is value of ~var in 8 bit? 
      1. Because AVR using little-endian therefore the MSB will be on the right side
        ~(0x00D6) = 0x 00 00 04 09
  8. Difference between EEPROM and Flash?
    1. EEPROM can be erased by single byte because it is stored by electron tunneling
    2. EEPROM - erase single byte/ FLASH - erase block
  9. What is the difference between Dev Board and Eval Board?
    1. Evaluation board is the basic board that you have to connect other peripherals in order to work because it has only basic components such as leds, button
    2. Development board is different, it is full armor board that you can use to write code right away without thinking about buying external peripheral.
  10. Why don't we use voltage divider instead of PWM
    1. http://forum.arduino.cc/index.php?topic=211137.msg1549343#msg1549343
    2. All of the power will be consumed by the resistor

Tuesday, February 14, 2017

EE-340: Chap 1 - Vector Calculus

Question and Answer:


  1. Why midpoint is equal (x+y)/2 not (x-y)/2
    I will answer by a graph

Friday, February 10, 2017

Chapter 8: Building Blocks of integrated-circuit amplifier

REF:
http://aries.ucsd.edu/NAJMABADI/CLASS/ECE102/12-F/NOTES/

http://cc.ee.ntu.edu.tw/~lhlu/eecourses/Electronics2/Electronics_Ch6.pdf

Vocab:
cascading: arrange in a series: xep tang
Intrinsic gain: Avo when Rc reach infinity _ Avo= -gm*ro
Overdrive Voltage: Vov is the voltage passing threshold voltage Vt

Review MOS and BJT:
For BJT, Vbe = 0.7 is a key to find other node voltages and branch currents
For MOS, Id is a key to find the others.

Question and Answer:

  1. When is Vov = Vgs?
  2. Why voltage source for MOS is Vdd and Vcc for BJT?


Thursday, January 19, 2017

Diode

I’m not an organized person but lately I realized that keeping documentation is really important. Especially, when we learn more and we get older. So I decide to write down everything I’ve learned in this blog.
I also try to apply Feynman technique to simplify the concept and engrave more information.

Books: Electronics All-in-One For Dummies by Doug Lowe