Hey, guy with swiss accent, I've got an italian one.... I find very useful your teaching. Actually, I was used to plan experiments with Labview and NI instrumentation, I decided to leave both for open software and cheap devices, not only for economical concern. Thanxs for the wide presentations
@AndreasSpiess6 жыл бұрын
You are welcome. Hope everything goes well...
@valmormn8 жыл бұрын
Hey, guy with swiss accent. Your channel is very inspiring. Thanks for sharing your ideas!
@AndreasSpiess8 жыл бұрын
+Valmor Nascimento You are welcome!
@TheRealStructurer3 жыл бұрын
I'm watching this in 2021 and its still valid. I must say Andreas that you sound more secure and energetic in your newer videos, so keep them coming!
@AndreasSpiess3 жыл бұрын
Thank you! I should be a little more experienced after 370 more videos...
@timmyfingaz1002 жыл бұрын
For a few hours I have been struggling to get 2 screens working independently, not anymore!! Simple but effective, much simpler than what I was trying to do! Thanks :)
@AndreasSpiess2 жыл бұрын
Glad it helped!
@deangreenhough34796 жыл бұрын
Just come back to this video today for a refresher, My God, how very different you sound today........... oh my, how you have grown in such a short period of time, quiet astonishing!! Pat on the back required :-)
@AndreasSpiess6 жыл бұрын
:-)
@felixFPVDrone7 жыл бұрын
This episode was simple and easy to understand, even for a electronic novices like me. My main goal as a RC enthusiast is to better understand how I can utilize the I2C protocol on the flex port of my cc3d flight controller. You did a great job at explaining in detail!!!
@AndreasSpiess7 жыл бұрын
Thank you for your feedback! It is always good to know that my content is useful.
@heyhogan6 жыл бұрын
Thanks for the quick video. I am doing a project with an OLED, Temp sensor, and ADXL345 sensor and was wondering about how to build the bus, so your example did give me some ideas.
@AndreasSpiess6 жыл бұрын
I hope you will get it running!
@babybillen25 жыл бұрын
Is it possible to connect multiple TSL2591 to one arduino? they have the same address, but it can't be changed right?
@AndreasSpiess5 жыл бұрын
The Adafruit specs say: This board/chip uses I2C 7-bit address 0x29 (fixed)
@africantech56 ай бұрын
I have put two LCD before and Both has same address and it works
@wolfrobots1185 жыл бұрын
I love the way you talk. It made it a lot better to understand. I subscribed.
@AndreasSpiess5 жыл бұрын
Welcome aboard the channel!
@EivindGussiasLkseth3 ай бұрын
M5Dial and MCP23017 should be possible over I2C, but for some reason it doesn't show up using the address scanning program, and when I measure voltage on the 5V between the two devices, my multimeter shows that it drops to about 0.5V and is fluctuating a lot when the MCP is connected. 🤔
@AndreasSpiess2 ай бұрын
Unfortunately, I cannot do remote debugging. Low voltage is a sign of limited current supply (or if something gets hot, of a short or reverse polarity)
@noahmotito6 күн бұрын
I'm building a project that requires 3 mpu6050. How do I connect them since they all have same address and the uno may not be able to differentiate which sensor is communicating. Thank you.
@AndreasSpiess3 күн бұрын
AFAIK the chip has 2 address pins to select 4 different addresses.
@nousagi7437 Жыл бұрын
Hey Andreas, I just remembered 5 years later you had a video just like this, I'm planning to have an ESP32 master with ATTINY85 slaves, which each will take an analog input from a soil moisture capacitive sensor, I'm planning to do an array of these bundles for some plant pots and monitor each of them, and have the information sent through the same bus. Is it possible to assign an address to all slaves and access them in the order I prefer? And what would be a good method to buffer the I2C bus in case my cables are getting too long? Would really appreciate a reply from you, and thank you for all the content you upload, it's really interesting
@AndreasSpiess Жыл бұрын
I once made a video where I used slave ATtinys as ultrasonic distance sensors for my robot. Maybe you watch it?
@azolalesedi31914 жыл бұрын
great video how would i connect one current sensor to measure the variables from different devices e.g power supply,solar panels etc
@AndreasSpiess4 жыл бұрын
The usual current sensors can only measure one source. So you need many of them.
@azolalesedi31914 жыл бұрын
@@AndreasSpiess okay thank you
@Reda-gx6wq6 жыл бұрын
Hello I appreciate your content, I am building a weather station with rtc clock, humidity sensor and lcd , tree of them use I2c but sometimes when I reflush the program or turn off and on the esp8266 , the i2c does not work. May you help me with this issue ? thanks
@AndreasSpiess6 жыл бұрын
I cannot do remote debugging of such problems. I only suggest you try one after the other. Then you find out when it starts to create problems
@pakojaure7 жыл бұрын
Hi, A very helpful video, thank you! I am trying to use two accelerometers MPU6050 with an Arduino nano that only has one port for SCL and SDA, but I am confused because in some forums say that is needed to add pull-ups resistors with each SCL and SDA, is that right? Because how you doing it you don't need the resistors and looks easier! Thank you!
@AndreasSpiess7 жыл бұрын
+Paco J Theoretically, you need pullups. Practically you can try without them. If you have problems, you still can add them. There is usually only one I2C bus, because you can connect many devices.
@pakojaure7 жыл бұрын
Andreas Spiess thank you Andreas! I have already figured out that I don't need to use the pull-up resistors because the accelerometer MPU6050 already have them, each one about 4.4K ohms for SCL and SDA. Thank you again, you helped me a lot to understand about I2C. Greetings from Mexico!
@castro17805 жыл бұрын
Nice job explaining the theory behind I2C without getting caught up in code
@AndreasSpiess5 жыл бұрын
Thank you!
@Really29508 жыл бұрын
Great video. Good for esp8266. There is also a board with ads1015 to extend the pins available on esp8266 using I2C. Good topic for video too :)
@GameAndJokes7 ай бұрын
I have a question and i hope i can find an answer basically we directly connect all the scl and sda pins in the same connection? like the wires are connected together of the Oleds and the they are connected directly to arduino scl and sda?
@AndreasSpiess7 ай бұрын
I do not understand :-( Just look at the diagrams on how to connect the chips and signals.
@edsoncasagrande9945 Жыл бұрын
I2C is good, but using with laser sensor there is a short limit on cable lenght. How can we extend it? I wonder using RS485 open colector hardware, if it possible or not?
@AndreasSpiess Жыл бұрын
You get I2C extenders. RS485 has a limit of about 1 km
@khalmaxroboticsgh31769 ай бұрын
I'm working on a 4wd robot car using Arduino Mega. I am trying to synchronize the speed of all 4 wheels of the robot. I intend to read the motor speed from each motor using an AS5600 hall sensor. That means 4 hall sensors in all. I also realised the arduino mega has only one sda and scl pins so this tutorial is helpful. Can you also help me with more tips and advise on how to go about it? Thanks
@AndreasSpiess9 ай бұрын
I share my knowledge on KZbin and do not do individual consulting :-( Good luck with your project!
@b9robot018 жыл бұрын
Hello Andreas, I am completely new to these type of displays and sensors but I must say that your videos are the best I have found to help me learn. I want my first project to have 2 or 3 0.96 OLed displays, each showing a different sensor output, like temp and humidity on one, time and date on the next, and on the third maybe a spectrum analyzer. Watching your videos has given me the confidence to try. I do have one question though. On this video you talk about making an IC2Bus, what is a IC2 Bus and how did you make them, that part of the video went by a little too fast for me.Thank you from a fan.
@AndreasSpiess8 жыл бұрын
Thanks for your nice words! Maybe I referred to my video #12. I just Suber glue a few headers with four pins together and connect them with 4 wires (soldered). Then, I can plug as many I2C devices in and all run in parallel.
@ullar82177 ай бұрын
thanks, helpful video even 8 years later
@AndreasSpiess7 ай бұрын
You are welcome!
@timm3802 Жыл бұрын
Hi Andreas. Thanks for a great video - Do you have any information video how to use MultiMaster on I2C? Maybe some code examples?
@AndreasSpiess Жыл бұрын
No. I never needed such a scenario
@pocket_science_6 жыл бұрын
Could you throw some light on the "home-made" I2C device you created using male headers. How does it act as a I2C device? Thanks.
@AndreasSpiess6 жыл бұрын
This was only a connection between the different wires.
@pocket_science_6 жыл бұрын
@@AndreasSpiess how does it act like a I2C device? What about its address?
@BBhashyam4 жыл бұрын
Great video and all the other videos as well. Instead of making a home made hub, can we use TCA9548A multiplexer which I read can be useful even in an address conflict situation? I am using 4 x sensors all with different addresses.
@Dream0Asylum5 жыл бұрын
I love abbreviations that are no shorter than what they're meant to stand in for.
@AndreasSpiess5 жыл бұрын
:-)
@iantang20483 жыл бұрын
Hi! I am new to arduino, and I have a project that need to connect multi Tof10120 sensor in one UNO and I am quite confused right now. May I know where to start or would u kindly give me some advice? Thanks!
@AndreasSpiess3 жыл бұрын
I suggest to enter "Tof10120 Arduino" into Google and you will find a lot of projects.
@paulodinis19813 жыл бұрын
hello from Portugal. i just watched your video to ltry to learn something more about i2c. the main reason is to make some i2c devices work on flight controller i2c bus. i have some detected in betaflight and some detected in inav. i know devices are working, but not correctly deteted and i dont understand, why? i bet is fw related issue
@AndreasSpiess3 жыл бұрын
Unfortunately, I cannot do remote debugging. But you should be able to exchange teh FW with a I2C scanner sketch to find out more.
@drawingboard828 жыл бұрын
Very helpful, many thanks for putting the time into this!
@AndreasSpiess8 жыл бұрын
:-)
@paulfleck24355 жыл бұрын
Great Video! One question: I need to use an Arduino with many identical motor shields (It will have more motors than one shield can handle). How do I change the address of the motor shields so they are not identical? Any ideas? Thanks!
@AndreasSpiess5 жыл бұрын
Your shields either allow that or you have to use a special I2C extender. Then you also have to change your code to address the respective shield first.
@techsilv51704 жыл бұрын
Hi great videos Just a question. Is it possible to connect 2 or more 16x2 lcd display and give them different messages
@AndreasSpiess4 жыл бұрын
Should be possible to create a second display ( Adafruit_SSD1306 display2(OLED_RESET); ). But I did not try
@campbellmorrison85406 жыл бұрын
Great info thank you. I am making a retrofitable shot timer for a multi group espresso machine. Each group has a counter display triggered by sensing the valvle solenoid current. the display of the group counts in seconds and stops when the group is released. Its the in thing to know how many seconds you require to deliver a shot ie 25-30ml should be around 20-25 sec this is affected by the grind and the coffee freshness. Anyway with all displays on one bus its much easier for me to add displays depending on how many groups the machine has so your video has helped me no end thank you
@AndreasSpiess6 жыл бұрын
Interesting project! Good luck!
@JDI4DAVID6 жыл бұрын
I am going to be connecting a gy9255 motion sensor and a BME280 to a 3.3 V PRO MINI. I have added pull up resistors but do I really need to? Thank you for your very helpful videos.
@AndreasSpiess6 жыл бұрын
With short wires and only a few devices on the same bus, they are usually not necessary. Just try.
@covingtonkua94043 жыл бұрын
Hello, I wanted to connect arduino micro (Master) to arduino nano(slave) and LCD I2C (Slave), both need SDA and SCl, is it possible to do it? Been searching around for quite a while now. Pls let me know thank you
@AndreasSpiess3 жыл бұрын
Cut the problem in two and try first the LCD. If it works you search for the Arduino I2C slave software and try it out without the LCD. If both work and do not have the same address you can connect both slaves to the same lines.
@covingtonkua94043 жыл бұрын
@@AndreasSpiess thanks for the reply, will try it out soon.
@simonthewarrior595 жыл бұрын
Hi andreas! Thanks for sharing all your knowledge. I'm working in a project with three i2c devices connected to the arduino. For now i'm working with only 2, an oled display just like the ones you used here, and a MPU6050 accelerometer module. The problem is that I'm using a library to deal with the display (OLED_I2C.h), and other libraries to deal with the accelerometer (I2Cdev.h and MPU6050.h) wich depend on Wire.h. I think the use of the bus by these libraries are in conflict because they work separately but not together. What do you suggest?
@AndreasSpiess5 жыл бұрын
I suggest to try it out. It should work if the addresses are different
@simonthewarrior595 жыл бұрын
@@AndreasSpiess Yes, I'm still working on that. Thanks for replying!!
@R_Alexander0298 жыл бұрын
Great video. Quick question, do you need to add pull up (or pull down) resistors for SCL and SDA?
@AndreasSpiess8 жыл бұрын
For short leads and only one device normally not.
@R_Alexander0298 жыл бұрын
Vielen Dank für deine Hilfe.
@錘哥錘哥錘哥4 жыл бұрын
Hi, thanks for your sharing, it helps a lot. I’m trying to connect to two identical sensors in one arduino board and print it out the same time (max30102). And i’m having trouble with how to print both value in serial printer separately. How do i write them on the code? Thanks.
@AndreasSpiess4 жыл бұрын
Unfortunately, I have no time for consulting. But I am sure you will find a solution yourself.
@radeonblue18162 жыл бұрын
Again, One of the channel who is explaining the things but for beginners it is hard to grasp whatever he did as he did not showed the connections.
@AndreasSpiess2 жыл бұрын
You are right. This is not a channel for beginners :-(
@rafigarden78244 жыл бұрын
I might miss it..but do u have the wiring connection please
@AndreasSpiess4 жыл бұрын
I2C devices can be connected in parallel.
@Cristian-aa197 жыл бұрын
Hello, I am new in Arduino and I was wandering if using I2C Bus I can connect together 15pcs DHL22 sensors, 10pcs MQ2 sensors, 5pcs flame sensors,......and I will stop here. Basically I am trying to create an automation for a new house. I would like to monitor temperature, humidity, gases, fire detection, blind open/close, dimmable light, some proximity sensors to detect if doors are open or closed. Is this possible as DIY or I am dreaming to big?
@AndreasSpiess7 жыл бұрын
I2C buses can be used to connect many devices over the distances of a house. However, it is rarely used for that purpose. There are many videos and other sources about Home Automation on the internet.
@tienbuivinh52306 жыл бұрын
Thanks for your video. Now I am wondering if I have 2 same sensors and want to connect to just one Arduino board, How can I change the address of those sensors. Can you make another video about how to do it?
@AndreasSpiess6 жыл бұрын
Most of the chips have address pins where you can select amongst 2 or 4 addresses. Always read the datasheet of the sensor chips.
@tienbuivinh52306 жыл бұрын
I am using the AM2315 sensors and could not find anything about changing the sensors' addresses via Hardware in the datasheet. I am looking for changing those sensor's address by programming. Still stuck. Could you help me on it?
@AndreasSpiess6 жыл бұрын
You cannot change it through programming unless it is described in the datasheet. But only very few sensors can do that.
@ronyroy31166 жыл бұрын
how do i connect max30100 & adxl345 both with arduino to get the data from both sensor. please help me.
@Everest3dworks6 жыл бұрын
I connected two oled display with same model....ssd1306....I tried to display two different things in each. But the i2c scanner shows only 0x3c address....I connected all the wires in same port for both displays.....help
@AndreasSpiess6 жыл бұрын
Each display has to have its own address. There is a resistor on the Oleds to change the address. Needs soldering.
@Everest3dworks6 жыл бұрын
Andreas Spiess it worked perfectly....thank you
@shrikantnikam24262 жыл бұрын
I hope you will reply :) , I use 5 arduinos displays 5 sensor values on single i2c display it is situated 12 foot from arduinos , but at the display i want to tap data coming to display and serial print on arduino connected for tapping data it display address is 0x27 is it possible?
@AndreasSpiess2 жыл бұрын
Maybe this is possible, but you have to program everything yourself. If your Arduino at the display is programmed as a slave with another address you could send all the commands to 027h as well as to the address of the Arduino. But the Arduino needs to be programmed as a slave (different library)
@yoannthomann6 жыл бұрын
Hello, thank you for your videos ! I would like to make a big i2c bus (around 50m long and around 100 sensors max) for domotics (the bus will be in the walls so I would like to not have to replace the bus). What is the ideal section of the bus wires ? Do I need one or more bus extender to increase the range/stability ?
@AndreasSpiess6 жыл бұрын
I do not know. Maybe you search for the specifications of the I2C bus
@michaelpadovani95668 жыл бұрын
Thank you so much for this informative video. I am planning on putting together the following on I2C Bus: DS3231 (RTC), BMP180, and ESP8266. Do I need to worry about adding or disabling pull-up resistors for this setup? Thanks in advance! Cheers from Maryland, USA.
@AndreasSpiess8 жыл бұрын
Often you do not need it. Just try first without
@michaelpadovani95668 жыл бұрын
New subscriber here, thanks I will try first without!
@NerdMusician6 жыл бұрын
Great video! Can I use 16 Oled displays with this technique?
@AndreasSpiess6 жыл бұрын
If your displays have different addresses, yes. But usual displays only have 2 addresses to select from
@aseemparambennykukkarlive45014 жыл бұрын
hello sir can you tell me the value of the resistor I lost mine one
@AndreasSpiess4 жыл бұрын
123 Ohms?
@aseemparambennykukkarlive45014 жыл бұрын
@@AndreasSpiess thanks sir but solved the issue by just shorting the point with wire
@edwinmannaandthelearningch44507 жыл бұрын
theres some website i went to that has all the latest devices listed with how to's on how to connect them Wi-Fi ect......
@artur198468 жыл бұрын
Hallo! Does the I2C bus need independent power supply? I don't think that a single Arduino Uno's power will be sufficient for multiple devices.
@AndreasSpiess8 жыл бұрын
+Arthur K The I2C bus (SDA, SCL) does not need a power supply, the devices connected to it have to set the signal level. This is why the devices have to be powered.
@artur198468 жыл бұрын
+Andreas Spiess Thanks! It got a bit clearer. Actually, I was thinking about deploying an outdoor weather station based on solar power and connecting to it multiple sensors (temp, humidity, pressure etc.)
@AndreasSpiess8 жыл бұрын
That should be no problem. You need a rechargeable battery, some sort of solar panel with a regulator, and an Arduino. The Vcc of the sensors can then be conneted to the 5V or the 3.3V rail of the Arduino (depending on the needs of the sensors). The same applies to an ESP8266 if you need WiFi to connect your weather station.
@XerotoLabs9 жыл бұрын
very clear and thorough . i like how you did the bus. i think the fastest i have pushed a UNO and Nano was 400hz in I2C . for most things its 1 line of code . i was driving 2 dual Adafruit stepper motor control boards and a OLED on 1 buss .
@AndreasSpiess9 жыл бұрын
+XerotoLabs I never looked on bus speed, because I never run into problems which I was able to attribute to speed issues. So, it is good to know how fast it goes. Usually, I had more issues with some sort of overall functionality... I use the "bus principle" with hot glue for many other things like power supply or debugging. This topic is on the list for a future video.
@XerotoLabs9 жыл бұрын
+Andreas Spiess i looked up what i did last time for faster speed for stepper motor controls. : in your setup() , use this TWBR = ((F_CPU /400000l) - 16) / 2; // Change the i2c clock to 400KHz
@AndreasSpiess9 жыл бұрын
+Andreas Spiess Good to know and very simple. I think, to include this line of code in each sketch is not a bad thing to avoid any speed issues.
@XerotoLabs9 жыл бұрын
+Andreas Spiess i think you have to have Wire.h included too , but i think you need that just for I2C anyhow . I'm not sure why the default (IIRC) is 100KHz , i wonder now if there are other timing issues like on a ESP 8266 using I2C is supposed to some how slow the WiFi , i have not tested that . I have to say i like your buss on a wire . gives me reason to order some colored headers now.
@victorarmani66609 жыл бұрын
Hi Andreas,I'm in the process of building a heat exchanger that requires 45 SHT31 sensirion sensors to measure temperature and humidity accurately. The sensors have i2c and voltage output capabilities. I prefer to use i2c, but would I be able to connect this many sensors? Also, I'll need the wires to run from within the tubes to the outside of the heat exchanger to the controller i.e. arduino, rasberry pi etc. The maximum length of cable is 900mm. Would this distance be of concern i.e. noise, interference etc? I'm not worried about cost, but would like to purchase equipment that would definitely work for my project. I would appreciate your thoughts. Regards,Viktor
@AndreasSpiess9 жыл бұрын
+Viktor Armani Hi Viktor. 1. Theoretically you can connect up to 127 devices to the I2C bus. But all have to have their own address. Unfortunately, a SHT31 can only select between 2 addresses. So, you only can connect two devices to one I2C unless you find another way to select between them. (see chapter 3.4 of the SHT3x data sheet for a proposal). This proposal needs a distinctive line to each sensor in addition to the 4 wires of I2C. www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity_and_Temperature_Sensors/Sensirion_Humidity_and_Temperature_Sensors_SHT3x_Datasheet_digital.pdf 2. I think, 900 mm is way too short. See this aricle where they were able to get up to 100 meters: www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus/frequently-asked-questions/i2c-faq.html Hope this helps ;-)
@victorarmani66609 жыл бұрын
+Andreas Spiess Thanks for your detailed response. I've sorted out the multiple devices/address issue by using a TCA9548A 12C multiplexer. The second part I'm still working on i.e. length of cable/s.
@yousef300014 жыл бұрын
Great information. I want to use 9 Laser measuring sensors ( VL53L0X sensor ) in 1 Arduino mega controller. I need to see the results and read them at the same time. how possible?
@AndreasSpiess4 жыл бұрын
Search for i2c multiplexer
@DevineIshaq1078 жыл бұрын
Andreas it was intuitive . gave me a lot of insite and I am on the gateway to build the robotic suit for my grand child ,, as he has walking issues. Uncle google has many sketches for IMU 6500 but all of them give errors and are erratic. In my project there are 6 steppers for ankle knee and thigh and one for the back swing left right front back as he is not stable. will be using imu for his stability and will manage his walking . It is a difficult project and will need your generous input for using the i 2 c as there are too many things to take care of 3 imu units 8 steppers and walking route en turn around sitting standing etc etc. I am hoping for a generous Charity of knowledge Please
@AndreasSpiess8 жыл бұрын
Good luck with your big project!
@andrekotze60505 жыл бұрын
Hi Andreas, I do not know how many, but I have watched A LOT of your video's. CHEERS for the good work you do!!! always well presented!!! I have a question. Can one add libraries, initialise peripherals (LIKE LCD) or restart a device from code without resetting the arduino? Lets say my LCD lost sync because of momentary power loss, how can I get this going again with code?
@AndreasSpiess5 жыл бұрын
You could maybe try to initialize the LCD from time to time. But this most probably will result in flickering. So maybe you connect both power supplies. Then both will lose power at the same moment.
@gouthamvirigineni3488 жыл бұрын
Sir I am a big fan of your blog. Presently I'm working on a project called gesture glove. In this project i want to integrate 5 MPU-6050 Sensors. The problem is I could connect only 2 MPU's, as MPU-6050 has only 0x68 and 0x69 addresses. Could you please tell me how to connect 5 MPU's to one arduino nano using i2c bus process.
@AndreasSpiess8 жыл бұрын
Thanks for your comment. You can use this chip to solve your problem: www.nxp.com/documents/data_sheet/PCA9547.pdf
@Manjuju1237 жыл бұрын
Goutham Virigineni I am having the same question but couldn't you just pull the address pin to a high using a digital io on the sensor you want to read and leave the other 4 sensor address pins to low? This should work right?
@gouthamvirigineni3487 жыл бұрын
Yes it worked for me by using a multiplexer IC, I was able to select the required addresses. I used different array's for storing different sensor's data. I used a multiplexer in order to reduce the number of pins to address the different sensors. Please feel free to visit my channel (goutham virigineni). Th@nk you.
@hubertmargreiter35084 жыл бұрын
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?
@AndreasSpiess4 жыл бұрын
You can try it with I2C (one as a master, the other as a slave. I did this in an old video where I had 3 ultrasound detectors connected to a ATTiny asa slave. Or you use Serial. I use an ESP32 and WiFi...
@hubertmargreiter35084 жыл бұрын
Thanks, I will check :)
@s-max32776 жыл бұрын
Hello for monitoring two voltage 0-100V or 5-100V wath i2c ic suggest ?
@AndreasSpiess6 жыл бұрын
I do not work with such high voltages, so I do not know.
@s-max32776 жыл бұрын
Andreas Spiess need use Analog input ? Digital is impossible ?
@MrJovanotti7 жыл бұрын
Very helpful explanation, as usual. I have two I2C 1602A LCD having the same address (lucky right?). There is any way to change the address of one them in order to use them as "multiple devices? Thank you.
@AndreasSpiess7 жыл бұрын
Check if your i2c boards have pads named a0, a1, or a2. They can be used to change the addresses
@MrJovanotti7 жыл бұрын
Done. Thank you :)
@Elettronica-xt7nm6 жыл бұрын
Beautiful Video, very interesting. I wanted to ask if it was possible to manage 32 relays over WiFi with more MCP23017. Thank you very much for the attention.
@AndreasSpiess6 жыл бұрын
Seems to be possible with a Pi. So it also should be possible with an Arduino: kzbin.info/www/bejne/o2mWhpeNa5ybjLs
@jonvannatto9 жыл бұрын
Again, great information in this video. Are you able to share the setch for this project as I have all the components and would like to build it. Also thanks for the link to the I2C Scanner. Very handy.
@AndreasSpiess9 жыл бұрын
+Jon Vannatto I put the example sketch used on github: github.com/SensorsIot/I2C_1-Video
@RahulKhurana858 жыл бұрын
I tried connecting 2 I2C devices (which are same), but in the scan it shows only one address. So is it normal?
@AndreasSpiess8 жыл бұрын
+Rahul Khurana yes, of course, if you use identical devices. To connect them at the same time to the same bus you need to change the address of one of the devices. Most modules have a possibility to do so (usually set a pin high). It should be described in the description or in "google". Come back if you do not find the info.
@RahulKhurana858 жыл бұрын
+Andreas Spiess Thankyou very much. It works
@AndreasSpiess8 жыл бұрын
+Rahul Khurana Good!
@RahulKhurana858 жыл бұрын
+Rahul Khurana Actually I still have one problem. I want to use 4 to 5 MP6050, with UNO. Here we have example for 1 sensor (playground.arduino.cc/Main/MPU-6050). Is it possible? If yes then do you have any example of code , as I am beginner in coding. I tried alot googling it, but found no useful info.
@AndreasSpiess8 жыл бұрын
+Rahul Khurana This is not easy, bcause the 6050 only can have 2 addresses. So you need a trick which is not easy for a beginner. I had another guy asking for something similar and maybe, I make once a video. But not in the near future. I cannot explain everything, but you basically connect eachaddress selection pin of the 6050s to a different data pin of the arduino. Before you connect, you have to set the right pin to select the 6050. With the 6050 there is another problem: You have to calibrate each sensor and store the calibration values. Otherwise, they are not exact. Al-in-all, this is not a project for a beginner (at least, that's what I think)
@talha_anwar6 жыл бұрын
thanks for such an awsome video. i wish to know if i need data from two sensors simultaneously, how would it be possible. i need this data then transferred to excel
@AndreasSpiess6 жыл бұрын
Maybe you watch my video about transferring data from Arduino into Excel.
@simnsch7 жыл бұрын
Any chance to use 5 different I2C sensors with a TFT ILI9320 Driver?
@AndreasSpiess7 жыл бұрын
I do not know, but I think, this TFT controller has no I2C. connection. So, the sensors and the display have nothing to do with each other.
@simnsch7 жыл бұрын
Yes, you are right. The TFT connects as it is, and the I2C sensors will go through the same bus. The components worked well when tested individually, and the puzzled thing is when all of them runs at the same time the TFT will not run. Do you have any idea why?
@AndreasSpiess7 жыл бұрын
No. This cannot be found out over distance.
@simnsch7 жыл бұрын
Thank you for your reply and help. I will sort it out and perhaps let you know again if I have successfully done it.
@3dmixer5525 жыл бұрын
can I use 2 INA219 on 1 I2C Bus using ESP32?
@AndreasSpiess5 жыл бұрын
The INA219 offers 16 slave addresses. If you chose two different addresses it should be possible. Please read the data sheet
@martinkuhnl88162 жыл бұрын
Andreas, das ist eine tolle Info, danke!
@AndreasSpiess2 жыл бұрын
Gern geschehen
@reednoel94186 жыл бұрын
@andreas Spiess, Please show me, how many LCD i2c can connect with Arduino Mega2560. I want connect with 14 lcd I2C, how to promotion. Thanks
@AndreasSpiess6 жыл бұрын
This is a big topic. You have to google. I2C has 126 addresses, but most devices only have 1, 2 or 4 selectable addresses. So you can only connect this number of devices to one I2C bus.
@mousumimandal54645 жыл бұрын
Sir, i need to interface three DAC modules with arduino that will produce sine waves at 120 degree phase shift with variable frequency. . I m bit confused with it.. can u help me kindly? ::")
@AndreasSpiess5 жыл бұрын
Maybe you solve the problem step after step. Find a DAC. Connect it. Produce a sine wave and check if you get to the needed frequency...
@alexteh70677 жыл бұрын
First of all, love your channel, really eye opening and you do go into so much details. I'm wondering how to connect a single Arduino Mega to one I2c Bus to conect to multiple sensors (eg room temperature sensor, water temperature sensor, humidity sensor, automation of pumps in real time and storage of data as well as writing the sketch for them. Thanks in advance
@AndreasSpiess7 жыл бұрын
You can connect up to 126 I2C devices on one bus (theoretically).
@alexdehmel5354 жыл бұрын
Super Channel, vielen Dank für die tollen Tutorials!
@AndreasSpiess4 жыл бұрын
Gern geschehen!
@w.e.47594 жыл бұрын
Does any one know how to identify and change address on the same modules such as VL53L0Xs? The problem with using I2C on the same type of module is that all of the same modules has the same address, which Arduino thinks it is reading only one device. I don't know how to change the addresses from hardware to different address in software. For example: VL53L0X has address of 52. If I connect six VL53L0Xs on I2C, the Arduino UNO recongnizes as one VL53L0X, instead of six. Therefore, I need to change all VL53L0X as V1 = 01, V2 = 02, V3 = 03, V4 = 04, V5 = 05, V6 = 06. I can try to use onboard pins to designate them as pin2 = SCL, pin3 = SCA, pin4 = SCL, pin5 = SCA, etc...; but this method leaves me with short on pins for other modules. I also try PCA9685 PWM, but it still read the same address. UPDATE: This link solves my problem: forum.pololu.com/t/multiple-vl53l0x-code-and-wiring-with-distance-reading/12609
@Dirt33breaks4 жыл бұрын
DUDE! I have the same problem, I have been looking for this for ages, everyone normally thinks we are using different devices lol, in my case i have 2x ac5600 magnet sensors (for dj controller jog/scratch wheels/platters), I am still yet to find how to change the addresses on my sensors, there is no basic code out there for ac5600 just libraries
@w.e.47594 жыл бұрын
@@Dirt33breaks forum.pololu.com/t/multiple-vl53l0x-code-and-wiring-with-distance-reading/12609 This web page solved my problem, but I don't really understand that well. It has to do with XSHUT connection. Maybe the Swiss Accent Guy will come out with a video for it. I would but I don't have Swiss accent. :p
@artur198468 жыл бұрын
Das Video war wunderbar! I was intersted in connecting multiple devices to a single Arduino and came across your video. Very informative. Thank you a lot. By the way, how many devices (practically) can run a single Arduino nano?
@AndreasSpiess8 жыл бұрын
+Arthur K I never tried. If properly terminated it should be possible to connect more than 10 devices with a short bus length. Theorretically it is much more. Details are discussed here: electronics.stackexchange.com/questions/181953/how-many-i2c-slaves-can-a-i2c-master-support
@Life--and--Living6 жыл бұрын
17 MPU6050 sensors connected to a single Arduino uno. is this possible? Please reply
@AndreasSpiess6 жыл бұрын
Everything is possible, but not simple. and maybe slow. Maybe it is easier to use one Arduino per MPU
@Life--and--Living6 жыл бұрын
thanks powering all the arduinos would be a problem.
@AndreasSpiess6 жыл бұрын
Then you have to google i2c multiplexing.
@Life--and--Living6 жыл бұрын
Thank you so much
@ManuelCastillo-kq3xy6 жыл бұрын
Hi, I tried to use your i2c Scan, but not compiling. Error is: Arduino:1.8.7 (Mac OS X), Tarjeta:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Enabled, 4M (3M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200" /Users/manuelcastillo/Documents/Arduino/i2c_scan/i2c_scan.ino: In function 'void I2Cscan()': i2c_scan:171:7: error: 'TWBR' was not declared in this scope TWBR = (F_CPU/(speed[s]*1000) - 16)/2; ^ exit status 1 'TWBR' was not declared in this scope I use a ESP8266 Lolin v3. I need use 3 devices with i2c. Help me, please.
@AndreasSpiess5 жыл бұрын
You have to search for an I2C scanner for the ESP8266.
@mohamedfezari49556 жыл бұрын
Thanks for teh Video, I wouldlike to connect 3 3-D accelerometers MPU6050 to one arduin using I2C Bus how can I do it
@AndreasSpiess6 жыл бұрын
MPU6050 only have 2 selectable addresses. So it is not easy to connect 3 to the same I2C bus
@umeruz7 жыл бұрын
i need to monitor 100 DS18B20 temperature sensors using a central arduino. is it possible..? if yes, please help me out.
@AndreasSpiess7 жыл бұрын
I never worked with this device. So, I do not know. Maybe you check if somebody did it with 10 and see, if there were any problems and how he resolved it.
@fastfest24254 ай бұрын
how do you know what device just by hex key?
@AndreasSpiess4 ай бұрын
I showed a list with sensors and their hex code in the video
@PetrasL_19767 жыл бұрын
Hi, I saw you have built your own i2c sensor with 3 ultrasonic sensors. But you did some programming on atiny, soldering and so on. Just wondering, if there are already build "converters/adapters" or something like this for regular sensors like "Soil Humidity Sensor" (lets say this goo.gl/RS92Fx). Thanks!
@AndreasSpiess7 жыл бұрын
What is your intended scenario? usually, these sensors are connected directly ot a analog or digital pin of a Arduino without ATTiny needed.
@PetrasL_19767 жыл бұрын
Yes its ok to connect them directly. Just thinking what if i need 10 of them? I do not have 10 analog on inputs on arduino mini. And scenario is apsolutely crasy: i have 10 flowerpots with plants and i want to keep different moisture for each of them. Watering will be automated also... :) Probably i need separate arduinos or esp for each of flowerpot, but then i need 10 water pumps too for watering...
@AndreasSpiess7 жыл бұрын
There are many different solutions to that. But if you have 8 ADC pins on one Arduino mini and you pay 4$ for such a mini, each plant costs only 50c. Which sounds reasonable to me. One ESP8266 per plant and a connection via Wi-Fi sounds more expensive... But the pump/walve and wiring issues are probably the biggest ones.
@ecemcl14977 жыл бұрын
Hello! We are working on a project using two mpu6050, temperature sensor, and a pulse sensor. How to put these all together into one Arduino Nano? Please help us. Hoping for your answer. Can we talk thru e-mail? :)
@AndreasSpiess7 жыл бұрын
You can connect many sensors to one I2C bus of the nano. Just make sure that the two MPU6050 have different addresses (ADO pin)
@MadTinker7 жыл бұрын
New to Arduino and this was great! Can I ask what you were using for pressure and temperature display?
@AndreasSpiess7 жыл бұрын
Thanks! I used a GY-65 board containing a BMP085 chip
@MadTinker7 жыл бұрын
Andreas Spiess Thanks for the quick response. I should have been clearer in my question. I was interested in the display and not so much the sensors.
@AndreasSpiess7 жыл бұрын
This is the display: bit.ly/2h2831l
@mammoumanel32677 жыл бұрын
i have 20 sensors with the same adress, how can i connect them?
@AndreasSpiess7 жыл бұрын
Something like that could help: www.nxp.com/documents/data_sheet/PCA9547.pdf
@Son_of_Yahuah5 жыл бұрын
I have a project where Im interfacing with at least 12 arduinos 1 being the Master .I think I have to use pull ups for power or a main power hub for all the arduinos . I like the part in the video about finding the names of each and having to write the code for each one ,,,trust me its just as bad as Im explaining it I already have a head ache lol. thanks for the video
@AndreasSpiess5 жыл бұрын
You are welcome. Seems to be a quite big project ;-)
@adrianglezmahe5 жыл бұрын
Nice and simple explanation !!!
@AndreasSpiess5 жыл бұрын
Thank you!
@Abbici3 жыл бұрын
Sorry for the bother... GREAT TEACHER! Which device is best suited to extend both input and output pins for ESP32-CAM? Thanks and sorry more! @}-,-'--------- Gianfranco
@AndreasSpiess3 жыл бұрын
Search for "port extender ESP32" and you will find the needed info. You will need and additional IC.
@Abbici3 жыл бұрын
@@AndreasSpiess Thank Youuuu
@legudep6 жыл бұрын
How long distance maximum sir?
@AndreasSpiess6 жыл бұрын
A few meters. Maybe you look at the specifications of I2C bus.
@SathishKumar-if7ow5 жыл бұрын
How can i say thank u....🙏🙏 THANKS from the heart💚 Your experience and way of explaining....nut shell like me too understand... ( thank u internet & many unknown people across the world helps me to learn ) Thank U sir..
@AndreasSpiess5 жыл бұрын
:-)
@NeoMoonlighter6 жыл бұрын
Thanking the gods for guys like you helping me out with my project (y)
@AndreasSpiess6 жыл бұрын
You are welcome!
@josephmarkjimenez13087 жыл бұрын
Hi, I am connecting a MLX90614 infrared sensor and OLED I2C display (SH1106) to I2C bus of Arduino Nano. I am using the following libraries: i2cmaster.h and MicroLCD.h. Unfortunately, my code doesn't work upon boot-up or reset. The OLED only displays if before powering up or resetting the Arduino, I disconnect the MLX90614's pins connected to SDA and SCL lines of Arduino and then connect them after Arduino is powered or reset. I'll post the code below. I hope you can help me with this. #include #include LCD_SH1106 lcd; void setup() { i2c_init(); //Initialise I2C bus PORTC = (1
@AndreasSpiess7 жыл бұрын
I cannot help here because I have no experience with these devices. Did you check the logic levels with a oscilloscope? Maybe you watch my video #76 about logic analyzers. I would use one of these to sort out this problem, because you do not know if it is a hardware or a software issue. I would also try once without pull-ups (if not done yet).
@foxbatx7 жыл бұрын
Thanks for sharing and putting a very informative presentation. I truly learned something. - Cheers -
@AndreasSpiess7 жыл бұрын
Thanks for your nice words!
@Ckcdillpickle4 жыл бұрын
couldn't you have done this project without a I2C Bus? Newbie at arduino and electronics in general, discovered I2C and I have a lot of interesting Idea that I don't know how to execute
@AndreasSpiess4 жыл бұрын
No. Because the video was about I2C bus. I would start with a simple project. There are hundreds of such projects on the internet
@BGLENN-dp4tx6 жыл бұрын
Much appreciated AND educational. - Bill
@AndreasSpiess6 жыл бұрын
Thank you!
@badmonkey913 жыл бұрын
Have you ever considered becoming a teacher? ☑ 'Put you to sleep' cadence ☑ Tell - Don't show ☑ Use abstract/boring diagrams ☑ uninteresting graphics to linger way too long You hit all the checkboxes - Bravo!
@AndreasSpiess3 жыл бұрын
Thank you for your open feedback!
@aryakvn60518 жыл бұрын
i have a problem . i have 2 arduinos connected to each other via TX and RX . a display is mounted to one of them . so the circuit is like this ------------- -------------------------------------------------- | GND--------GND | | NANO| | | | | | | | | | UNO(R3) with mcufriend | | TX-----------RX display shield | | | | | | RX----------TX | |_______| |_____________________________| and i have a bluetooth module ( HC-50 ) which i want it to be connected to the NANO and bluetooth module will be only sending data to the Nano . the receiving from the nano to bluetooth is not important . so the UNO and the HC-50 will both sending data to the nano . how can i make that happen ? ( the D11-8 is not available on the nano because i have LEDs connected to them).
@AndreasSpiess8 жыл бұрын
+Arya Kvn If you need two serial connections, you have to use software serial for the slower if the two connections of the Nano
@aryakvn60518 жыл бұрын
i tried it . IDK why it didn't worked
@AndreasSpiess8 жыл бұрын
+Arya Kvn Remote diagnostics is not possible in this case. Try zu separate the system in small parts. E.g. Try to validate if the software serial and the Bluetooth module works independently before connecting them.
@Dextermorga8 жыл бұрын
so many great videos, thank you for your time and afford.
@thesci-fibro58353 жыл бұрын
Effort*
@MagivaIT5 жыл бұрын
woah what happened, it sounded like the speed of your voice and excited had been slowed down, look forward to normality soon
@AndreasSpiess5 жыл бұрын
This is one of my first videos ;-)
@ismailkhan8874 жыл бұрын
Thank you. That is what I was looking for.
@AndreasSpiess4 жыл бұрын
You are welcome!
@pablocolladoavila31627 жыл бұрын
excellent explanation!!! and great video
@AndreasSpiess7 жыл бұрын
Thanks!
@JanHans8 жыл бұрын
i love this video. never expect this would work against being homesick.
@AndreasSpiess8 жыл бұрын
+Jan You have to help me with the connection between I2C and homesick!
@JanHans8 жыл бұрын
Ich lebe momentan in Irland und da hatte ich die komische Idee, eine Eier-Inkubator-Steuerung zu bauen. Als kompletter Anfänger schaue ich viele Videos bei KZbin an. Deines, weil ich ein I2C-Display und ein RTC in meinem Projekt verwenden möchte. Mit dem Schweizer Akzent war das dann besonders nett zu schauen. Danke!
@AndreasSpiess8 жыл бұрын
+Jan aha. Jetzt verstehe ich! Wir waren letztes Jahr in Irland in den Ferien. Uns haben Land und Leute sehr gefallen.
@JanHans8 жыл бұрын
Irland ist perfekt zum Ferien machen, leider aber weniger gut, um hier zu leben. Politisch kommt das Land wenig voran. Es gibt grosse Defizite, was die Infrastruktur anbelangt...
@AndreasSpiess8 жыл бұрын
Das ist schade. In den Nachrichten hören wir, dass es Irland wirschaftlich gut gehe und dass die Arbeitlosigkeit sinke. Und das wäre ja schon mal was verglichen mit der Situation kurz nach der Finanzkriese...
@fraber66345 жыл бұрын
Sehr gut gemacht. Gibt's die Themen auch in deutsch?
@AndreasSpiess5 жыл бұрын
Ich weiss nicht. Die meisten Elektronikvideos sind in Englisch
@fraber66345 жыл бұрын
@@AndreasSpiess ich meinte von ihnen... und ihrem Kanal.
@AndreasSpiess5 жыл бұрын
Mein Kanal war von Anfang an als ein internationaler Kanal geplant. So erreiche ich viel mehr Zuschauer.
@kiranshashiny7 жыл бұрын
Can I connect multiple DHT -11 temperature sensors to the Arduino's IIC bus. The problem is they do NOT have a SCL pin, but only a DATA pin. How do I go about it.