0

I'm thinking of making a tiny RC toy project that is controlled through Bluetooth with most components at its tiniest size. I'm a complete beginner in this area so i'm not completely familiar with lots of components so please don't mind me if i sound dumb and uneducated. Anyway...

If it's possible: how many components can i use with the ATtiny45/85? or should i go with the atmega8.

I have a m20 mini motor, a micro servo and a few leds. This doesn't include other components that i havent purchase such as dc driver module and HC-05 Bluetooth module.

If not possible: what other options I can do to create my project.

closed as too broad by per1234, VE7JRO, sempaiscuba, Greenonline, gre_gor Dec 16 '18 at 23:18

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

The ATTiny has 5 usable pins (6 if you decide to reuse the Reset pin). Since it doesn't have UART hardware, you need to use a SoftwareSerial library to communicate with the HC-05. This takes 2 pins. To drive a motor, you need at least 1 pin. If you need to control it's speed (instead of just on and off), you would need to generate a PWM signal. Either through hardware timer or by code. (The ATTiny has 2 timers. When you want to use PWM with hardware timer, you need to make sure, that the SoftwareSerial library doesn't want to use the same timer). For the servo it's similar. The servos position is encoded by pulse lengths. (Make sure, that the used library doesn't want to use an already used timer)

Unless you use techniques as multiplexing or matrixes (which are not that useful for a small number of LEDs), you need 1 pin per LED.

Depending on what exactly you want to achieve, you will pretty fast run out of pins. Since you are a beginner you should start with a chip with more pins. If you don't know, how exactly your project will be in the end, better by a chip with maybe double the pins, that you think you need. Develop, until you really know, what functionality your project should have, what not and what you need to achieve that. Based on this you can choose the correct chip, that is as small as possible. Also consider using SMD parts in the finished version. There are mostly much smaller, but also more difficult to solder.

  • Thank you for your answer :) i understand most of the information you mention in the first part but i've never counter information about using chips as shrink arduino. Can you inform me more about that topic? – Hedgehog99 Dec 17 '18 at 3:09
  • An ATTiny is a chip (more precise a microcontroller), but not an Arduino. Mostly an Arduino is a complete board with the microcontroller and every other essentiell part, that is needed for operation. If you use the internal oscillator of the microcontroller, you can operate it nearly without extra components, though you should add a decoupling capacitor. – chrisl Dec 17 '18 at 8:56
  • I see thank you I learnt alot from it. So i looked around and found the ATtiny2313 that is relatively quite a good size and contain lots of pins. Can i get your opinion on this chip. Will it be good for my project? – Hedgehog99 Dec 17 '18 at 12:27
  • That looks good. It has a hardware UART, so that you don't need SoftwareSerial, also 4 PWM outputs with 2 timers and more pins. I think with this you should be able to create your project. For the LEDs: If you only want to control them between on and off, you can also use shift registers to expand on the pins. Finally, when you are finished developing the project, you can change the chip to a smaller one, that is right enough for it (too much limitation during development can be frustrating and expensive). – chrisl Dec 17 '18 at 14:39
  • Thank you for your guidance, with these information I can learn more on electronics and start on my project :) – Hedgehog99 Dec 18 '18 at 6:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.