I2C Part 2 - Build a I2C Sensor

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • In the second look at I2C, we will design our own I2C sensor. We’ll also look at the protocol used to exchange data on the I2C bus.
    Full article with code at dronebotworkshop.com/i2c-part...
    More articles and tutorials: dronebotworkshop.com
    Join the conversation on the forum: forum.dronebotworkshop.com
    Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
    We are back working with the I2C bus, this time to examine the protocol used to exchange data on the bus. We will also look at the addressing scheme.
    Then we will take four HC-SR04 ultrasonic distance sensors and create our own I2C sensor using them.
    A lot of inspiration for this came from an excellent video by Andreas Spiess, the ”guy with the Swiss accent”. In his video, he created a 3-sensor device using an ATtiny85. You can check it out at • #40 Ultrasonic Distanc... .
    In my implementation, I used an Arduino Uno, but this is only to make development a bit easier. If I were to create a permanent version of this sensor I would probably use either an Arduino Pro Mini (which would also allow a 3.3-volt version to be created) or an ATmega328 chip.
    Here is the outline of today's video:
    00:00 - Introduction
    01:26 - I2C Protocol and Addressing
    07:14 - Ultrasonic Sensor Wiring and Testing
    14:09 - Remote I2C Sensor Intro
    19:21 - Remote I2C Sensor Code
    While this sensor certainly could be improved upon it should serve to illustrate how easy it is to create your own I2C device.
    You can get all of the code that I used in this video at dbot.ws/i2cpart2.
    And, of course, if you haven’t subscribed to the channel please do me the honor of having you as one of my subscribers.
    Thanks, I hope you enjoy the video!
  • Jak na to + styl

Komentáře • 153

  • @allinclusive5762
    @allinclusive5762 Před 5 lety +55

    You and "the gui with the swiss accent" ( Mr. Spiess ) a are a class of their own! Very professional! Thanks for your work! Thumbs up!!

    • @Dronebotworkshop
      @Dronebotworkshop  Před 5 lety +7

      Andreas is the best, I just stand in his shadow - which is a very big shadow considering that he is in Switzerland and I'm in Canada! But I do thank you for the complement.

    • @allinclusive5762
      @allinclusive5762 Před 5 lety

      @@Dronebotworkshop So - i'm sitting in the middle ( Germany ) - and i think, you are fishing for compliments ;)

    • @sledgeHammerRulez
      @sledgeHammerRulez Před 5 lety +1

      don't do yourself short! i like your videos like the ones from andreas. I'm looking forward to your connection between a pi and an arduino. I want a (double) car-detection & aid (distance to the wall 4 my wife) in my garage directed by an pi (connecting to home-assistant) and measured with an arduino. KUTGW!

    • @davidfarning8246
      @davidfarning8246 Před 5 lety

      @@sledgeHammerRulez That is an interesting idea. I think I will make an arduino based ultrasonic sensor for my mom that tells her when she has pulled her car alll the way forward in the garage.

    • @jonathanr4242
      @jonathanr4242 Před 4 lety

      @@davidfarning8246 LOL! I need one for my mum that reminds her to open the garage door before trying to drive the car out.

  • @acadman4322
    @acadman4322 Před 5 lety +29

    :-) Another high-quality tutorial from the best teacher on CZcams. Thank you.

  • @northshorepx
    @northshorepx Před 5 lety +2

    Bill - WOW! That was an amazing tutorial. I know feel confident that I could change my own sensors to be I2C items. It's like I can create a wired version of MQTT where I don't need wireless. Thank you do much for doing such a patient and well thought out tutorial.

  • @diamantbluemc
    @diamantbluemc Před 3 lety

    Thank you from the bottom of my heart !!!!

  • @bigsteve6729
    @bigsteve6729 Před 2 lety +1

    Your videos are nothing but flawless. Great job

  • @Steven-jf4cs
    @Steven-jf4cs Před 5 lety

    Outstanding tutorial. Clear, concise and fun to watch and learn. So being that I'm from Southern California you get the "woohhhoo Awesome Dude....you made I2C gnarly" award!

  • @davetribbett8577
    @davetribbett8577 Před 2 lety

    This guy is fantastic! The two I2C vids are really good, best I’ve seen! Hoping he also does the other available interfaces...highly recommend this channel...

  • @raagamparmar179
    @raagamparmar179 Před 4 lety +2

    Thanks Man! I am a teenager in to come in 10th, and with your help, I've made my very own I2C Keypad 4x4 Matrix and made a smart keypad door lock with it. I am going to make a PCB for that. Thanks a lot.

  • @MrHjsalom
    @MrHjsalom Před 4 lety +1

    Thank you for sharing your knowledge with your outstanding dedication.

  • @Mystic0Dreamer
    @Mystic0Dreamer Před 5 lety +5

    I thank you for your excellent explanation of the programs you use. You go through each and every line of code in precise detail, and that's exactly what I need. So I can't thank you enough for your attention to precise detail. Also I totally agree with "I Two C". That's perfectly acceptable and how I pronounce it too. I understand that "I Squared C" is also acceptable, but like you, I actually prefer "I Two C". Because in truth, there's nothing mathematically squared about it. You are an excellent instructor far above the norm.

  • @dansam1395
    @dansam1395 Před 5 lety

    forward to see one for SPI too. Thanks for sharing with us such a great quality tutorials.

  • @Pinchington
    @Pinchington Před 2 lety +1

    If Mr. Rodgers worked with electronics and programming, it would be you. Love your videos

  • @PhG1961
    @PhG1961 Před 5 lety

    Awesome ! I've been using an ultrasonic sensor on a servo that sweeps left to right to avoid obstacles. The noise of the servo drive me (and many others) crazy. This solution is really silent ! Much better.

  • @mohammedomer7155
    @mohammedomer7155 Před 3 lety

    This channel is very helpful. Thanks so much for the time you put into it

  • @gunnarstoa
    @gunnarstoa Před 5 lety +1

    I truly enjoy your videos and instructional style and was pleasantly surprised to hear you mention my original favorite CZcams teacher with the Swiss accent! The sinister part of me was waiting for you to coyly explain that the reason you decided to build a custom 4-way ultrasonic I2C sensor (unlike Mr. Spiess' 3-way sensor) is simply because 4 is clearly better than 3. Maybe zoom in to picture of two groups of puppies where 4 is clearly better than 3. No smiling, just more matter-of-fact presentation of your analysis. I'm kind of glad you didn't as I would be cleaning up a cup of coffee right now. But seriously, thank you for sharing your knowledge!

  • @Taran72
    @Taran72 Před 5 lety

    Yes, this video (as your other videos) definitely inspired me to create my own master and slave I2C project. Thank you for providing the explanation and the code. :)

  • @johnfrankforther8162
    @johnfrankforther8162 Před 5 lety

    Thanks for the great video. This looks like something I may use on my model railroad for signal control.

  • @DodgyBrothersEngineering

    Great video goes a long way towards answering some questions I have about a project.

  • @AhmadAsmndr
    @AhmadAsmndr Před 4 lety

    thank you very much i learn new things every time i watch your videos..

  • @oracid
    @oracid Před 5 lety +2

    Thank for all. From Paris.

  • @ExperimentwithPhotography

    Your presentation so skillful and excellent that I do not have word for it. it is too good....!!!!

  • @guyd6
    @guyd6 Před 4 lety

    Excellent against. It's a real course. Continue your nice job.

  • @CR046
    @CR046 Před 5 lety

    Thanks for your work! Greatings from Belgium.

  • @SaucemanSauceman
    @SaucemanSauceman Před 4 lety +1

    Really enjoy your vids, they have helped me alot!

  • @weeeBloom
    @weeeBloom Před rokem

    Thank you very much!! amazing tutorial!!

  • @opal177
    @opal177 Před 2 lety

    Thank you so much for your good videos.

  • @quaternion-pi
    @quaternion-pi Před 5 lety +4

    Simply amazing tutorial. As the newping library is available on platformio, I'm moving to visual studio code with the platformio extension instead of the arduino interface - seems a much nicer programming environment. Thanks for sharing your excellence!

    • @sledgeHammerRulez
      @sledgeHammerRulez Před 5 lety

      andreas, the guy with the swiss accent, did an excellent video on it last sunday! I will switch also, since visual studio code is now available as addon for home-assistant as well

  • @opalprestonshirley1700

    Great tutorial, I've got to try this.

  • @ratmadness4858
    @ratmadness4858 Před 3 měsíci

    this video was very helpful! thanks

  • @adapasriharsha3720
    @adapasriharsha3720 Před 4 lety

    thank you for making this video

  • @soumitradey8208
    @soumitradey8208 Před 5 lety

    Wow excellent! Great explanation. Best in the world!

  • @raagamparmar179
    @raagamparmar179 Před 4 lety

    Wow! This video has inspired me to develop my homemade 3x6 keyboard matrix into a I2C Device. That would be Wonderful! Thanks a lot :)))))))

  • @obyildiz
    @obyildiz Před 4 lety

    Very useful tutorial! thanks sir.

  • @samerswedan5876
    @samerswedan5876 Před 2 lety

    Thank you very much

  • @passertm
    @passertm Před 4 lety

    Great. Super videos. Thanks a lot!!!

  • @atmosferaDIGITALweb
    @atmosferaDIGITALweb Před 5 lety

    Ótimo tutorial, espetacular !!!

  • @OsoPolarClone
    @OsoPolarClone Před 5 lety

    Very good video. Thanks

  • @phucthinhnguyen5633
    @phucthinhnguyen5633 Před 5 lety +3

    OMG!! This is what i need!! Right on time!! Thanks Dronebot!!!

  • @azyfloof
    @azyfloof Před 5 lety +3

    Hi, Bill!
    I just wanted to reach out and thank you personally for covering I2C, because that first episode in particular helped me learn a huge amount on the topic! I was able to massively overhaul the hardware and software of a project I'm working on for an up coming convention.
    I previously had an ATMega328 running animations on about 120 neopixels, while reading buttons on a control panel and polling a potentiometer for a brightness control. Since learning about I2C and how to implement two way communication between two or more microcontrollers, I've been able to use one ATMega to run the light animations, and second ATMega running the control panel. I've also been able to swap out the potentiometer for a rotary encoder AND implement IR remote functionality using a cheap slim pocket IR remote, since I learned from your videos how to use IR control in projects :)
    I hope you know how much you've taught people and inspired them to try new things :D
    Take care of yourself :)
    ~Azy

  • @rsrini7
    @rsrini7 Před 4 lety

    Thanks for wonderful explanation and demo on I2C. Please explain on SPI compared with I2C difference, applications. Finally About UART, CAN bus as well.

  • @electronic7979
    @electronic7979 Před 5 lety +2

    Very useful video 👍

  • @corbamilk6412
    @corbamilk6412 Před 5 lety +8

    The readI2C() in the video isn't waiting for 100ms, it's waiting no more than 100 ms. You will break out of the while if either there is something available or you are greater than or equal to 100 ms. You then do the read only if the elapsed time is less than 100ms.
    The return from readI2C() is undefined if more than 100 ms occurs between the request and the waiting for a response. It only reads and sets bval if there is less than 100ms, if it is more than 100 ms you return an indeterminate value.

    • @GrafRucola
      @GrafRucola Před 4 lety +2

      Thx, I felt that there was something fishy in these lines, you helped me understand what was going on!

  • @yusufaksel2516
    @yusufaksel2516 Před 4 lety

    You should add thia video to your i2c playlist, thanks by the way.

  • @KKTVirtualLearning
    @KKTVirtualLearning Před 3 lety

    Excellent

  • @santorcuato
    @santorcuato Před 5 lety

    You are a MASTER! Nice video, thanks.

  • @geoffreyjbrown
    @geoffreyjbrown Před 4 lety

    Many thanks for your videos. Very informative. One topic I would be interested in a video on which continues the I2C learning is whether it is possible to use I2C within an ISR (interrupt service routine). It would be useful say if a RTC (real time clock) was able to be read in an ISR as millis() does not function. This could ideally go into detail about when and how interrupts are used in I2C comms.
    Geoffrey, New Zealand.

  • @dainiusjaraminas6412
    @dainiusjaraminas6412 Před 4 lety

    Very useful . Sir thank you very much :)

  • @starkship7018
    @starkship7018 Před 2 lety

    very help full tutorial respect++++

  • @mejrimouhamedali1011
    @mejrimouhamedali1011 Před 11 měsíci

    That's good thank you

  • @robertwillemsen368
    @robertwillemsen368 Před 5 lety +7

    Very good video again! For everybody complaining about I2C or I square C, please start your own channel and do a better job. I wish you all the best but doubt you will succeed.
    Keep up the good work! Love IT!

    • @Dronebotworkshop
      @Dronebotworkshop  Před 5 lety +6

      Thank you Robert, it can be very dishearting to put the effort into making a video only to have some clown critize it for something as silly as "I squared C" vs "I two C". Especially when neither of them are technically correct - it's the Inter Integrated Circuit bus so it should probably be "IIC"! Maybe I should have just said "TWI" to avoid offending Mr. Perfection.
      I really appreciate your nice comment, hopefully there are others who feel the way you do. Thanks!

    • @robertwillemsen368
      @robertwillemsen368 Před 5 lety

      @@Dronebotworkshop the problem is that it is not possible to satisfy everybody. But nowaday it is so easy to BASH that you could be discouraged tot make this video's. Well I happen to love them andere learn a lot. Hope this helps to continue! Thanks

  • @olegvelichko1659
    @olegvelichko1659 Před 5 lety

    Awesome content! Thanks for these videos!
    On a side note - during the first few minutes of the intro it looks like you have cat ears thanks to the pliers on the peg board behind you. Easter egg or not - still found it pretty neat... 👍👍

  • @dizignit1983
    @dizignit1983 Před 5 měsíci

    Thanks!

  • @rgdphome8974
    @rgdphome8974 Před 5 lety +1

    Gr8 Sir.

  • @tinkmarshino
    @tinkmarshino Před 5 lety

    Bill, I actually followed a lot of what you said! I got confused a bit at the beginning but as you went through the sketches I kind of got it! It amazes me how you can make things understandable to me in my current condition.. I am so thankful. One thing I do not understand is why use i2c? everything seemed work ok before you added the second arduino? I did not understand what the advantage was.. Sorry if my questions are rather childish.. But I do have such a hard tome understanding things here in my later years.. Sheesh it never used to be this way.. Well thanks for the share and carry on my friend.. oh one other thing.. I got the DroneBot workshop news letter on april 8th has thee been a new one? or is it just once a month? I have forgotten..

  • @newburypi
    @newburypi Před 5 lety +3

    A caution regarding the HC-SR04. There is now a "p" version of this sensor (recognized by the missing xtal) that does not work in one wire mode. only in two wire mode.

  • @syedmuhammadali2083
    @syedmuhammadali2083 Před 5 lety

    Please share some videos for I2C interfacing using Texas Instruments micro controller.

  • @hubertmargreiter3508
    @hubertmargreiter3508 Před 3 lety

    Like all of your videos, also this one is very educational. Thanks for uploading!!
    But how do you approach the problem if you want to transfer 128 bytes from a slave node to a master (e.g. Arduino or Teensy)?
    Do you know of any link that might help me with a code fragment?

  • @roberthillkg5wry206
    @roberthillkg5wry206 Před 5 lety +2

    Yet another really great tutorial. I did have a question about your explanation of the protocol. As you describe the data being clocked on the SDA line, you mentioned the data as being sent in bytes. I think you really meant to say that data is sent bitwise until 8 bits are sent whereas the slave can then ack or nack the byte sent. Any number of bytes and be transferred during a transaction until a Stop or Restart is encountered. Once again, really love your videos.

    • @superleisie
      @superleisie Před 4 lety

      You are right. There should be a clock signal (a rising edge) for every bit and not for a byte. His explanation is wrong.

  • @proftiagogomes
    @proftiagogomes Před 4 lety

    Please Tell me How to make a I2C to LDR, and other to LM35 and read only with SDA and SCL from Arduíno UNO???

  • @surendramaharjan3129
    @surendramaharjan3129 Před 3 lety

    the drill machine in background is it for pcb drilling to mount the through hole components?

  • @b.shashanksunny1927
    @b.shashanksunny1927 Před 4 lety

    sir in my project i want to send string variable from master to salve and multiple sensor data is need to send from salve to master(master is node mcu and salve is arduino uno)

  • @DavidDyck
    @DavidDyck Před 4 lety +2

    thank you!
    at 3:50 bit zero is mentioned, but the timing diagram shows bits one through bit N - is the diagram off-by-one - or
    Also it is stated "the clock signal will go high every time a data byte is sent" - perhaps sometimes you mean a single data bit?

    • @vtorsi610
      @vtorsi610 Před 4 lety

      No, his diagram shows many BYTES 0 ... - It should show many clock cycles per BYTE.

    • @DavidDyck
      @DavidDyck Před 4 lety

      @@vtorsi610 thanks perhaps that is what is confusing - the clock is shown clocking individual "bits", but the audio is using the word "byte" - the audio clearly shows the clock for the start "bit" - confusing use of bit and byte
      The wikipedia timing diagram uses the word "bit" for each clock transition - very similar image
      en.wikipedia.org/wiki/I%C2%B2C#Timing_diagram

  • @dibyojyotibhattacherjee4279
    @dibyojyotibhattacherjee4279 Před 2 měsíci

    Hello, while adding up those pullup resistors on the SDA and the SCL line, will it be a problem if I add pull-down ones?

  • @fahmywaleed
    @fahmywaleed Před 5 lety

    Thanks for the excellent video, I have a question though hope it is the wright spot to ask. My understanding from the video that due to address conflict we cannot connect the 4 ultrasonic sensors to the same I2C bus because all of them have the same address?

    • @PablumMcDump
      @PablumMcDump Před 4 lety

      The sensors weren't I2C capable. Those pins were "trigger" and "echo", not SCL and SDA, which is why they could be tied together in the example.

  • @dbijenhof
    @dbijenhof Před 2 lety +1

    When talking about sending data, you say data bytes (segment around the 4 minut mark), when I assume you mean data bits. The SDA-line can only contain one bit at a time...

  • @wishicouldarduino8880
    @wishicouldarduino8880 Před 5 lety

    Something is wrong with i2c master sketch doesn't compile for windows says expected initializer before j token right at void set up any solutions would be greatly appreciated thanks😁

  • @nishikanthingole3638
    @nishikanthingole3638 Před 4 lety

    Hello @DroneBot Workshop,
    i am using esp32-wroom with bq24195l, but i am unable to communicate bq with esp32 via i2c.
    can you please tell me how i get data from BQ to ESP32 via I2C??
    thank you

  • @mikemiller2748
    @mikemiller2748 Před 4 lety

    Thanks for this video! How would you build a system that has upwards of 60 sensors? I2C should allow them all to be connected serially, without requiring a connection from each back to the arduino as you’ve done here, right? Would each sensor need its own microcontroller in that case?

    • @diamantbluemc
      @diamantbluemc Před 3 lety

      You will definitely have a significant delay if you will use one Arduino Mega and wait for each one to measure, if you can read all of them at the same time ( assumming they will not interfer with each other ) just scale the code to acomodate all of that data, from my experience with 20 sensors and a master and slave ( 2 Megas), it was not a problem. Btw why do you need so many ?

  • @dalie3672
    @dalie3672 Před 3 lety

    I'm messed up with the theory part, what i think is the CLK signal toggles when a bit sent, not a byte. Also i expected a example communication with different sensors through I2C in the last part of the video, but it turned out to be just a combination of this and the last videos.

  • @LUCKY007725
    @LUCKY007725 Před 4 lety

    Very informative video, thanks
    Could you please tell me how I can separate the values of dht22 as temperature and humidity...
    If You can make a complete tutorial on it then will be very helpful.
    I have dht22 connected with uno and i2c with esp8266, I want to get values from uno to esp8266 and display them over blynk app.
    Please favor me

    • @vtorsi610
      @vtorsi610 Před 4 lety

      There are finished DHT22 drivers available - just use google.

  • @Rainy_days_lover
    @Rainy_days_lover Před 2 lety

    could you do a tutorial for i2c for when the slave only sends the data once if requested by master?

  • @PTHouy
    @PTHouy Před 2 lety

    I wondering how to draw diagram like this 8:07. what software did you used?

  • @DustinjBailey
    @DustinjBailey Před 4 lety

    I'd love if you made a video about connecting 2 ESP8266 devices over wifi. :-D

  • @kulaniscap
    @kulaniscap Před 11 dny

    Can I connect the 5V Arduino to a 3.3V ESP32 via I2C? What voltage should I connect the Pull-up resitor to?

  • @lylehintz7275
    @lylehintz7275 Před 3 lety

    What happens if you use one of the reserve addresses?

  • @alibehrouz9833
    @alibehrouz9833 Před 5 lety

    greatttttttttttttttttttttttttttttttttttttt

  • @billstrain1
    @billstrain1 Před 4 lety +2

    Like your quality tutorials. I have a question. Since you are going to send back 4 bytes of sensor data, why not just ask for 4 bytes on the master request and then have the slave just read the 4 HC-SR04's at that point of time in the order of 1, 2, 3 and 4. All the other reading between requests will not do the master any good.
    BillW

    • @vtorsi610
      @vtorsi610 Před 4 lety

      You can send all 4 bytes

    • @privatepeewee6402
      @privatepeewee6402 Před 2 lety

      @@vtorsi610 he's asking why wait for 8 bytes if the slave only sends 4, if you read all 4 sensors in a defined order and pnly wait for 4 bytes instead of 8 then the communication time slave to master is halved making it possible to respond faster to sensor input.

  • @flanker0ne
    @flanker0ne Před rokem

    I have some problem trying to understand how the readings from the sensors remain synchronized.
    How the Master can always recognise the 3rd sensor as the third?

  • @dawnishsyafie4738
    @dawnishsyafie4738 Před 4 lety

    HOw to use on sound sensor ...Please .......

  • @eddieeriksson5830
    @eddieeriksson5830 Před 4 lety

    Can shelded twisted pair increase the distance between the Master /Slave units?

  • @mikeholczer
    @mikeholczer Před 5 lety

    Great video! Could you have powered the Arduino running the slave code from the other one?

    • @Dronebotworkshop
      @Dronebotworkshop  Před 5 lety

      Hi Mike - I think that might be a bit too much current for the Master Arduino to handle.

    • @mikeholczer
      @mikeholczer Před 5 lety

      makes sense, thanks.@@Dronebotworkshop

  • @Logical_Controls
    @Logical_Controls Před 5 lety

    Why the hell are you making videos at 5:38 in the morning Bill? Haha very informative as always. Thanks for the video.

    • @Dronebotworkshop
      @Dronebotworkshop  Před 5 lety +4

      Actually I film most of my videos from about 4am to 7am - it's a lot quieter at that time.

    • @Logical_Controls
      @Logical_Controls Před 5 lety +1

      @@Dronebotworkshop And that mentality is the difference between your channel and all the other hobby electronics channels on YT, most of which are not even half as well constructed nor half as informative.

  • @pokednaful
    @pokednaful Před 2 lety

    Is it possible for TCS34725?

  • @youssefbenmouhou9030
    @youssefbenmouhou9030 Před rokem

    how 1 wire mode is even possible ? as I know we can't change the mode of a pin while execting a program ! so how Newping library is working ?

  • @lem09able
    @lem09able Před 4 lety

    Hello sir, would it work if I used an RTC module, a master arduino, and a slave arduino? I want the master to be receiving time from RTC and the slave arduino to be sending int values to the master. Then the master will take a look at values given by the rtc and slave and perform a certain operation base on those values. Example: An if else decision based on the time given by rtc and value sent by slave. If the values match the condition, the operation happens. My problem is that the rtc module is also connected in sda and scl, so how should I proceed since the master slave should also be connected via sda and scl?

    • @vtorsi610
      @vtorsi610 Před 4 lety

      1 Master Arduino + 1 Slave Arduino @ Address xxx + 1 Slave RTC @ address yyy is OK !

  • @gaventucker8416
    @gaventucker8416 Před 4 lety

    How can I get a consultation?

  • @davidhawley1132
    @davidhawley1132 Před 4 měsíci

    It's not clear here why a data-based protocol (the 255 marker) is being used instead of multiple byte reads/writes. Am I misunderstanding the I2C spec, is it an issue with the library, a robustness issue, or something else?

  • @kacadenganmata
    @kacadenganmata Před rokem

    if the pull up resistor doesnt exist, is it cause the slave does not send the data to master?

  • @narutoboruto4784
    @narutoboruto4784 Před 2 lety

    Hi Dronebot iam working on an MS4525DO digital airspeed sensor with I2C communication module i want it to measure velocity of air through an arduino uno,I was able to start communicating with the sensor. It does respond to changes in airflow.
    But I cannot get the values to come close to normal pressure reading.

    • @narutoboruto4784
      @narutoboruto4784 Před 2 lety

      I will really appreciate your help with this,thank you

  • @ilhamrahmatmuharam8501

    hello sir, I am an arduino beginner user ,, I want to use a pressure sensor with type xgzp6857 and will be processed by arduino, this sensor uses the i2c communication protocol, I have found the i2c sensor address is 0x6D, but this sensor does not yet have a library for arduino, how can I use this sensor so that the pressure reading can be displayed on the serial monitor?
    maybe you have an idea for this problem?
    thank you

    • @vtorsi610
      @vtorsi610 Před 4 lety

      Get the DATASHEET and go to the Arduino Forum ...

  • @aleksandarrankovic2035

    Can you make tutorial for 10-bit addresses.I tried to register on yours site but it does not accept mail.They are great tutorials, it would be nice to move on with I2C.For example, how to make address 200, and how to extract bites.Thanks

    • @noweare1
      @noweare1 Před 4 lety

      With 10 bit addresses you get a nack from the slave after the first byte of the address but the i2c register should be set for 10 bit slave address mode. The master will just send the second byte of the address and this time the slave will send back an ACK and off you go. The i2c has a lot of options that can be set up if the chip has a hardware i2c. If you are using a library then it just depends how much functionality the author included in the library.

    • @aleksandarrankovic2035
      @aleksandarrankovic2035 Před 4 lety

      Thanks @@noweare1 I solved the problem at another way. Thanks again

    • @noweare1
      @noweare1 Před 4 lety

      Did you use a library or hardware registers ?

    • @aleksandarrankovic2035
      @aleksandarrankovic2035 Před 4 lety

      @@noweare1 I skipped I2C.I use Serial comunication UART it was easier for me

    • @noweare1
      @noweare1 Před 4 lety

      @@aleksandarrankovic2035 Good deal ! Good luck in your projects.

  • @Rohit-oz1or
    @Rohit-oz1or Před 4 lety

    Why can't we read the full payload at once in place of byte by byte?

    • @noweare1
      @noweare1 Před 4 lety +1

      You are right. Sending back five bytes would of been better. Instead the master has to request 5 times. I don't know the library but that could mean starting and stopping the bus 5x to get the readings.

    • @vtorsi610
      @vtorsi610 Před 4 lety

      @Rohit - You can ...

  • @A.D.38q9
    @A.D.38q9 Před 2 lety

    How can i make this with 2 of this sensors en 3 arduino's 2 slaves and 1 master en de master request value of them both everytime

  • @HeliosFire9ll
    @HeliosFire9ll Před 4 lety +1

    shouldn't the code be if(millis() - entry > 100) bval = Wire.read() instead of if(millis() - entry < 100) bval = Wire.read()? To show that the time has ellapsed

    • @HeliosFire9ll
      @HeliosFire9ll Před 4 lety

      Could we also replace millis() with delay(100)?

    • @sidspatil
      @sidspatil Před 3 lety

      Yes, I believe, that's an error in the sketch shown in the video, as well.
      Attn: @Bill

  • @munfaridlmunfaridl2491

    can i get code please
    ?

    • @Steven-jf4cs
      @Steven-jf4cs Před 2 lety

      Did you look in at the full article link? May I suggest just typing it out to get some memory practice. It's not a huge piece of work really.

  • @pisacc
    @pisacc Před 4 lety

    To subscribers: Play with 1.25 speed. Even 1.5 is not too fast.

  • @kokogyi5905
    @kokogyi5905 Před 3 lety

    Please like to learn 2 arduino UNO, master and slave using Modbus.

  • @tharunv1885
    @tharunv1885 Před 5 lety

    Hi sir
    I have list of projects expected from u
    1. Drone using arduino (TX,RX,FLIGHT CONTROOLER using arduino only)
    2. Using mpu6050 module with arduino
    3. Using arduino and nodemcu as iot
    thanks in advance

  • @superleisie
    @superleisie Před 4 lety

    Are you sure that your explanation of the protocol is correct? There should be one clock cycle per BIT and not per BYTE.

    • @vtorsi610
      @vtorsi610 Před 4 lety

      Correct - There are 8 Clock Cycles per byte + 1 Clock Cycle for the ACK/NAK reply. But he is showing many BYTES...

  • @YouTubeYouTube-qg6vl
    @YouTubeYouTube-qg6vl Před 5 lety

    Ethernet card