About Me Assignments Projects

Week 9 Assignment

OUTPUT DEVICES

This weeks assigmenat was to test output devices using different development boards so i stared with the neo pixel led that attached with my board,and i wanted to build something related to my project i tried to build a mosfet driver that i will used to test a spark generator

Group Assignment Week 9

Sample Image Group Assignment

WS2812

WS2812 is a type of addressable RGB LED (Light Emitting Diode) commonly used in various lighting and display applications. These LEDs are often referred to as NeoPixels, a trademarked name by Adafruit, one of the leading manufacturers of WS2812-based products. The WS2812 LED integrates the LED die, control circuitry, and a communication interface into a single package, making it easy to control individual LEDs or groups of LEDs with a microcontroller or other digital control devices. Each WS2812 LED has a built-in shift register, which allows it to receive data serially and pass on the data to the next LED in the chain. One of the key features of WS2812 LEDs is their ability to be individually addressed, meaning that each LED in a chain can be assigned a unique color and brightness. This makes them ideal for applications such as LED matrix displays, decorative lighting, and wearable electronics. WS2812 LEDs communicate using a simple serial protocol, typically using a single data line to transmit color and brightness information to each LED in the chain. The communication protocol requires precise timing to ensure accurate data transmission, and there are various libraries and software tools available to simplify the process of controlling WS2812 LEDs with microcontrollers

Sample Image Sample Image sws2812 datasheet

WS2812 LIGHTUP

So i used a basic programme to light up and run a animation on the single led

this is the sketch that i used for the WS2812B individual addressable led

    
    #include Adafruit_NeoPixel.h

      // Pin connected to the NeoPixels (WS2812B)
      #define LED_PIN 15
      
      // Number of NeoPixels
      #define LED_COUNT 1
      
      // Create NeoPixel object
      Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
      
      void setup() {
        // Initialize NeoPixel strip
        strip.begin();
        strip.show(); // Initialize all pixels to 'off'
      }
      
      void loop() {
        // Cycle through different colors
        rainbow(20); // Change colors every 20ms
      }
      
      // Function to cycle through rainbow colors
      void rainbow(uint8_t wait) {
        for (uint16_t i = 0; i < 256; i++) {
          uint32_t color = Wheel((i + strip.numPixels()) & 255);
          for (int j = 0; j < strip.numPixels(); j++) {
            strip.setPixelColor(j, color);
          }
          strip.show();
          delay(wait);
        }
      }
      
      // Input a value 0 to 255 to get a color value.
      // The colors are a transition r - g - b - back to r.
      uint32_t Wheel(byte WheelPos) {
        WheelPos = 255 - WheelPos;
        if (WheelPos < 85) {
          return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
        }
        if (WheelPos < 170) {
          WheelPos -= 85;
          return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
        }
        WheelPos -= 170;
        return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
      }
      

  

HOW DOES THE CODE WORK

MOSFET DRIVER

as i was planning to build a mosfet driver as a part of my testing towards my final project i want to build a spark generator

MOSFET

A MOSFET, or Metal-Oxide-Semiconductor Field-Effect Transistor, is a type of transistor used for amplifying or switching electronic signals. It belongs to the family of field-effect transistors (FETs) and is widely used in various electronic circuits due to its high input impedance, fast switching speed, and low power consumption. MOSFETs consist of three terminals: the source (S), the drain (D), and the gate (G). The conductivity between the source and drain terminals is controlled by the voltage applied to the gate terminal. Depending on the type of MOSFET, this control can be accomplished by either applying a voltage (enhancement mode) or removing a voltage (depletion mode) at the gate terminal.

There are two main types of MOSFETs:

N-channel MOSFET (NMOS): In an NMOS transistor, the majority charge carriers (electrons) flow from the source to the drain when a positive voltage is applied to the gate terminal with respect to the source terminal. NMOS transistors are commonly used in digital circuits.

P-channel MOSFET (PMOS): In a PMOS transistor, the majority charge carriers (holes) flow from the drain to the source when a negative voltage is applied to the gate terminal with respect to the source terminal. PMOS transistors are often used in complementary metal-oxide-semiconductor (CMOS) logic circuits.

Sample Image

IMPORTENT SPECIFICATION

BASIC MOSFET CIRCUITRY

Sample Image

N-channel MOSFET Circuit with PWM Control