This aspect is so awsome. As a small fan but big noob, I didn't know enough to see this next step of 'just' using a chip - that an arduino isn't much more than a chip with only a few accessories. This is already the "adult" level of microcontroller projects? So near? That's so satisfying.
Thank you muchly for the no-nonsense instruction! I've been quite interested in using less-overkill hardware for my small projects (lighting 8 LEDs with very little input doesn't require an Arduino Pro Mini). However, I'm a beginner, and Arduino's have appealed to me. This gives me a great approach to trying to make my stuff smaller, and less expensive.
@Whisper6911 The feedback is certainly appreciated. It's not easy striking the right balance between making it informative yet short and to the point, so it helps to know how we're doing.
The ATtiny85 has 6 pins that can be set as outputs and inputs, but each pin also has aditional special functionality like Pulse-Width-Modulation and Analog Input capabilties. You can even utilize the reset pin during run-time for other purposes. See the datasheet with the pinout diagram with functionality listing. Also, you could in theory (given enough power) control a million LEDs using just one pin, if you utilize shift-registers and multiplexers to control multiple things.
So glad I found this. Just planning a small simple project with 1 input and 2 outputs and thinking that a full Arduino was serious overkill. This is exactly what I need. Subbed!
It is awesome that the music is from Collin. I am learning much recently and have been watching both your online videos. Thanks Matt for writing back! I hope to post my first fully designed and implemented project soon for feedback. -Matt
This is a nicely done tutorial! But especially for ATtiny projects I'd strongly suggest using generic avr-gcc code instead of the Arduino programming environmnent. With their small memory and few I/O capabilities, these chips cannot make use of most Arduino libraries. But they can profit a lot from getting rid of the overhead that comes with the Arduino wrapper code. I just tried a minimal program that just switches an output state once per main loop call and found avr-gcc code to be 4 times faster and one sixth the size compared to Arduino code.
Just started programming using Arduino. Searching what I can make and do with Arduino and it's mind blowing. I'm at level of this video yet but I have to say I'll be watching more of your videos in future
Can i generate such AC signal with Atiny microcontroller without inverter ic . Please once watch this video and see the signal wave and reply again. ruclips.net/video/caUHiHzswBU/видео.html
you prolly dont give a damn but does someone know a method to log back into an instagram account?? I was stupid lost the account password. I would love any help you can give me.
@Aiden Camden Thanks so much for your reply. I found the site thru google and im waiting for the hacking stuff now. Seems to take a while so I will get back to you later when my account password hopefully is recovered.
yes, i'm using a Nano V3(AtMega328P-AU) and works only for Tiny45 and if for you also a 10uF capacitor doesn't work, try a 47uF(an arduino forum gave me help on this) but this don't load some interesting functions, so if you only want to do leds blinking or PWM controllers thats ok!
Guys, you can do this not only with those 2 chips, but with nearly any AVR chips, you just need to use the correct pinout. With this, you own a cheap AVR programmer as your Arduino, that you can use for nearly everything!
Hi, If I want to program atmega328p using Ardiuno IDE, can you comment If I can get success if I follow the pin correctly but code written in Ardiuno IDE. your early reply will be highly appreciated
I shrank down my current project to directly use an ATMega328p when I moved from Proto to creating a PCB. I'm using nearly all of the GPIO, but I love this and will keep this in mind for future projects.
from the high-low tech article: "We’ll also connect a 10 uF capacitor between reset and ground on the Arduino board as shown in the diagram (the stripe on the capacitor that’s marked with a negative sign (-) should go to ground). The capacitor prevents the Arduino board from resetting (which starts the bootloader), thus ensuring that the Arduino IDE talks to the ArduinoISP (not the bootloader) during the upload of sketches. (The capacitor is needed if you’re using an Arduino Uno, and might also be necessary for an Arduino Duemilanove.)"
So... it prevents the reset of the board and keeps the computer talking with the ISP on the board, no the main ATMEGA328P on the board. On Linux (or macOS, with another alias for the /dev/) you can know which one is active when /dev/ttyUSB0 turns /dev/ttyUSB1.
@@willdrives601 So it makes sure the Arduino doesn't self-reset when uploading sketches. I have uploaded scetches without the capacitor in place, and it can work but sometimes results in a uploading error, requiring me to pull out and re-insert the USB lead. It works 100% with the capacitor in place tho.
If the number of pins you need exceed the number of those available on the AtTiny85, there's the AtTiny84 that has about 2x the number if IO pins (but with the same memory size). This chip is also supported by Arduino IDE and is also very cheap
Despite what this video's description says about more information being on the makezine blog, what is actually there is copy-pasta of this video's description, complete with a link to itself. Yo Dawg!
Okay for those of you who are having the following problem: Blink:15: error: 'OUTPUT' was not declared in this scope Blink:15: error: 'pinMode' was not declared in this scope ... Here is a small tut. of how to fix it: you need to download Arduino software version 0022. Then follow the same tut. as shown in this video. It will WORK! The reason that 'OUTPUT' and other arguments are undeclared is because from Arduino update 1.0, they changed the core library WProgram.h to Arduino.h.
Amazing I still remembered watching this in my high school times to shrink my project on controlling solar water heater. Now I am using ESP32. Thank you for this amazing video!
+Uzair Ali From the High-Low Tech site: "The capacitor prevents the Arduino board from resetting (which starts the bootloader), thus ensuring that the Arduino IDE talks to the ArduinoISP (not the bootloader) during the upload of sketches. (The capacitor is needed if you’re using an Arduino Uno, and might also be necessary for an Arduino Duemilanove.)"
When the system is powered, capacitor pulls the reset pin to ground till it gets charged completely. This will give enough time for the microcontroller to initiate. And once it is charged, it prevents the board from resetting so that the intended task is carried out smoothly.
Or just buy an Arduino Mini Pro clone, ~2$ on eBay shipping included from China and you don't have the problem that the ATTiny isn't as powerful as the ATMega 328p which is used on the Arduino... Don't get me wrong, I don't dislike the idea behind this video, it's just that you replace the microcontroller by an ATTiny without really mentioning the cutbacks of it...
For basic projects Arduino is overkill, Attiny can run on as low as 1.8v with very little current draw and if you skip the bloat of the Arduino wrapper and program directly with AVR-C you can do a lot with little memory.
Attiny45 is 12 times smaller than the mini pro, sucks way less current and costs (as in 2017) less than 1.5 $. Sure the Mini Pro is better, but the Uno is even better, the Mega is even better, some IBM supercomputer is even better etc etc. This video is not about what is better than what. It's about how to shrink simple projects.
I mean it runs at 8mhz default but can run 16mhz or even 20mhz. If that’s what’s needed at least. Or you could get a $3 esp8266(or even now the 8285) and get hundreds of MHz from it with some tweaking. All while having many more features than the uno.
katze_sonne can i use ATTiny for my heart rate measuring project....as of now m using arduino nano but if i can use it then it will reduce size...n mainly will it send data serially (support Bluetooth connection or not)....reply me as soon as possible..... Waiting.......................…
Yep, and sometimes it's also just about the fun of seeing how much functionality you can squeeze out of such a tiny device. I made a project based around the ATtiny85 recently. It's a timer to run my laptop's power supply for up to 2 hours max. (Because I always forget to unplug it.) I used two of the IO pins to drive 4 LEDs in a bargraph configuration, with each LED representing 30 minutes. The uppermost LED in the bargraph blinks off briefly once a second to show that the device is counting down. (LED drive is done by rapidly toggling output to drive both an LED to ground and an LED to Vcc, or toggling between a low output and a Hi-Z mode to drive only one of the LEDs on that pin.) Another pin drives a small beeper via a transistor, and one pin is the input which has a pushbutton connected. The last used pin drives a P-channel mosfet via a small n-channel mosfet to connect +12V to the output socket into which the charger is plugged. All this was built into a dual-port cigarette lighter adapter (plugs into a single ciggy port to provide two ports) with one of the output ports removed and that space used to mount the hardware. (tight fit!) Pushing the button wakes the unit up, setting the time to 2 hours and powers the output. Each additional push advances the time to the next 30 minute division. Once the end time is reached, the unit switches the power off and goes into a low power sleep mode, waiting for the next button push to wake it up. Doing it with the ATtiny85 certainly made it possible to make all this small enough to fit into a single-to-dual cigarette light socket adaptor. I did find some problems though. THe data sheet talks about timer0 and timer1, but no matter what I tried I couldn't get timer1 to work or generate an interrupt. So I ended up using arduino's built-in millis() function. I had to set the device to run at 8MHz, but the millis function didn't run at the correct speed, so I adjusted the expected counts in my program to compensate for that. It appears to run about twice as fast.
Yes, it works fine. Google "Program AVR chip with Arduino software" sites explaining more. Arduino is a package which includes - on 1 board - an ISP programmer, the AVR chip itself and a standardised I/O arrangement. It's therefore quite happy to program the same items as separate products. As Matt says in this video if you make lots of MCU projects, using an Arduino every time is wasteful because you probably won't use a lot of the I/O pins AND you're buying an ISP programmer every time
I dont know if you asked it rhetorically ;) but for newbies, It is to just prevent the software reset the Arduino has ! Though i doubt it is actually needed !! As i have flashed bootloader to many 328s (dont know about these Atinys ) and i did not use any capacitor or that !
Yes, it has an internal clock but you can use an external clock (takes up pins tho). You can burn the bootloader to make it run at 8 or 16MHz (I recommend burning the 8MHz bootloader).
Totally agree. In "Practical AVR Microcontrollers" I detailed exactly this approach. Using an Arduino for every project large or small is wasteful. You're buying the AVR programmer + AVR chip and support electronics every time! If you are only doing build-up tear-down that's no big deal. If you're making lots of small "keeper" projects then the needless costs mount up. Use naked AVR chips + a USB programmer (no bootloaders) and you save a lot of money and can still use Arduino software. Alan T.
Thanks for the tip! Just what I needed but didn't know existed. Ordering some now. (Puzzles me why people leave comments that don't pertain to the subject)
@minutemadeinc Both can communicate with each other and other chips that support I2C. If you google Arduino I2C you will find an example that shows 2 Arduino's communicating to each other with 2 wires. If you need a lot of pins or want to use all Arduino functions then go with the ATmega.
In that MAKE was a partner in teaching hobbyists to use the Arduino to complicate the simple complicate, it's fitting that they still tech that albeit with a smaller uprocessor. No for make to teach how to blink a LED using discrete components, that would be free after salvaging consumer electronics. Now that I see that Adafruit sell ZIF sockets that can be plugged into the socket an the arduino I just might finally purchase on arduino
It is a bit obsolete, you can stick the attiny file in the hardware folder in the 1.0.1 IDE folder. Also a 100ohm resistor between 5v and reset works (if you don't have a capacitor handy). Overall pretty awesome.
I don't know if this helps but you can use a 74hc595 chip to extend the number of digital pins. Basically they have an 8 bit register that holds a value. There is another 8 bit register you can fill up bit by bit in serial (a shift register). Then you set another pin on the chip and the contents of the shift register will go to the output register. I think you can also read in a parallel 8 bit input, swapping it into the shift register and shift it out serially, but I'm not sure about that.
Nice Video, uses the Arduino like it was supposed to be used: as a rapid prototype board, where you can quickly design your device, and then transfer it to a real board. One little suggestion though. Try to add a 10 kOhm resistor between VCC and the reset pin of your chip, after you programmed it. It will prevent your ATTiny from accidentally resetting itself if you touch your project wrong.
This tutorial is obsolete, but if you follow the links in the description you will find an updated version that actually works! :) It would be nice if you put an annotation in this video or something
@desktopgeek98 Assuming you are talking about the ATtiny2313 apart from more pins, it has no ADC, only 2KB space but has UART. You can see the differences on the Atmel website -> Products -> Atmel AVR 8- and 32-bit -> tinyAVR -> Parameters.
Arduino IDE actually adds ~1000 bytes of stuff you actually don't need. My suggestion to people who want to play with these chips is to grab gcc-avr and program them that way. It's harder than Arduino IDE but well worth the effort. You still get the benefit of programming in C or C++ but you loose some of the conveniences. For comparison blinking example when compiled by Arduino takes around 1020 bytes or more. When compiled with gcc-avr same code takes around 120 bytes.
If you let the Reset pin free floating it is very sensitive and may cause a reset every now and then. The capacitor stabilizes the level on the pin and prevents unwanted resets.
Great video and easy to follow. Personally, I think if people are moving off the Arduino and onto standalone projects it might be worth getting a dedicated programmer and programming it standalone. I have been doing this from the start, I don't use Arduino or AVR but I do use Microchip PIC chips. The greatest part of using standalone projects is eventually moving away from breadboard\veroboard and fabricating PCBs for finalized projects. I usually add an ICSP header if I want to make changes.
@makemagazine Thank you for acknowledging our feedback. Since you are so in-tune with your audience base I find it hard to believe that you think we are concerned about the videos being to long.
A bootloader is a small program that runs inside an Arduino (or other packaged Microcontroller system) which allows the AVR to cooperate with an external system to update the main contents of the AVR's memory and you need a bootloader if you are using an Arduino. If you're using a naked AVR chip (just the chip itself) and an AVR ISP2 programmer or equivalent (such as Pololu AVR ISP programmer) then the ISP completely controls the AVR chip during programming and no bootloader is needed.
From what I can figure out, this applies to the earlier Arduinos. The video is from 2011. I found an article which sort of makes sense because it's from 2013. Their firmware was a bit dodgy. petervanhoyweghen.wordpress.com/2013/05/04/disabling-auto-reset-on-the-due/
Actually, if you factor in shipping costs and think internationally, the ATMega328 is *cheaper* than the ATTiny.. It isn't far fetched to say you can find the ATMega328P via eBay for under $2 inc. shippinh. (in fact, I just ordered a few for that, and they come bootloaded). However, an ATTiny will cost you at least double that. It might still make sense if space is at premium, however.
I dont see why not. It depends on how well you can program your code into the tiny space given to you. You can do a lot with 4k and 8k of memory if you outsource all actions into functions and just call them. Also, if you outsource certain functionalities using discrete components or other chips like maybe a 74 series logic flipflop chip or doing that in a bistable multivibrator solution using transistors and resistors you can save memory space on the chip for more processing stuff.
@makemagazine dude has a point; you could have said some things about which pin does what, and what those error messages mean and why they can safely be ignored. also a bit of elaboration on the limitations of this chip vs regular arduino would not be out of place here.
Thanks a lot for the video.Please could you tell me about PWM generation by the tiny chip. Could I generate PWM as similar of other Arduino board?How to write TCCRnA equation to generate 60Hz?
The next ones up are devices like the ATMEGA168 or an ATMEGA328 which are 28 pin devices (offering up to about 17 I/O lines) then after that you're heading towards 40 pin devices like the ATMEGA1284 which has (if I remember right) about 33 usable i/o lines. After that you get into the 32-bit AVR family which goes up from there...
I'm wondering... the ATtiny 85 have an internal crystal? since I didn't see a external crystal anywhere. And the Khz are the same that the one in the Arduino Uno??
OMG, thanks. I have been trying to program an Attiny13 using this technique with no success. I got frustrated by some of the warnings I got from the Arduino IDE, I assumed it was not working. The key was when you said reassign pin 13 to the applicable pins on your chip. I got a little flashy thing now!
@xMouseTrapDJx so you can haave blinking eyes? if they were to implement chips i do beleive they would go for something a bit more fit for the purpose.
These 8 pins avr microcontrollers are great.Of course you can use every arduino module but if you have to make a speed controller or a light dimmer as a stand alone project it does not make sense to use 32kbytes and 28 pins for 1-2kbytes and using up to 5 pins of the microcontroller.
Simply to prevent voltage drops, when you switch some load with the attiny. In my latest project (@5V, atmega48a), a rc servo caused an reset (brownout @4,3V) because of its load (around 1A peaks). I hooked up 1000µF and it runs fine now ( i heard somewhere to use 1000µF/A) But anyway, it's better (sometimes) to use 2 power supplies (1 for logic, 1 for load)
@reviathon360 If you need more pins that a board supports, just add shift registers, or multiplexers and you can have as many as you like. E.g. with 9 multiplexer chips, you can have 64 analog/digital inputs using only 7 pins on an arduino. With shift registers, you can have as many as you like - after a few hundred though, it can get a bit slow to update/read them all.
@Mohammad M While this example could certainly be done with a 555 IC, it was not the point of the video -- just a handy example using minimal components. The intention is to illustrate a method for using a smaller chip when a full Arduino board itself is not really required, but when one might still require programmability in the solution.
Hi, great video. I've tested it out and it works pretty well. Finally i don't have to mess around with this big ATMEGA328 / 168 anymore. But i think it is a pitty that some simple commands like if/elso don't work.
Do you think that I can use this for nRF24L01+ Tranceiver Module connected to a KEDSUM® 5V 1 One Channel Relay Module Expansion Board For Arduino SCM ARM PIC AVR DSP to trigger the Relay? I only want to use these two items
You need to use an ISP programmer with your tiny85 and program it with the Arduino software environment. You'll need to install a hardware driver (google for attiny45_85.zip) to interface the tiny85 to the Arduino - instructions come with it. Then all you need to do is go to the Arduino Playground libraries page and choose the shift register library you want to use (check out the shiftOutX and TL5940 libs for just two examples) and you're all set.
Liked it.... nicely placed all details.a good step toward miniaturized approach. But I find cost of attiny same as Arduino pro mini board which has ALL Arduino functionality (not there in attiny- )
There might be some curiosity about the capacitor. Anyone pursuing this project will probably find out from the documentation, but for anyone just watching for fun, the capacitor shores up the reset pins defenses against a pulse that is sent out during the operation.
How would I be able to get a chip with more pins? Will the ATMega328P work and be programmed the same way in this video? What about the ATTiny84? I am looking to attempt to use this method of shrinking to check the temperature of where the device is located, and send it to a computer. Meaning I would essentially need a power source, RFM69HW transceiver, and temperature sensor. Would this shrink method work for this? Thanks
You can buy Atmel chips for a whole lot cheaper at sites like Digikey and AV Net. You can also get a lot of other neat cheaps for really cheap, you just need to know where to look.
That's the happiest man I've ever seen :O
Fakest*
why? is that impossible to have a nice smile nowadays?
I thought for a moment he was coming on to me.
plain auto control under late capitalist recording
Popularbikes 😃
This aspect is so awsome. As a small fan but big noob, I didn't know enough to see this next step of 'just' using a chip - that an arduino isn't much more than a chip with only a few accessories.
This is already the "adult" level of microcontroller projects? So near?
That's so satisfying.
Thank you muchly for the no-nonsense instruction!
I've been quite interested in using less-overkill hardware for my small projects (lighting 8 LEDs with very little input doesn't require an Arduino Pro Mini). However, I'm a beginner, and Arduino's have appealed to me.
This gives me a great approach to trying to make my stuff smaller, and less expensive.
@Whisper6911 The feedback is certainly appreciated. It's not easy striking the right balance between making it informative yet short and to the point, so it helps to know how we're doing.
The ATtiny85 has 6 pins that can be set as outputs and inputs, but each pin also has aditional special functionality like Pulse-Width-Modulation and Analog Input capabilties. You can even utilize the reset pin during run-time for other purposes. See the datasheet with the pinout diagram with functionality listing.
Also, you could in theory (given enough power) control a million LEDs using just one pin, if you utilize shift-registers and multiplexers to control multiple things.
So glad I found this. Just planning a small simple project with 1 input and 2 outputs and thinking that a full Arduino was serious overkill. This is exactly what I need. Subbed!
My next goal:
use an Attiny85 to program an Attiny45
And than you need to use an Micro to program the Attiny85.
my next goat is to program 100 Ohm resistor to behave like a microprocessor
my next goal:
to program a 10k resistor using +itmemo's "microprocessor".
I programmed my Attiny45 using single-event upset cosmic ray and an aluminium foil as a mirror to switch bits into my hard drive.
I programmed my attiny45 by setting the universal constants so that the universe evolved to contain the programmed chip that I wanted.
It is awesome that the music is from Collin. I am learning much recently and have been watching both your online videos. Thanks Matt for writing back! I hope to post my first fully designed and implemented project soon for feedback. -Matt
This is a nicely done tutorial!
But especially for ATtiny projects I'd strongly suggest using generic avr-gcc code instead of the Arduino programming environmnent. With their small memory and few I/O capabilities, these chips cannot make use of most Arduino libraries. But they can profit a lot from getting rid of the overhead that comes with the Arduino wrapper code.
I just tried a minimal program that just switches an output state once per main loop call and found avr-gcc code to be 4 times faster and one sixth the size compared to Arduino code.
Just started programming using Arduino. Searching what I can make and do with Arduino and it's mind blowing. I'm at level of this video yet but I have to say I'll be watching more of your videos in future
@P55CxE9 The comments are a perfect spot to ask questions about what you'd like to have further explained. So, ask away!
Yes, it gives you 2 pwm ports that you can use to control motors/servos. Potentiometers are analog sensors so you can plug them into pin 3 and 4
Love this guy! He's enthusiasm is contagious! :)
I must say, this Video was what got me into electronics.
Im glad, I stumbled upon it.
Thank you very much!
And then replace the breadboard with a custom PCB and you have a finished product?
+Henry The Unicorn pretty much
+Henry The Unicorn Or use something like vero board if you don't feel like etching PCBs.
can these be programmed with a FTDI usb to serial? or with a mini?
Can i generate such AC signal with Atiny microcontroller without inverter ic . Please once watch this video and see the signal wave and reply again.
ruclips.net/video/caUHiHzswBU/видео.html
Andrea Mitchell ordering PCB etching in China is cheaper - yet etching yourself is way more satysfying
finally. a video telling me how shrink my audinio project. what a fucking life saver .im so glad this video is here.
Thanks for this video! Lots of possibilities and I will give this a try myself.
you prolly dont give a damn but does someone know a method to log back into an instagram account??
I was stupid lost the account password. I would love any help you can give me.
@Dax Zavier instablaster :)
@Aiden Camden Thanks so much for your reply. I found the site thru google and im waiting for the hacking stuff now.
Seems to take a while so I will get back to you later when my account password hopefully is recovered.
@Aiden Camden it did the trick and I now got access to my account again. I am so happy!
Thank you so much, you saved my ass !
@Dax Zavier glad I could help :)
yes, i'm using a Nano V3(AtMega328P-AU) and works only for Tiny45
and if for you also a 10uF capacitor doesn't work, try a 47uF(an arduino forum gave me help on this)
but this don't load some interesting functions, so if you only want to do leds blinking or PWM controllers thats ok!
Guys, you can do this not only with those 2 chips, but with nearly any AVR chips, you just need to use the correct pinout. With this, you own a cheap AVR programmer as your Arduino, that you can use for nearly everything!
Hi, If I want to program atmega328p using Ardiuno IDE, can you comment If I can get success if I follow the pin correctly but code written in Ardiuno IDE. your early reply will be highly appreciated
I shrank down my current project to directly use an ATMega328p when I moved from Proto to creating a PCB. I'm using nearly all of the GPIO, but I love this and will keep this in mind for future projects.
why did you used the capacitor between the RESET and GND pin?
from the high-low tech article: "We’ll also connect a 10 uF capacitor between reset and ground on the Arduino board as shown in the diagram (the stripe on the capacitor that’s marked with a negative sign (-) should go to ground). The capacitor prevents the Arduino board from resetting (which starts the bootloader), thus ensuring that the Arduino IDE talks to the ArduinoISP (not the bootloader) during the upload of sketches. (The capacitor is needed if you’re using an Arduino Uno, and might also be necessary for an Arduino Duemilanove.)"
So... it prevents the reset of the board and keeps the computer talking with the ISP on the board, no the main ATMEGA328P on the board. On Linux (or macOS, with another alias for the /dev/) you can know which one is active when /dev/ttyUSB0 turns /dev/ttyUSB1.
you can pull out the controller does the same thing
@@willdrives601 So it makes sure the Arduino doesn't self-reset when uploading sketches. I have uploaded scetches without the capacitor in place, and it can work but sometimes results in a uploading error, requiring me to pull out and re-insert the USB lead. It works 100% with the capacitor in place tho.
for decoupling.
If the number of pins you need exceed the number of those available on the AtTiny85, there's the AtTiny84 that has about 2x the number if IO pins (but with the same memory size).
This chip is also supported by Arduino IDE and is also very cheap
Despite what this video's description says about more information being on the makezine blog, what is actually there is copy-pasta of this video's description, complete with a link to itself. Yo Dawg!
Okay for those of you who are having the following problem:
Blink:15: error: 'OUTPUT' was not declared in this scope
Blink:15: error: 'pinMode' was not declared in this scope
...
Here is a small tut. of how to fix it:
you need to download Arduino software version 0022.
Then follow the same tut. as shown in this video.
It will WORK!
The reason that 'OUTPUT' and other arguments are undeclared is because from Arduino update 1.0, they changed the core library WProgram.h to Arduino.h.
That smile reminds me of Alan Partridge
Amazing I still remembered watching this in my high school times to shrink my project on controlling solar water heater. Now I am using ESP32. Thank you for this amazing video!
For what reason you put a capacitor between reset and ground?
+Uzair Ali
From the High-Low Tech site:
"The capacitor prevents the Arduino board from resetting (which starts the bootloader), thus ensuring that the Arduino IDE talks to the ArduinoISP (not the bootloader) during the upload of sketches. (The capacitor is needed if you’re using an Arduino Uno, and might also be necessary for an Arduino Duemilanove.)"
if you're using what
i believe i can use a ceramic capacitor instead of the electrolytic one?
When the system is powered, capacitor pulls the reset pin to ground till it gets charged completely. This will give enough time for the microcontroller to initiate. And once it is charged, it prevents the board from resetting so that the intended task is carried out smoothly.
i saw videos of people just putting a regular piece of wire to block off the arudinos controler
Now that´s about the coolest thing I´ve seen done with an Arduino board.
Or just buy an Arduino Mini Pro clone, ~2$ on eBay shipping included from China and you don't have the problem that the ATTiny isn't as powerful as the ATMega 328p which is used on the Arduino... Don't get me wrong, I don't dislike the idea behind this video, it's just that you replace the microcontroller by an ATTiny without really mentioning the cutbacks of it...
For basic projects Arduino is overkill, Attiny can run on as low as 1.8v with very little current draw and if you skip the bloat of the Arduino wrapper and program directly with AVR-C you can do a lot with little memory.
Attiny45 is 12 times smaller than the mini pro, sucks way less current and costs (as in 2017) less than 1.5 $.
Sure the Mini Pro is better, but the Uno is even better, the Mega is even better, some IBM supercomputer is even better etc etc.
This video is not about what is better than what. It's about how to shrink simple projects.
I mean it runs at 8mhz default but can run 16mhz or even 20mhz.
If that’s what’s needed at least.
Or you could get a $3 esp8266(or even now the 8285) and get hundreds of MHz from it with some tweaking.
All while having many more features than the uno.
katze_sonne can i use ATTiny for my heart rate measuring project....as of now m using arduino nano but if i can use it then it will reduce size...n mainly will it send data serially (support Bluetooth connection or not)....reply me as soon as possible.....
Waiting.......................…
Yep, and sometimes it's also just about the fun of seeing how much functionality you can squeeze out of such a tiny device.
I made a project based around the ATtiny85 recently. It's a timer to run my laptop's power supply for up to 2 hours max. (Because I always forget to unplug it.) I used two of the IO pins to drive 4 LEDs in a bargraph configuration, with each LED representing 30 minutes. The uppermost LED in the bargraph blinks off briefly once a second to show that the device is counting down. (LED drive is done by rapidly toggling output to drive both an LED to ground and an LED to Vcc, or toggling between a low output and a Hi-Z mode to drive only one of the LEDs on that pin.)
Another pin drives a small beeper via a transistor, and one pin is the input which has a pushbutton connected. The last used pin drives a P-channel mosfet via a small n-channel mosfet to connect +12V to the output socket into which the charger is plugged. All this was built into a dual-port cigarette lighter adapter (plugs into a single ciggy port to provide two ports) with one of the output ports removed and that space used to mount the hardware. (tight fit!) Pushing the button wakes the unit up, setting the time to 2 hours and powers the output. Each additional push advances the time to the next 30 minute division. Once the end time is reached, the unit switches the power off and goes into a low power sleep mode, waiting for the next button push to wake it up.
Doing it with the ATtiny85 certainly made it possible to make all this small enough to fit into a single-to-dual cigarette light socket adaptor.
I did find some problems though. THe data sheet talks about timer0 and timer1, but no matter what I tried I couldn't get timer1 to work or generate an interrupt. So I ended up using arduino's built-in millis() function. I had to set the device to run at 8MHz, but the millis function didn't run at the correct speed, so I adjusted the expected counts in my program to compensate for that. It appears to run about twice as fast.
Yes, it works fine. Google "Program AVR chip with Arduino software" sites explaining more. Arduino is a package which includes - on 1 board - an ISP programmer, the AVR chip itself and a standardised I/O arrangement. It's therefore quite happy to program the same items as separate products. As Matt says in this video if you make lots of MCU projects, using an Arduino every time is wasteful because you probably won't use a lot of the I/O pins AND you're buying an ISP programmer every time
I need to go meditate. That guy's facial expressions offended me.
You must VERY easily offended.
Some people are Mathef.
Yeah I know, they need to grow up ;)
It wasn't that that was the issue - it was way too much face!
this guy just have a faceial expressions like a robot to me
I dont know if you asked it rhetorically ;) but for newbies, It is to just prevent the software reset the Arduino has ! Though i doubt it is actually needed !!
As i have flashed bootloader to many 328s (dont know about these Atinys ) and i did not use any capacitor or that !
does it require a clock or is it contained into the chip?
Yes, it has an internal clock but you can use an external clock (takes up pins tho). You can burn the bootloader to make it run at 8 or 16MHz (I recommend burning the 8MHz bootloader).
@mafiameower You could also use an ISP (In System Programmer). But most people already have Arduinos around.
Liked and subscribed!
This was very helpful. I made a video on how to control a relay with ATtiny45 and light a candle with a countdown.
Totally agree. In "Practical AVR Microcontrollers" I detailed exactly this approach. Using an Arduino for every project large or small is wasteful. You're buying the AVR programmer + AVR chip and support electronics every time! If you are only doing build-up tear-down that's no big deal. If you're making lots of small "keeper" projects then the needless costs mount up. Use naked AVR chips + a USB programmer (no bootloaders) and you save a lot of money and can still use Arduino software. Alan T.
i don't know why but i don't like this guy he smiles too much like he should be in a tooth paste commercial its a good tip about the chip though
xD
I like the way he is presenting the video
xD
Your website doesn't appear to be working anymore. However I was able to get this working.
bad music, good video
I like the music
I'm in favour of NO music on instructional vids.
we love you Collin))
Thanks for the tip! Just what I needed but didn't know existed. Ordering some now.
(Puzzles me why people leave comments that don't pertain to the subject)
Yeah fix your facial expressions dude but great info. Thanks
@minutemadeinc Both can communicate with each other and other chips that support I2C. If you google Arduino I2C you will find an example that shows 2 Arduino's communicating to each other with 2 wires. If you need a lot of pins or want to use all Arduino functions then go with the ATmega.
Yes. You can program any ATmega microcontroller used in any Arduinos, using an UNO or a Mega board.
In that MAKE was a partner in teaching hobbyists to use the Arduino to complicate the simple complicate, it's fitting that they still tech that albeit with a smaller uprocessor. No for make to teach how to blink a LED using discrete components, that would be free after salvaging consumer electronics. Now that I see that Adafruit sell ZIF sockets that can be plugged into the socket an the arduino I just might finally purchase on arduino
Thanks! Nice and quick tutorial. Hope Matt Richardson starts posting more tutorial videos.
loving the new camera. beautiful work.
It is a bit obsolete, you can stick the attiny file in the hardware folder in the 1.0.1 IDE folder. Also a 100ohm resistor between 5v and reset works (if you don't have a capacitor handy). Overall pretty awesome.
I don't know if this helps but you can use a 74hc595 chip to extend the number of digital pins. Basically they have an 8 bit register that holds a value. There is another 8 bit register you can fill up bit by bit in serial (a shift register). Then you set another pin on the chip and the contents of the shift register will go to the output register. I think you can also read in a parallel 8 bit input, swapping it into the shift register and shift it out serially, but I'm not sure about that.
Awesome project, this can save too much money. A MCU with 8 pins and Analog In?, wow, this is crazy, I need get a lot of these MCUs
That's amazing! Great tutorial. I had no idea you could do that with an Arduino.
Nice Video, uses the Arduino like it was supposed to be used: as a rapid prototype board, where you can quickly design your device, and then transfer it to a real board. One little suggestion though. Try to add a 10 kOhm resistor between VCC and the reset pin of your chip, after you programmed it. It will prevent your ATTiny from accidentally resetting itself if you touch your project wrong.
This tutorial is obsolete, but if you follow the links in the description you will find an updated version that actually works! :)
It would be nice if you put an annotation in this video or something
@desktopgeek98 Assuming you are talking about the ATtiny2313 apart from more pins, it has no ADC, only 2KB space but has UART. You can see the differences on the Atmel website -> Products -> Atmel AVR 8- and 32-bit -> tinyAVR -> Parameters.
hats off for that blinking led i made a very big one using ne555 an one 8 pin chip and 30 jumpers wire
Arduino IDE actually adds ~1000 bytes of stuff you actually don't need. My suggestion to people who want to play with these chips is to grab gcc-avr and program them that way. It's harder than Arduino IDE but well worth the effort. You still get the benefit of programming in C or C++ but you loose some of the conveniences.
For comparison blinking example when compiled by Arduino takes around 1020 bytes or more. When compiled with gcc-avr same code takes around 120 bytes.
If you let the Reset pin free floating it is very sensitive and may cause a reset every now and then.
The capacitor stabilizes the level on the pin and prevents unwanted resets.
Great video and easy to follow. Personally, I think if people are moving off the Arduino and onto standalone projects it might be worth getting a dedicated programmer and programming it standalone.
I have been doing this from the start, I don't use Arduino or AVR but I do use Microchip PIC chips. The greatest part of using standalone projects is eventually moving away from breadboard\veroboard and fabricating PCBs for finalized projects. I usually add an ICSP header if I want to make changes.
@makemagazine Thank you for acknowledging our feedback. Since you are so in-tune with your audience base I find it hard to believe that you think we are concerned about the videos being to long.
A bootloader is a small program that runs inside an Arduino (or other packaged Microcontroller system) which allows the AVR to cooperate with an external system to update the main contents of the AVR's memory and you need a bootloader if you are using an Arduino.
If you're using a naked AVR chip (just the chip itself) and an AVR ISP2 programmer or equivalent (such as Pololu AVR ISP programmer) then the ISP completely controls the AVR chip during programming and no bootloader is needed.
I understand the capacitor can be between 10v-50v, but does the capacitor have to be 10 uF? Would, for example, a 100uF capacitor work?
From what I can figure out, this applies to the earlier Arduinos. The video is from 2011. I found an article which sort of makes sense because it's from 2013. Their firmware was a bit dodgy. petervanhoyweghen.wordpress.com/2013/05/04/disabling-auto-reset-on-the-due/
@@DaleDix That is very helpful, thank you!
Sir , how to code ATTINY85 , for IR remote implementation to switch the simple led on/off , what are the methods which I have to look into.
Excellent video. Need more with this quality.
Congrats... You've set the internet on fire.
That's crazy cool! Now all I need is everything you mentioned!
cause leaving reset pin open may result to reading unexpected 1's and 0's due to electromagnetic noise. you could also use just a pull-up resistance.
Actually, if you factor in shipping costs and think internationally, the ATMega328 is *cheaper* than the ATTiny.. It isn't far fetched to say you can find the ATMega328P via eBay for under $2 inc. shippinh. (in fact, I just ordered a few for that, and they come bootloaded). However, an ATTiny will cost you at least double that. It might still make sense if space is at premium, however.
I dont see why not. It depends on how well you can program your code into the tiny space given to you. You can do a lot with 4k and 8k of memory if you outsource all actions into functions and just call them.
Also, if you outsource certain functionalities using discrete components or other chips like maybe a 74 series logic flipflop chip or doing that in a bistable multivibrator solution using transistors and resistors you can save memory space on the chip for more processing stuff.
@makemagazine dude has a point; you could have said some things about which pin does what,
and what those error messages mean and why they can safely be ignored.
also a bit of elaboration on the limitations of this chip vs regular arduino would not be out of place here.
It is also possible to shrink down the arduino framework to an ATTINY13! I tried it and it worked pretty well.
Thanks a lot for the video.Please could you tell me about PWM generation by the tiny chip. Could I generate PWM as similar of other Arduino board?How to write TCCRnA equation to generate 60Hz?
@vanepico Nope.
The next ones up are devices like the ATMEGA168 or an ATMEGA328 which are 28 pin devices (offering up to about 17 I/O lines) then after that you're heading towards 40 pin devices like the ATMEGA1284 which has (if I remember right) about 33 usable i/o lines. After that you get into the 32-bit AVR family which goes up from there...
Wow I am learning as today's tech.. have launched 9 years ago video... Great!!
I'm wondering... the ATtiny 85 have an internal crystal? since I didn't see a external crystal anywhere. And the Khz are the same that the one in the Arduino Uno??
That was really cool! Nice way to cram a µC into a small package!
OMG, thanks. I have been trying to program an Attiny13 using this technique with no success. I got frustrated by some of the warnings I got from the Arduino IDE, I assumed it was not working. The key was when you said reassign pin 13 to the applicable pins on your chip. I got a little flashy thing now!
@xMouseTrapDJx so you can haave blinking eyes? if they were to implement chips i do beleive they would go for something a bit more fit for the purpose.
yay Arduino SPI programming! I needed a tutorial for this
will it work with arduino mega? your answer wil be much helpful sir.
These 8 pins avr microcontrollers are great.Of course you can use every arduino module but if you have to make a speed controller or a light dimmer as a stand alone project it does not make sense to use 32kbytes and 28 pins for 1-2kbytes and using up to 5 pins of the microcontroller.
Will give it a try since I still have some attiny chips (had great luck on programming atmega328 chip on my projects)
Simply to prevent voltage drops, when you switch some load with the attiny. In my latest project (@5V, atmega48a), a rc servo caused an reset (brownout @4,3V) because of its load (around 1A peaks).
I hooked up 1000µF and it runs fine now ( i heard somewhere to use 1000µF/A)
But anyway, it's better (sometimes) to use 2 power supplies (1 for logic, 1 for load)
@reviathon360 If you need more pins that a board supports, just add shift registers, or multiplexers and you can have as many as you like. E.g. with 9 multiplexer chips, you can have 64 analog/digital inputs using only 7 pins on an arduino. With shift registers, you can have as many as you like - after a few hundred though, it can get a bit slow to update/read them all.
How do you go to the website where you can install the ATtiny whatever chip 0:53
Im pretty confused, please help.
@Mohammad M While this example could certainly be done with a 555 IC, it was not the point of the video -- just a handy example using minimal components. The intention is to illustrate a method for using a smaller chip when a full Arduino board itself is not really required, but when one might still require programmability in the solution.
Hi. this is a great chip,,,the only question is that if you can please tell me , if there is any chip for digital output.
Thank you
Hi, great video.
I've tested it out and it works pretty well.
Finally i don't have to mess around with this big ATMEGA328 / 168 anymore.
But i think it is a pitty that some simple commands like if/elso don't work.
Do you think that I can use this for nRF24L01+ Tranceiver Module connected to a KEDSUM® 5V 1 One Channel Relay Module Expansion Board For Arduino SCM ARM PIC AVR DSP to trigger the Relay? I only want to use these two items
Yes you can use them as digital outputs but not as PWM outputs (unless you write code to do "software PWM")
There are no limits to your visions with any language.
It's not the tool, it's how you use it.
You need to use an ISP programmer with your tiny85 and program it with the Arduino software environment. You'll need to install a hardware driver (google for attiny45_85.zip) to interface the tiny85 to the Arduino - instructions come with it. Then all you need to do is go to the Arduino Playground libraries page and choose the shift register library you want to use (check out the shiftOutX and TL5940 libs for just two examples) and you're all set.
Can you program and use multiple Attiny's to have access for more pins for a single project?
I'm sure you can program larger AVRs using the same method if you need more I/O or other things
Awesome way to shrink prototype boards!
Liked it.... nicely placed all details.a good step toward miniaturized approach. But I find cost of attiny same as Arduino pro mini board which has ALL Arduino functionality (not there in attiny- )
Does that work, where the Tx and Rx pins are needet. (For a Bluetooth garden light control)
There might be some curiosity about the capacitor. Anyone pursuing this project will probably find out from the documentation, but for anyone just watching for fun, the capacitor shores up the reset pins defenses against a pulse that is sent out during the operation.
How would I be able to get a chip with more pins? Will the ATMega328P work and be programmed the same way in this video? What about the ATTiny84? I am looking to attempt to use this method of shrinking to check the temperature of where the device is located, and send it to a computer. Meaning I would essentially need a power source, RFM69HW transceiver, and temperature sensor. Would this shrink method work for this?
Thanks
You can buy Atmel chips for a whole lot cheaper at sites like Digikey and AV Net. You can also get a lot of other neat cheaps for really cheap, you just need to know where to look.
Great video! I had no idea that you could use ATtiny and arduino.
Anyone knows if the servo library works with the ATtiny ?