How to use Atmel ATtiny85 with Arduino || Arduino tutorial

  Рет қаралды 28,393

ElectronFun.com

ElectronFun.com

Күн бұрын

In this video I'm demonstrating how to program and use Atmel ATtiny85 with Arduino code. If you have a small Arduino project and need only few input and output pins, you can substitute the 28-pin Atmega8/168/328 microcontroller with the small, 8-pin ATtiny85 chip. You'll save some space, simplify your project and decrease power consumption.
The ATtiny85 microcontroller offers digital, analog and Pulse Width Modulation pins.
By default Arduino IDE doesn't support the ATtiny chips, but High-Low Tech Group at MIT Media Lab created their own libraries and shared them publicly. You can download them free of charge here:
github.com/damellis/attiny/ar...
This tutorial is based on High-Low Tech Group's explanations found on their website:
highlowtech.org/?p=1695
See all my Arduino tutorials here:
• Arduino tutorials
Subscribe to get notified about my new videos:
kzbin.info_c...
----------------------------------------------------------------------------------------------
KZbin channel: / electronfuncom
Google+: plus.google.com/+Electronfuncom
Facebook: / electronfunpage
Twitter: / electronfun
Website: ElectronFun.com
----------------------------------------------------------------------------------------------
Video, edit, voice by Chris Lorkowski
Music by Jason Shaw - Rhastafarian
www.audionautix.com
Sound effects Recorded by Mark DiAngelo - Blop
soundbible.com

Пікірлер: 79
@Miata822
@Miata822 6 жыл бұрын
Just now saw this video. So Darned Cool! Working on a project for a tiny embedded system w/ low skills and no budget. This is the perfect answer! Thanks!
@ElectronFunCom
@ElectronFunCom 6 жыл бұрын
I'm glad you like it! Thanks for your comment :)
@Bradman175
@Bradman175 8 жыл бұрын
Cool I never knew you can do that. Makes my life making small circuits much easier.
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+Bradman175 That's great :)
@DevineIshaq107
@DevineIshaq107 8 жыл бұрын
This was incredible set of instruction. Thanks
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+Ahmed Ishaq Thanks :)
@northshorepx
@northshorepx 8 жыл бұрын
Thank you so much! I've just got into Arduino and in 6 minutes you've opened my eyes/given me a massive paradigm shift in understanding why this is such a powerful and versatile system. Could you tell us some more about what you've learned in real world terms of the power and battery requirements for this small microcontroller please? Ps your dog is very sweet!
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+northshorepx Thanks a lot, you've just made my day! When it comes to the power requirements of the ATtiny85 - the datasheet says is should use approximately 300uA when idle. I know it's not always easy to get such results in real life. See this thread: electronics.stackexchange.com/questions/124723/attiny85-power-consumption-double-expected - it explains a lot. Tina the dog says: "Thank you so much!" :)
@MagiKnightOne
@MagiKnightOne 8 жыл бұрын
Impressive and simple tutorial. Thank you.
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+José Angel Sánchez Pérez Thank you :) I try hard do keep all my tutorials simple and understandable for everybody.
@frankroni
@frankroni 7 жыл бұрын
Nice clear explanations. I have several Arduino projects that I hope to transfer to ATTiny's.
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Thanks a lot! Good luck with your projects :)
@jimviau327
@jimviau327 7 жыл бұрын
Thanks for your help. Nice Vid!
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Thank you Jim :)
@jesusreignonhigh6732
@jesusreignonhigh6732 5 жыл бұрын
I'm using Attiny84A, how do you do the analogRead on it? Mine doesn't seem to work.
@frankroni
@frankroni 7 жыл бұрын
Question.... There are 8 pins on an ATTiny85. Vcc, Gnd and Reset, does that leave the other 5 pins for I/O? Thanks
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Yes, there are 5 pins, which can be used as I/O, see the pinout here: learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints.
@oxenforde
@oxenforde 8 жыл бұрын
Cute doggie chase scary duck!!! Also, a very helpful video.
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+oxenforde Oh yes, she is so cute, thanks a lot for watching and your comment :)
@PinRenLED
@PinRenLED 7 жыл бұрын
Nice Vid!
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Thanks a lot :)
@irfanaslam5859
@irfanaslam5859 8 жыл бұрын
The best video
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+irfan aslam Thank you :)
@l9shi236
@l9shi236 7 жыл бұрын
could i also use a 100µf compacitor because i didnt have a 10µf here?
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
It should work for most applications.
@thevivekmathema
@thevivekmathema 9 жыл бұрын
PLEASE HELP!!! [URGENT!!!] Can I use 25V 2.2 uF electrolytic capacitor instead of 50V 10uF capacitor? i don't have the 10 uF cap and I need to complete the project urgently. i worry that I will destroy the Chips!.. Thank you
@ElectronFunCom
@ElectronFunCom 9 жыл бұрын
Vivek Mathema Hi, your capacitor doesn't have to be rated for 50 or even 25V - in this case 10V is more than enough. I'm not sure if 2.2uF cap will work, but you can try with no fear - you won't damage the chip. If the capacity turns out too small, you can always connect 4 or 5 2.2uF capacitors in parallel and you'll make a capacitor close to 10uF.
@volodymyrishchiv4929
@volodymyrishchiv4929 7 жыл бұрын
Is it also possible to program Atmel ATtiny15A using same technic?
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
I doubt this would work with ATtiny 15A, but can't be sure. I simply couldn't find much about programming the 15A.
@InventionTherapy
@InventionTherapy 7 жыл бұрын
What is the best Arduino to start learning on?
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
I'd probably say Uno. It doesn't have all these extra features like e.g. Bluetooth, but it works with 5V and there are tons of tutorials for Uno.
@RahulSingh-my7vx
@RahulSingh-my7vx 5 жыл бұрын
sir when i program it i get avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check." please help me about it
@jenpau0269
@jenpau0269 7 жыл бұрын
arduino 1.8.3 didnt work i cant see the attiny in board, can you help us?? please thank you
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Go to create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829 and read section entitled "Adding ATtiny85 Support to Arduino IDE".
@FidelMorenoC
@FidelMorenoC 9 жыл бұрын
excellent video, I was wondering...can I reuse the attiny85?
@ElectronFunCom
@ElectronFunCom 9 жыл бұрын
Thank you! Yes, you can upload another sketch and reuse the chip in a new project.
@malagiyawanna
@malagiyawanna 8 жыл бұрын
can anyone help me to do this. what i want is when contact get open ( assume a reed switch) then LED get blink 10 S and off.I want to use ATtiny85. Thank you.
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+Manjula Alagiyawanna Have you found your answer to your question?
@electrolove7229
@electrolove7229 8 жыл бұрын
If we disconnect the ATtainy85 with arduino uno after programming, and give the power supply with out source, will it work as the program?
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
Yes, the sketch will on it's own.
@pepijn_m
@pepijn_m 7 жыл бұрын
nice video, can you explain how to use atmel studio with the attiny85?
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Thanks a lot! I'm afraid Atmel Studio is a subject to another video.
@100roberthenry
@100roberthenry 8 жыл бұрын
newb here...dumb question time, are the AT,s re-writable?...and if they are how do you burn it forever, ....sorry, big time newby, but dabbles with mostly audio electronics ....and would like to build/burn dedicated projects....cheers man. rob.
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+100roberthenry Hi, yes the Atmel AT microcontrollers are "re-writable". I don't think there is a way to burn your sketch forever, you can always burn a new one over the old one.
@100roberthenry
@100roberthenry 8 жыл бұрын
+ElectronFun.com briiliant, thanks for your reply, just another question, how do you shrink a project if it is physically using say, 6 analog pins, ? is there a bigver attiny for that?..sorry for dumb questions..thanks. rob,
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+100roberthenry There are no dumb questions, most of the time ;) Your question is not dumb. I'm afraid there are no ATtiny variants with 6 analog pins, but I guess you could use a shift register to get more analog pins.
@DavidHudman
@DavidHudman 9 жыл бұрын
Cool video! I need to start helping out the community with some videos like this. Although, my videos might contain to much bad information!
@ElectronFunCom
@ElectronFunCom 9 жыл бұрын
Thanks a lot! The more video creators, the better for the community. I think it's worth trying.
@gustavosilveira7065
@gustavosilveira7065 8 жыл бұрын
Hi, great video! But, how can I make a standalone? How I would use a battery? Thanks!
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+Gustavo Silveira Thanks a lot! The video is about making a standalone ATtiny85. When you upload your sketch to the chip, you don't need the Arduino Uno anymore - just replace it with a battery.
@gustavosilveira7065
@gustavosilveira7065 8 жыл бұрын
+ElectronFun.com But for the power supply, the attiny needs a voltage regulator? What kind of current it can handle? Thanks again!
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+Gustavo Silveira As far as I remember it needs 2.7-5.5V to operate, but if you want to use it with 20MHz oscillator it requires at least 4.5V. A buck converter or a voltage regulator would be a good idea. For the current output - it's limited to 40mA per I/O pin.
@PokfulamVillager
@PokfulamVillager 8 жыл бұрын
how many leds can be powered or controlled by ATtiny85?
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
Each I/O pin can deliver up to 40mA, so you can power a single LED from each I/O pin. Each such pin can control 1 LED or a group of LEDs.
@johnwans8792
@johnwans8792 8 жыл бұрын
can we program an ic in a different way than arduino??
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
+john wans Sure, you can use an external programmer (e.g. an AVR-ISP, STK500, or parallel programmer).
@BloodAsp
@BloodAsp 7 жыл бұрын
Why does the Atmel ATtiney85 not need a 16MHz crystal?
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
It has an internal crystal oscillator, so you don't have to use an external one. However, you can do it, if you need higher accuracy, or for some other reasons.
@shashanksathish9362
@shashanksathish9362 8 жыл бұрын
can attiny85 be connected to bluetooth module?
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
Sure it can, it's a shrunken Arduino.
@Jimnymudhunter
@Jimnymudhunter 8 жыл бұрын
put the folder (unzipped) in the folder as said and the poxy thing dont pick up the attiny in the list.. why?
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
Quite a few things have changed from 2014. Now you can install additional boards through Arduino IDE. Just follow this tutorial: highlowtech.org/?p=1695.
@SpeccyMan
@SpeccyMan 8 жыл бұрын
I would suggest you didn't rename the folder to remove the -master suffix! The folder name MUST match the name of the library and its header file.
@Jimnymudhunter
@Jimnymudhunter 8 жыл бұрын
+Nick B dw guys i used another video and it worked.. thanks anyways
@ElectronFunCom
@ElectronFunCom 8 жыл бұрын
Good to hear you managed to solve your problem :)
@Jimnymudhunter
@Jimnymudhunter 8 жыл бұрын
+ElectronFun.com 👍
@arnab_blue
@arnab_blue 6 жыл бұрын
Are you using ATTINY85, 8MHz or 20MHz?
@letsb3nameless665
@letsb3nameless665 2 жыл бұрын
doggy 😍
@ovalwingnut
@ovalwingnut 7 жыл бұрын
Very CoOL. I had no idea. SO TINY! I only wish my GF liked "tiny" things :O\ Speaking of her.. Damn, I MISS MY DOG.. (small dogs rock). Thank you for taking the time. Will check out your site.
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
Thank you! I agree - small dogs rock :) What happened to your dog?
@ovalwingnut
@ovalwingnut 7 жыл бұрын
Hi! re: Man's Best Friend(s). I had three but Old Man time caught with all of them, eventually :A Pomeranian, Shih Tzu and a long legged Poodle'ish something that was full of energy. One rescue, one stray that was living under a car at a 76 station and one from a litter. All the size of your "four legged bundle of joy" :) They all lived very long lives.. the Shih Tzu was ~18. I take consultation in the fact that it's life master plan. (but turtles can live to 100? I call foul! Not dissing turtles). However I don't think I will ever get over them leaving... a huge hole has been life in my life. Seeing your pup was a joy. Thank you for asking BTW. Best wishes to you and yours. Randy
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
OvalWingNut It's great to hear/read there are still people like you! Not many want to rescue a poor, homeless dog. I know how it hurts when you lose a dog, who is treated as a family member. Tina is my third dog. The first one was a Poodle, the second one a mongrel adopted from our local animal shelter - both lived for about 18 years. We simply love dogs and it's difficult to live without them. I hope you'll find a new dog friend, who would be able to fill the hole in your life.
@ovalwingnut
@ovalwingnut 7 жыл бұрын
Thank you. [Very] kind of you to say. It was a bit of a heavy subject I admit :o\ Not everyone understands, as you know. I beleive it's related to one's ability to feel "empathy". A very under rated emotion in today's world. Actually, your statement: "We simply love our dogs" says it all :O) You couldn't have summed up "pet empathy" much better. I do feel a bit more emboldened... However the trip to a animal shelter may be problematic, as I would [not] be able to leave without every single one. And that could present a completely different problem. However it's said: "When one door closes another door opens; but we so often look so long and so regretfully upon the closed door, that we do not see the ones which open for us.” [unknown author]. ---- THANK YOU for the time, energy and your words. Best wishes. R
@ElectronFunCom
@ElectronFunCom 7 жыл бұрын
I didn't know the saying about doors - it's really good. When it comes to empathy - I totally agree with you Randy. One day I realized that I'm not able to make friends with people, who don't like animals, or treat them badly. I simply assume that those who love animals are much better people. Thank you for your kind words and good luck! Chris
@mariuspetcu7482
@mariuspetcu7482 9 жыл бұрын
I am just starting playing arround with the Arduino for about 4-5 month so I don't know much about it . But I manage to right the code for the SOS morse code with an LED and a buzzer . On the other hand I don't know how to get the signal from RC into the Arduino . Basicaly I want to make a replica to these Open Source "Lost Model Alarm" www.plastibots.com/index.php/2015/01/01/quadcopter-enhanced-lost-model-alarm/ : Parts: ■ATTiny85 (An 84 or even 25 may work as well) ■Piezo buzzer (5V or higher) ■100 Ohm resistor ■LED (blue was used here - range is about 2.5 - 3.5v) ■Servo lead wire Tx Set-up: The Turnigy 9x Ch7 is configured to Pit Trim - which is Aux 2. Also note that you may have to reverse the channel if your values appear opposite when testing (see Tips below). To do this, navigate to the settings > Reverse section in your TX and reverse Aux 2. You can also see the trimpot change if you go to Display > Settings. When turned all the way CCW, the bar should appear filled to the right, and vise-versa as you turn it CW. ■I wanted to keep the AtTiny85 pins exposed for future updates. ■I also added an 100 Ohm resistor inline as the LED only needs about 2.5v. ■Set my Turnigy TX Ch7 using the Pit Trim (Aux 2). The values for Pit Trim range from 1043 (all the way CCW) to 1867 (all the way CW) ■The code watches the PPM signal and reacts as follows: ■If the TX is switched off (value falls to 0), trigger the alarm. For the Arduino code, I just look for any value less than 50 (this allows for some buffer). ■If the trimpot is turned up all the way CW, trigger the alarm. I also wanted to change the tone and beep rate depending on how high I turn the trimpot. The Arduino code does this by reacting for any value above 1500, and will trigger the faster beep above 1700 and slower beep above 1500. Tips: You can use the same code below to read the PPM values from your receiver. Simply uncomment the Serial.print lines and remove the rest of the logic. Connect your RX signal pin to the pin identified for RcPin (0 on the ATTiny below) and the RX black wire to GND on your Ardiuno. This assumes you have your Arduino connected to your PC/Mac, so don’t connect the red (5v) wire coming out of your RX to anything. Run the below sketch, open the serial window and watch the values being returned as you turn the trim knob. If they are not changing you need to check to ensure you have the right channel configured on your TX and you are plugged into the same channel on your RX. Also ensure you power up your Quad Rx. Enhancements: Having a range of values from a trimpot gives you a plethora of control options using a single channel. Ideas: ■You could configure the below code to trigger an external more powerful alarm when the PPM value is in a specific range (i.e. 1800 - 1850). ■Have it trigger a high intensity LED powered off the main battery pack using a transistor to switch the LED or blink it. ■Use the trimpot ranges to trigger different activities. For example, you could still have the alarm trigger when the Tx looses power (value = 0) and have a multi-coloured LED light strip that changes colours depending on values greater than 0. I hope these is helpfool . MANY THANKS in Advance
@ElectronFunCom
@ElectronFunCom 9 жыл бұрын
MARIUS Petcu I don't have access to a similar radio and it's rather difficult to hack a device without seeing it. I'm sorry I couldn't help you.
@profesorultraznit
@profesorultraznit 9 жыл бұрын
HELLO , So simple and efective . I need to make a beacon / recovery device on my RC submarine . All I want is to make a Sound (with a small buzer) and Light signal (with a white LED) - S.O.S. morse code , with the most simple and cheep microcontroler and Your example is the most simple I can found . Can You help me with the start code for it ?. The principle is simple : when the RC submarine loose the the RF signal for more than 3 sec , the device it should start emit the SOS morse code with the LED and the buzzer . THANK YOU very Much in Advance . All the best .
@ElectronFunCom
@ElectronFunCom 9 жыл бұрын
profesorultraznit Hi, thanks for your nice comment. I'm happy you found my video simple and useful :) I'll try to help you with the code (if I can). First of all - how do you control your submarine? is it some kind of a DIY RC radio, or something that you can buy? We need some kind of a signal for the Arduino, or in your case lack of the signal for a period of time that would trigger the recovery device. Do you have any ideas what you could connect to the Arduino, which would give the input signal?
@mariuspetcu7482
@mariuspetcu7482 9 жыл бұрын
Thanks for the replay . I can use FUTABA 6EXP / 40 MHz 6channels or GRAUPNER MC15 / 40 MHz 6 channels . [url=postimg.org/image/bsj38mda7/][img]s19.postimg.org/bsj38mda7/MC_15_13.jpg[/img][/url] . I have some free slots on it . Maybe if I can conect the arduino to a spare channel and from there to get an Input RF signal to the Arduino ?!.
How to calibrate an MQ-2 gas sensor || Arduino tutorial
3:16
ElectronFun.com
Рет қаралды 112 М.
Programming an ATtiny85/45 with an Arduino UNO (Getting started)
6:26
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 27 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 89 МЛН
You can learn Arduino in 15 minutes.
16:34
Afrotechmods
Рет қаралды 10 МЛН
Adam Savage's Latest Flea Market Haul!
11:05
Adam Savage’s Tested
Рет қаралды 219 М.
How to use gas sensors with Arduino || Arduino tutorial
7:37
ElectronFun.com
Рет қаралды 410 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 190 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 141 М.
Arduino Tutorial - ATtiny85 explained in 4 minutes!
4:28
Adio_
Рет қаралды 172 М.
I Made My Own Computer | Let's See How It Works
7:51
3DSage
Рет қаралды 763 М.
My First ATTINY85 Project!
23:48
upir
Рет қаралды 81 М.
Low Power Arduino! Deep Sleep Tutorial
24:14
Kevin Darrah
Рет қаралды 137 М.
How to Program ATtiny85 45 Arduino Tutorial 1.0.5
9:00
Mega Mechatronics
Рет қаралды 28 М.
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 17 МЛН