#42 Build your own I2C Sensor with three Ultrasonic Sensors for Arduino

preview_player
Показать описание
In this video we will build an ultrasonic sensor for three directions. The device behaves like an I2C sensor.

The knowledge provided in this video includes:
- Ultrasonic Sensors and ATtiny85
- Wire Library (I2C protocol) on ATtiny85
- The I2C protocol itself
- How to debug signals using oscilloscope and logic analyzer

Links:

Рекомендации по теме
Комментарии
Автор

Greetings Andreas. Thanks for explaining. Looks like I'm late to the party, but I would be very interested in a video comprehensively explaining fuse bits.

hoodafukisalice
Автор

You always have the answer for my questions, thanks a lot for dedicating your time for us!

gambiando
Автор

Now it's nine months later and I also watched this great video. Nice work! Some time ago I ordered both attiny85 and attiny13A. Great little chips! The tiny13A is cheaper, but more limited (eg. less memory). It can be programmed in similar way as the tiny85. Of the two batches 13A's I ordered from different suppliers, one batch was not working. I found out their fuses were set differently and I had to make a high voltage programmer (using a 12v dc-dc boost converter) to reset them to a programmable state. I'm looking forward to see your 12v programmer, so consider this my delayed vote. (Or maybe you already made it, haven't checked it yet).

MaxintRD
Автор

The reverse footage on 2:28 made me laugh =^)

jesuishalil
Автор

Very good, and could still add a checksum byte

Rtek-zvlr
Автор

great! Now I am inspired to build my own I2C! Thanks for your explanations.

MrLunarpulse
Автор

Gruezi Andreas, you've taught me about electronics and now the saying Gruezi YouTubers is stuck in my head! ha. good stuff mate, keep it up!

cybernetic
Автор

An other great video, has me wondering why i never think to use these small cheep chips, especially when they have a built in crystal / clock. ., and yep sure would like to see high voltage programmer in action

XerotoLabs
Автор

I have tried hard to make this work for two days now. After a lot of debugging with use of software serial on the attiny85 and using simplified test code with only one sensor etc. I came to the conclusion that the onRequest is not triggered by the i2c master. Looking in github for TinyWireS it looks like other people have the same experience with the newest release of TinyWireS. The feedback you get on the serial monitor is only 255 meaning that there is no responce form the Attiny85.
I used an older version from here:
... and Andreas code for this project started working like a charm.
At least I learned a lot about debugging attiny85 code using the software serial library:

And thanks a lot, Andreas, for your inspiring YouTube videos !

I am a big fan of the very inexpensive ESP8266 chip from China myself :-)

olavgullaksen
Автор

+1 Interested, thanks for explanations!

markmarkin
Автор

I enjoyed your video. It was very helpful. Thank you!

rmhutchins
Автор

Firstly great video. This would be very useful to a lot of people I think but I am still unsure of a few things. I would love to see the full source code to your I2C sensor? Any chance you can publish the Attiny85(slave) Sketch and the Arduino (master)?? I'm gathering you had pull-up resistors on the I2C lines as well? Thank you for the awesome videos you put out. I've truly enjoyed them. Cheers from Australia!

ElectronicsAustralia
Автор

Great video again but not 100% sure about the data being retrieved from the ATtiny. This gathers the data on its I2C using three addresses for the three sensors but now you have to send the data off chip to another uP...

Graham
Автор

I know I'm way late since you did this a couple years ago, but if your looking for video ideas and have not already done it yet then please do the video on setting the fused and and any other info on the A T chips. Also please link them here on this video.

vonries
Автор

Hi Andreas, very nice video. Could a pcf8574 chip be used instead of the ATtiny ?

AndrewWalsh
Автор

Can we use sensors like lm35, heartbeat sensor etc., which donot have I2C available?? IF yes, Please guid me through in advance...!!

gudimetlakowshik
Автор

Great video! What about take care of this three sensors in your main Arduino instead of creating a new board? You could trigger each sensor separately and catch the echo return using any Arduino port change interrupt without blocking your main code, of course you can't use pulseIn function as library uses. Have you thought about it? Keep producing nice videos, your accent is funny ;)

RonivaldoPassosSampaio
Автор

Hey! thanks for your helpful video!
I have question. Why do you use I2C for these sensors?
they don't have SCL and SDA pins.
is it because you are using ATtiny? (actually I don't know about ATtiny) so if I use an arduino uno to control the robot, then could I use I2C to control these distance sensors?

jeffhan
Автор

my usbasp don't born fuse bit and don't upload directly - i have to use upload using programmer and then just hex going to micro not fuse bite. why?

prmajiq
Автор

Andreas, How can I adapt your code to work with I2C sensors, such as the VCNL4010? I am trying to connect >20 I2C sensors (all with the same address) to an ESP32 without using a mux. I could use something like a LTC4316 I2c address translator that would allow multiple slaves to coexist on the same bus. But I have read a few posts that suggest using a PIC or Attiny at each sensor to provide a software controlled I2C address.

RoderickKhan