Serial Communication with Arduino - The details!

Поделиться
HTML-код
  • Опубликовано: 7 июл 2024
  • 🤩 FREE Arduino Crash Course 👇👇
    bit.ly/get_Arduino_skills
    Want to learn more? Check out our courses!
    bit.ly/3B8YW3y
    We designed this circuit board for beginners!
    Kit-On-A-Shield: amzn.to/3lfWClU
    **Get your Free Trial of Altium PCB design Software**
    www.altium.com/yt/programming...
    SHOP OUR FAVORITE STUFF! (affiliate links)
    ---------------------------------------------------
    Arduino UNO R3:
    Amazon: amzn.to/37eP4ra
    Newegg: bit.ly/3fahas8
    Budget Arduino Kits:
    Amazon:amzn.to/3C0VqsH
    Newegg:bit.ly/3j4tISX
    Multimeter Options:
    Amazon: amzn.to/3rRo3E0
    Newegg: bit.ly/3rJoekA
    Helping Hands:
    Amazon: amzn.to/3C8IYXZ
    Newegg: bit.ly/3fb03X1
    Soldering Stations:
    Amazon: amzn.to/2VawmP4
    Newegg: bit.ly/3BZ6oio
    AFFILIATES & REFERRALS
    ---------------------------------------------------
    ►Audible Plus Free trial: amzn.to/3j5IGrV
    ►NordPass: bit.ly/3iZ2IEw
    ►NordVPN: bit.ly/3rJY6Gi
    ►Join Honey- Save Money bit.ly/3xmj7rH
    ►Download Glasswire for Free:bit.ly/3iv1fql
    FOLLOW US ELSEWHERE
    ---------------------------------------------------
    Facebook: / programmingelectronics...
    Twitter: / progelecacademy
    Website: www.programmingelectronics.com/
    Are you wondering what the heck serial communication is?
    Maybe you have been using some functions from the Arduino Serial library, like Serial.begin() and Serial.print()
    and they leave you wondering more about this serial communication thing - I mean, how does it actually work!?
    In this lesson you will learn:
    What is “serial communication”?
    What is a USART anyway?
    The nitty gritty of basic serial communication
    The different roles of start bits, data frames, parity bits, and stop bits
    What the heck baud rate it - and why it is SO crucial
    The (lack of) significance of the baud rate 9600
    DON’T GET SCARED!
    OK - before we start, I want to warn you that this lesson is filled with technical terms, probably like 572 of them!
    I know when you’re new to electronics, all this crazy sounding jargon can be confusing, and you might think it will all be way over your head.
    And it might be all “over your head” for a while (it still might be over my head 😉 - but as you get more familiar with these terms, and see them used and explained in different ways, over time all the crazy stuff will start to sink in.
    I’ll try to explain all the jargon along the way as best as I can, but just in case you miss something… here is a chart listing all the terms used here:
    (see chart here! - bit.ly/3B19py9)
    TERM DESCRIPTION
    UART Universal Asynchronous Receiver/Transmitter
    USART Universal Synchronous/Asynchronous Receiver/Transmitter
    SPI Serial Peripheral Interface
    I2C Inter-Integrated Circuit
    ATMEGA328P Microcontroller The primary microcontroller used On Arduino UNO and MEGA - has built-in UART
    ATmega16U2 Microcontroller A microcontroller used on the Arduino UNO and MEGA that has a built in USART. This microcontroller is used as a USB to serial converter.
    RX Receive. Often, the connection designated to receive a signal is marked with RX.
    TX Transmit. Often, the connection designated to transmit a signal is marked with TX.
    USB Universal Serial Bus
    TTL Transistor-transistor logic
    ASCII American Standard Code For Information Interchange
    WHAT THE HECK IS SERIAL COMMUNICATION?
    In a nutshell, serial communication is a method of sending and receiving information one bit at a time.
    Serial communication takes many different forms, we will only discuss one of them in detail here.
    Just like there are many ways to communicate from one person to another, there are many ways to serially communicate from one device to another.
    Probably the most familiar method of serial communication is over USB. If you didn’t know, USB stands for Universal Serial Bus.
    USB is a serial communication protocol. A protocol is just a way of doing something. Maybe you have a protocol for what to do if you can’t find your phone…
    Curse a couple times
    Mentally walk through the places it could be
    Look in the last room you were in
    Blame the kids for losing your phone
    Look on the bathroom shelf
    Get one of your family members to call you, so you can hear it ring in the basement, buried in the laundry basket
    USB is but one of many serial communication protocols that your Arduino can use. It’s also able to communicate using these common protocols…
    CONTINUED...
    bit.ly/3B19py9
    **About Us:**
    This Arduino lesson was created by Programming Electronics Academy. We are an online education company who seeks to help people learn about electronics and programming through the ubiquitous Arduino development board.
    **We have no affiliation whatsoever with Arduino LLC, other than we think they are cool.**

Комментарии • 52

  • @cschmitz
    @cschmitz 2 года назад +9

    This was incredibly helpful. This answered a bunch of questions that I had asked other engineers and either got explanations I didn't understand or just got a shrug. Thanks for taking the time to make this video 🙌🏽

  • @photoniccannon2117
    @photoniccannon2117 Год назад +7

    You’re one of the best explainers I’ve ever seen on RUclips. Like this is Khan Academy level stuff. Nice job.

  • @pourushsachdeva6692
    @pourushsachdeva6692 2 года назад +4

    Amazing video! I am totally new to electronics and was able to understand this topic because of your wonderful explanation.

  • @andreweastland9634
    @andreweastland9634 2 года назад +6

    If you send the msb first then each bit will have a different significance according to the total number of bits in the frame, sending lsb first means the first bit received is always the units bit, the second is the 2's bit and the third the fours etc. This is much simpler to implement in hardware rather than the complications of msb first.

  • @fragile-engineering
    @fragile-engineering 3 месяца назад

    clear and understandable. Great Video!

  • @jonathanm9436
    @jonathanm9436 2 года назад +1

    Really great format: tell 'em what you're about to tell 'em; tell 'em; then tell 'em what you told 'em. Perfect. Also, provided answers to my two unknowns: what is a uart and what is baud and why 9600. Fab.

    • @michaelcheich2481
      @michaelcheich2481 2 года назад +1

      Glad it was helpful! That is pretty much or exact format! :)

  • @fabianorlandolassomunoz6965
    @fabianorlandolassomunoz6965 2 года назад +1

    Excellent explanation and appropriate use of didactic elements. Thanks

  • @siamakpoursabahian539
    @siamakpoursabahian539 Год назад

    Great video, thanks.

  • @neuralmodulator
    @neuralmodulator 8 месяцев назад +1

    Wow, you are an excellent teacher. Thank you for this!

  • @chaoticlue
    @chaoticlue 2 года назад +1

    I was wondering what the heck serial communication is and this guy read my mind.

  • @joshuapitong899
    @joshuapitong899 Год назад

    Great help. Thank you.😊🙌

  • @mtalhakhalid1679
    @mtalhakhalid1679 2 года назад +1

    Very helpfull sir now had better idea of how serial work thanks

  • @Bianchi77
    @Bianchi77 2 года назад

    Nice video thanks :)

  • @adambeedle
    @adambeedle 2 года назад +3

    Great video

  • @MEan0207
    @MEan0207 2 года назад +1

    Thank you

  • @raghuram1516
    @raghuram1516 2 года назад +1

    Nice!

  • @thearithmos3408
    @thearithmos3408 2 года назад +1

    hahaha where were you when I was in college, studying engineering??😆😆 Nice job explaining the basics, dude keep it up👍👍

  • @DodgyBrothersEngineering
    @DodgyBrothersEngineering 2 года назад +1

    I thought TTL was Time To Live. Must have miss remembered it from my college days. Might want to check your arrow it is pointing to MSB not LSB again. I can't watch these videos without at least picking up one new thing every time. Another great video.

    • @programmingelectronics
      @programmingelectronics  2 года назад +1

      Thanks a ton for watching! We should have corrected that arrow position in this one.

  • @brendanboon9062
    @brendanboon9062 2 года назад +2

    Wow what a gem of a video! If you raise the baudrate does it mean you’ll use more power and if attached to a battery it wil run out faster?

    • @programmingelectronics
      @programmingelectronics  2 года назад

      Great question Brendan! I do not believe so...
      When using the serial commands, it is going to be the same number of packets sent, only done at different rate.

    • @brendanboon9062
      @brendanboon9062 2 года назад +2

      @@programmingelectronics i’ve looked it up and found this answer: If you have crummy cabling, or long distances, poor grounding, noisy environment, then slower baud rates can give more reliable results. Slower also uses less power as CMOS power consumption is switching frequency dependent. If the serial comm's are buffered first, so that RS232 type levels (+/- 3 to +/-12V, one wire for send, one for receive, plus Gnd) or RS485 type signals (+/-3V, but with 2 wires for sending, 2 for receiving, plus Gnd) than higher speeds and longer distances can be supported more reliably.

    • @brendanboon9062
      @brendanboon9062 2 года назад +2

      So perhaps the power stays the same if you just send a fixed message. But if you’re using sensors and want to extract data you are probably takibg more samples at a givzn time with a higher baudrate and thus more processing power (energy consumption). At least that’s what i would assume

    • @michaelcheich2481
      @michaelcheich2481 2 года назад +1

      @@brendanboon9062 Cool! Thanks for these details!

  • @deathsgaze5826
    @deathsgaze5826 Год назад +1

    10:25 , is this little endian structure? Where the most significant part of the binary number is stored on the right.

  • @winstonkabaso6234
    @winstonkabaso6234 2 года назад +1

    Wonderful explanation. I am a beginner kindly help me with this problem. How can a simple program be written that dynamically calculates the water volume used in a tank. Given a cubical container of breadth=5, length=10 and height =20. If the tank is filled with water to an appropriate height, I know the volume of water is volume of water = volume of tank minus volume of empty space. Now, how do is the amount of water used calculated if the volume of water keeps being removed downwards after some time?

    • @programmingelectronics
      @programmingelectronics  2 года назад

      Great question Winston!
      With Arduino, any code in the loop() function gets repeated over and over again, as long as you have your Arduino plugged in.
      Assuming you have a sensor that can report the relative amount of water in your tank, like an eTape (www.adafruit.com/product/464), then you can just read from the sensor and calculate the new volume every time through the loop.
      So inside loop, you might do something like:
      - read value from water sensor --> eTapeReading = analogRead(eTapePin)
      - convert eTape reading to height --> You'd have to look at the data sheet for a conversion to apply (or google)
      - calculate volume V=πr2h ---> volume = PI * r * 2 * waterHeight
      - display new volume --> Serial.println(volume)
      Hope this helps some!

  • @ChandranshuDwivedi
    @ChandranshuDwivedi 2 года назад +2

    please begin the serial communication

  • @familyman2124
    @familyman2124 Год назад

    you really sound like the new boston

  • @johnyeap7133
    @johnyeap7133 12 дней назад

    you sound like stat quest

  • @TheMechatronicEngineer
    @TheMechatronicEngineer Год назад +1

    Great video, man!

  • @ivanzagar2176
    @ivanzagar2176 2 года назад +1

  • @ahmadjaradat3011
    @ahmadjaradat3011 3 месяца назад

    You’re one of the best explainers I’ve ever seen on RUclips. Like this is Khan Academy level stuff. Nice job.