Saturday, March 20, 2021

How to Protect Your Electronic Product?

 

HF - Ferrite beds - High frequency suppression  - CAN/ RS485/ USB/ Ethernet 



TVS - voltage suppression, CAN/ RS485/ USB/ Ethernet 



Use ESD if the human body can contact your device metal parts 



MOV - Power IN 



Fuses - Power IN 

Self-resetting fuses - Power IN 

Resistors - current limiting for ADC inputs / Digital inputs

Use output current limiting for digital outputs - 

    Current limter resistor + NPN


    Shunt based precision current limiter



I2C Isolators - ADC chips / Sensors / 4-20mA applications



Digital Isolators - Communication, Digital I/O

Optocpoler Isolators - Digital I/O

Voltage clamping zener diodes - Digital I/O, CAN/ RS485/ USB/ Ethernet 



Reverse polarity protection power input- PNP, NPN transistor



Schottky Diodes - low forward bias voltage for battery input connector / USB

Rivers protection for battery input

    Using P channel MOSFET

    Using N channel MOSFET

    Using Schottky diode

    Using controller IC


Isolated transformer-based design for power supply

Use shunt based current  sensing mechanism if needed 

Usee Digital Isolators for Communication  buses- CAN/ RS485/ USB/ Ethernet 

Use relay-based circuits for High inrush current protection

Use earthing techniques 

Use waterproof enclosures 

Use waterproof connectors 

Use heat sink

Use cooling FAN



Friday, March 19, 2021

GPS Overview


What is GPS?

The Global Positioning System (GPS) is a navigation system using satellites, a receiver and algorithms to synchronize location, velocity and time data for air, sea and land travel.

The satellite system consists of a constellation of 24 satellites in six Earth-centered orbital planes, each with four satellites, orbiting at 20,000 km above Earth and traveling at a speed of 14,000 km/h.

While we only need three satellites to produce a location on earth’s surface, a fourth satellite is often used to validate the information from the other three. The fourth satellite also moves us into the third-dimension and allows us to calculate the altitude of a devic
  1. Location — Determining a position.
  2. Navigation — Getting from one location to another.
  3. Tracking — Monitoring object or personal movement.
  4. Mapping — Creating maps of the world.
  5. Timing — Making it possible to take precise time measurement
Some new GPS modules


NMEA Message Structure

$GPGGA,181908.00,3404.7041778,N,07044.3966270,
W,4,13,1.00,495.144,M,29.200,M,0.10,0000*40

All NMEA messages start with the $ character, and each data field is separated by a comma.

  • GP represent that it is a GPS position (GL would denote GLONASS).
  • 181908.00 is the time stamp: UTC time in hours, minutes and seconds.
  • 3404.7041778 is the latitude in the DDMM.MMMMM format. Decimal places are variable.
  • N denotes north latitude.
  • 07044.3966270 is the longitude in the DDDMM.MMMMM format. Decimal places are variable.
  • W denotes west longitude.
  • 4 denotes the Quality Indicator:
    • 1 = Uncorrected coordinate
    • 2 = Differentially correct coordinate (e.g., WAAS, DGPS)
    • 4 = RTK Fix coordinate (centimeter precision)
    • 5 = RTK Float (decimeter precision.
  • 13 denotes number of satellites used in the coordinate.
  • 1.0 denotes the HDOP (horizontal dilution of precision).
  • 495.144 denotes altitude of the antenna.
  • M denotes units of altitude (eg. Meters or Feet)
  • 29.200 denotes the geoidal separation (subtract this from the altitude of the antenna to arrive at the Height Above Ellipsoid (HAE).
  • M denotes the units used by the geoidal separation.
  • 1.0 denotes the age of the correction (if any).
  • 0000 denotes the correction station ID (if any).
  • *40 denotes the checksum.

  • $GPGSA – Detailed GPS DOP and detailed satellite tracking information (eg. individual satellite numbers). $GNGSA for GNSS receivers.
  • $GPGSV – Detailed GPS satellite information such as azimuth and elevation of each satellite being tracked. $GNGSV for GNSS receivers.
  • $GPVTG – Speed over ground and tracking offset.
  • $GPGST – Estimated horizontal and vertical precision. $GNGST for GNSS receivers.

Thursday, March 18, 2021

IOT Gateway Design

 
Top layer - Pushing data to the internet

  • 4G LTE Modules 20Mbps
  • GPRS 56–114 kbps
  • TCP -Ethernet
  • Wifi Fiber
Midlayer - Gathering data
  • Zigbee 250kbps 100m
  • Lora 10-20km 168kbps
  • BLE 0.5Mbps 100m
  • BLUETOOTH 1.5Mbps  10m
  •  WIFI  2.4 GHz 54 Mbps 100m
Low layer -  sensor networks wireless 
  • BLE - mesh
  • LORA -mesh
  • WIFI - mesh
  • RF - tree
  • BLUETOOTH
Low layer - sensor networks wired
  • CAN-BUS 1mbps (10 kbps is 1 km, 1 Mbps is 40 meters)
  • RS485  10 -20Mbps, 1km-9600buad 
  • 4-20mA
  • DI2C - Differential I2C
  • I2C - between PCB cards only (distance less than 1m/ bus capacitance less than 400pF)

Saturday, March 13, 2021

Creating 3D Enclosure for any PCB, 3D Print, or MOLDING

Creating 3D Enclosure for any PCB, 3D Print, or MOLDING 


  • Open step file In the created  project




  • Select perspective view



  • Select PCB surface


  • Select plane view



  • Draw rectangle
  • Then hide PCB 


  • Drag 5mm away from the original rectangle each left and the right sides
  • Select MOVE and click on the edge line drag and type 5mm and press Enter 

  • Create cornners 




  • Select two edges and set 5mm and Enter 
  • Do the same for all 4 corners 


  • View in 3D



  • Make it 1mm bigger
  • Select pull-> double click the edge select all edges, Pull to the outer and set 1mm -> Enter

  • Create the 2nd edge of the box 
  • Press control Move to inner set 1mm and Enter 



  • Now select and delete the middle 




  • Measure the height of the box 
  • Unhide the PCB 

  • Select measure tool
  • Select board surface
  • Press Ctrl the select highest point among all 3D bodies


  • 6.86mm
  • Go for 10mm
  • Hide the PCB again
  • Select Pull 
  • Select  Edge to pull up then set 10mm and Enter
  • This upper part of the box
  • Now do the lower part of the box
  • Unhide PCB 
  • The current Box design is as follows 



  • Again measure tool and measure to the lowest part of the 3D bodies 
  • Select the lower surface of the box


  • Press CTRL
  • Then select the lowest 3D body edge 




  • It is 3.42mm
  • Go for 8mm
  • Select Pull
  • Select  Edge to pull up then set 8mm and Enter



  • Now box looks like this 


  • Now make the cuts for connecters
  • Goto plane view
  • Hide all box parts, leave 3D PCB only 
  • Plane view on connecter side (3D PCB should be able to click)
  • Make two squares around the connectors, make the squire a little bigger than the connecter always 

  • Now pull out of the box surface as shown below

  • Now select the outside surface of the box go to the plane view draws two squares on the outer surface of the box as in the below picture. these squares are drawn on the box surface



  • Now got to the 3D model we have to remove these unwanted surface now

  • Select each unwanted surface and delete (you have to select the surface, not the edge line)
  • Now you can start with creating cuts



  • Delete those unwanted surface, now you have an opening for USB-C and battery connector


  • Now make the top cover and the bottom cover
  • Click the top edge of the box

  • Plane view  draw of square 

  • Goto 3d view 




  • Delete unwanted outer parts


  • Now hide all the surface and leave the lid  
  • Now pull (this creates thickness to the lid) the lid part from the downside 1.5mm into the box
  •  Move into the box a little bit 

  • Do the same for the bottom plate 

  • Now the box is completed 
  • Save as PDF, this will create a 3D PDF, 
  • Also, you can save it as an STL file for 3D printing 
  • STL viewer 





LeetCode C++ Cheat Sheet June

🎯 Core Patterns & Representative Questions 1. Arrays & Hashing Two Sum – hash map → O(n) Contains Duplicate , Product of A...