|
ATTINY85-20SHRMicrochip Technology / Atmel
|
x 1 | |
|
pcbway pcb |
x 1 | |
|
led 0805 package |
x 2 | |
|
Coin Cell Holder |
x 1 | |
|
SparkFun buzzer (12mm) |
x 1 |
|
OrCad Cadance |
|
|
arduino IDEArduino
|
R2D2 Mini Edition
So here's something special, A Mini R2D2 PCB that speaks ASTROMECH.
Astromech is a fictional language in the star wars franchise consisting of whistles and beeps.
This Mini R2D2 that I made is a Keychain.
Its brain is an Attiny85 and is powered by a CR2032 Coin Cell holder.
I was inspired by this Instructables- https://www.instructables.com/R2D2-Sound-Generator/
MarceloLarios made a simple Arduino Uno setup that produces random beeps every 3 seconds.
I took the concept and prepare the whole thing by using an Attiny85 with a standalone circuit instead of using a whole Arduino UNO.
Attiny85 Setup
Before getting started, I prepared a simple Attiny85 Setup that consist of an Attiny Connected with a Buzzer and one LED.
I followed the below schematic for connection and made a Breadboard edition first.
I programmed the attiny85 with my Arduino as ISP Programmer just by putting the attiny85 onto the IC Socket and flashing the MCU.
PCB Design
After finalizing the breadboard edition, I started making a schematic in my PCB Designing suite which was this-
The Schematic consists of an Attiny85 connected with a CR2032 Cell, Two LEDs are connected in parallel are attached with Pin D2 and a Buzzer is added to Pin D0. (Buzzer Pin must be a PWM Pin)
A Switch is also there between CR2032 and Attiny85.
After Finalizing the Schematic, I move on to the designing part of the board.
I first searched for R2D2 2D Image on google and selected this one, it was minimal and will look good even after converting into Black and white BMP.
I had to convert this images into a BMP image as my OrCad PCB Suite only imports Images from BMP format.
After converting the image, I imported it as a silkscreen TOP layer and prepared the board around this image.
I put the Attiny85 and LEDs on the TOP side and added the remaining THT Components from the BOTTOM Side.
I also added a few solder mask openings on the copper layer and on FR4 to increase the aesthetics of the board. (to make it look great)
Getting PCBs from PCBWAY
After completing the design, I uploaded the Gerber data on PCBWAY's quote page, I selected the solder mask color which was BLUE and placed the order.
I choose BLUE Soldermask as R2D2 is Blue and Silver, White Silkscreen will replace silver color.
After placing the order, I received the PCBs in a week and the PCB quality was pretty great.
Really loved the end result.
You can checkout PCBWAY from here- www.pcbway.com
PCB ASSEMBLY
After unboxing the PCBs, I started the assembly process which had the following steps.
- Solder Paste Dispensing
- Pick & Place Process
- Hotplate Reflow
- Adding THT Components
- Flashing Process of Attiny85
Solder paste Dispensing
The first step is to apply solder paste to each component pad.
I used a normal Sn-Pb solder paste which has a melting temp from 140 to 270 °C.
PICK & Place Process
I then used an ESD Tweeaser to carefully pick and place each component on their assigned place one by one which took like 30 Seconds tops but the result was a perfect PCB with all the components placed in their location.
Hotplate Reflow
After the "PICK & Place Process", I carefully lifted the whole circuit board and place it on my DIY SMT Hotplate which is also homemade just like this project.
After a Few mins when the hotplate reaches the Solderpaste melting TEMP, all the components will get soldered by this Hot Reflow process.
We then remove the PCB from the Hotplate to cool down all components and board surface.
Adding THT Components
After Reflow Process, we add the remaining THT components which are the Coin Cell holder, Buzzer, and a slide switch with a soldering iron.
After adding the THT Components, our circuit is completed.
The Circuit is completed but to make it work, we have to burn the sketch into the Attiny85 MCU.
Code and Flashing
/*************************************************** <br> Project R2D2 Sound Generator
To all fans of StarWars and Arduino!</p><p> Written by Marcelo Larios
BSD license, all text above must be included in any redistribution
****************************************************/
#define speakerPin 0
#define ledPin 2
void setup() {
pinMode(speakerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
randomSeed(analogRead(0));
}
void phrase1() {
int k = random(1000,2000);
digitalWrite(ledPin, HIGH);
for (int i = 0; i <= random(100,2000); i++){
tone(speakerPin, k+(-i*2));
delay(random(.9,2));
}
digitalWrite(ledPin, LOW);
for (int i = 0; i <= random(100,1000); i++){
tone(speakerPin, k + (i * 10));
delay(random(.9,2));
}
}
void phrase2() {
int k = random(1000,2000);
digitalWrite(ledPin, HIGH);
for (int i = 0; i <= random(100,2000); i++){
tone(speakerPin, k+(i*2));
delay(random(.9,2));
}
digitalWrite(ledPin, LOW);
for (int i = 0; i <= random(100,1000); i++){
tone(speakerPin, k + (-i * 10));
delay(random(.9,2));
}
}
void loop() {
int K = 2000;
switch (random(1,7)) {
case 1:phrase1(); break;
case 2:phrase2(); break;
case 3:phrase1(); phrase2(); break;
case 4:phrase1(); phrase2(); phrase1();break;
case 5:phrase1(); phrase2(); phrase1(); phrase2(); phrase1();break;
case 6:phrase2(); phrase1(); phrase2(); break;
}
for (int i = 0; i <= random(3, 9); i++){
digitalWrite(ledPin, HIGH);
tone(speakerPin, K + random(-1700, 2000));
delay(random(70, 170));
digitalWrite(ledPin, LOW);
noTone(speakerPin);
delay(random(0, 30));
}
noTone(speakerPin);
delay(random(2000, 4000)); //(1000, 2000)
}
This is the code that I have used in this project, it was made by Marcelo Larios, and it's basically a random sound generator that generates two phrases.
As for Programming ATtiny85, I've used a SOIC8 Clip which is connected with my DIY Arduino as an ISP programmer. It's a setup that I made for flashing any AVR MCU through Arduino as ISP.
You can check this process out in detail from here- https://www.hackster.io/Arnov_Sharma_makes/multiple-attiny85-13a-programmer-84adf8
But Let me explain how to program an Attiny85 in short bullet points.
- we first need to download and install the Attiny85 Core files in Arduino IDE.
- which you can download from here- https://github.com/SpenceKonde/ATTinyCore
- go to the tools menu and choose the Arduino as ISP option in the programmer section.
- select the right board which should be newly added Attiny85
- Hit Burn Bootloader and wait for a few mins.
- Now Open the sketch that you want to upload to the Attiny85
- Go to the Sketch menu and select Upload using the programmer.
- and your Sketch will get uploaded onto the attiny85.
Adding Coin Cell
To power this setup, I used a CR2032 Coin cell which I then put on the coin cell holder and then turned the slide switch.
Doing this turns ON the R2D2 and it starts its beeping sequence.
Result
Here's the END RESULT of this built!
Thanks for reading this whole article, really appreciate it.
Do leave a comment or DM me if you need any help regarding this project, and I'll be back with a new project soon.
Peace
#define speakerPin 0
#define ledPin 2
void setup() {
pinMode(speakerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
randomSeed(analogRead(0));
}
void phrase1() {
int k = random(1000,2000);
digitalWrite(ledPin, HIGH);
for (int i = 0; i <= random(100,2000); i++){
tone(speakerPin, k+(-i*2));
delay(random(.9,2));
}
digitalWrite(ledPin, LOW);
for (int i = 0; i <= random(100,1000); i++){
tone(speakerPin, k + (i * 10));
delay(random(.9,2));
}
}
void phrase2() {
int k = random(1000,2000);
digitalWrite(ledPin, HIGH);
for (int i = 0; i <= random(100,2000); i++){
tone(speakerPin, k+(i*2));
delay(random(.9,2));
}
digitalWrite(ledPin, LOW);
for (int i = 0; i <= random(100,1000); i++){
tone(speakerPin, k + (-i * 10));
delay(random(.9,2));
}
}
void loop() {
int K = 2000;
switch (random(1,7)) {
case 1:phrase1(); break;
case 2:phrase2(); break;
case 3:phrase1(); phrase2(); break;
case 4:phrase1(); phrase2(); phrase1();break;
case 5:phrase1(); phrase2(); phrase1(); phrase2(); phrase1();break;
case 6:phrase2(); phrase1(); phrase2(); break;
}
for (int i = 0; i <= random(3, 9); i++){
digitalWrite(ledPin, HIGH);
tone(speakerPin, K + random(-1700, 2000));
delay(random(70, 170));
digitalWrite(ledPin, LOW);
noTone(speakerPin);
delay(random(0, 30));
}
noTone(speakerPin);
delay(random(2000, 4000)); //(1000, 2000)
}
R2D2 Mini Edition
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(8)
- Engineer Oct 20,2024
- Josue Fernandez Sep 25,2024
- Engineer Jun 02,2024
- Engineer Mar 12,2024
- Kathryn Fortunato Sep 04,2023
- Daan Uttien Jun 16,2023
- Pogodaev Oleg Vladimirovich Apr 04,2022
- (DIY) C64iSTANBUL Feb 28,2022
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
10usability
-
10creativity
-
10content
More by Arnov Arnov sharma
- WALKPi PCB Version Greetings everyone and welcome back, This is the WalkPi, a homebrew audio player that plays music fr...
- Delete Button XL Greetings everyone and welcome back, and here's something fun and useful.In essence, the Delete Butt...
- Arduino Retro Game Controller Greetings everyone and welcome back. Here's something fun.The Arduino Retro Game Controller was buil...
- Super Power Buck Converter Greetings everyone and welcome back!Here's something powerful, The SUPER POWER BUCK CONVERTER BOARD ...
- Pocket Temp Meter Greetings and welcome back.So here's something portable and useful: the Pocket TEMP Meter project.As...
- Pico Powered DC Fan Driver Hello everyone and welcome back.So here's something cool: a 5V to 12V DC motor driver based around a...
- Mini Solar Light Project with a Twist Greetings.This is the Cube Light, a Small and compact cube-shaped emergency solar light that boasts ...
- PALPi V5 Handheld Retro Game Console Hey, Guys what's up?So this is PALPi which is a Raspberry Pi Zero W Based Handheld Retro Game Consol...
- DIY Thermometer with TTGO T Display and DS18B20 Greetings.So this is the DIY Thermometer made entirely from scratch using a TTGO T display board and...
- Motion Trigger Circuit with and without Microcontroller GreetingsHere's a tutorial on how to use an HC-SR505 PIR Module with and without a microcontroller t...
- Motor Driver Board Atmega328PU and HC01 Hey, what's up folks here's something super cool and useful if you're making a basic Robot Setup, A ...
- Power Block Hey Everyone what's up!So this is Power block, a DIY UPS that can be used to power a bunch of 5V Ope...
- Goku PCB Badge V2 Hey everyone what's up!So here's something SUPER cool, A PCB Board themed after Goku from Dragon Bal...
- RGB Mixinator V2 Hey Everyone how you doin!So here's a fun little project that utilizes an Arduino Nano, THE MIXINATO...
- Gengar PCB Art Hey guys and how you doing!So this is the GENGAR PCB Badge or a Blinky Board which is based around 5...
- R2D2 Mini Edition So here's something special, A Mini R2D2 PCB that speaks ASTROMECH.Astromech is a fictional language...
- C-3PO Blinky Board Hey guys and how you doing!So this is the C3P0 PCB Badge or a Blinky Board which is based around 555...
- WALKPi Breadboard Version Greetings everyone and welcome back, Here's something loud and musical.Similar to a traditional walk...
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
74 0 0 -
DIY Laser Power Meter with Arduino
86 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
120 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
416 0 1 -
Custom Mechanic Keyboard - STM32
243 0 3