Some of you may have already seen my posting about the Arduino UNO Clone for DIYers. The Arduino compatible board introduced on that posting was actually built for helping my daughter with her Arduino projects and was very successful. I and she have built several of them and used them well for studying Arduino and for some projects.
My daughter has recently made a music box with one of them. It is finished in a small box with 3 buttons. If one of the buttons is pressed, it plays the melody assigned to the button among 3 different melodies stored in the box.
I think she has done a good job but she still wants to make it enhanced and able to play longer melodies while keeping the existing hardware and the case.
I decided to build another Arduino compatible board with more memory to store longer melodies and this is it!
[ PIC 1 ] R1 in action
Please understand that the completeness of this may not meet your expectation as it is designed solely for my personal use.
a. It should be compatible with Arduino UNO.
- Arduino IDE should work with it.
- It should not additionally require any programmer, adaptor, Serial to TTL(UART) converter or etc. to program.
b. Shields for Arduino UNO should work with it as well.
- The board size and the shape should exactly be the same with the original Arduino UNO so it can directly replace the Arduino UNO board in my daughter's music box.
- All components except for the Barrel Jack for external power source, shouldn’t be taller than headers to be able to use various shields designed for genuine Arduino UNO.
c. It should be easy to build and easy to use.
- Bigger through-hole components should mostly be used for the people doesn’t enjoy soldering SMD.
- USB C type cable should be used instead of Standard B type.
d. Its circuit should be simplified for a better understanding.
- Use the parts easy to find or I currently have.
- Eliminate or simplify power selection circuit, crystal, 2nd microcontroller for Serial to TTL converting, headers for reprogramming the 2nd microcontroller and etc.
e. It should have enough memory to store more data.
- We should not forget that its major objective is to store longer melodies in the music box.
2. Circuit Design
- I looked up datasheets of many microcontrollers and compared them with ATmega328 of Arduino UNO for long time to find the most compatible DIP type microcontroller with ATmega328 but with more memory.
- My decision this time is to use ATmega1284 even if it is quite big to be placed on the Arduino UNO board.
- Arduino bootloader for ATmega1284 can easily be found from the internet. I used MCUdude's MightyCore with its Bobuino pinout and my ATmega/ATtiny Microcontroller Programming Shield for Arduino As ISP R2 to burn the bootloader.
- ATmega1284's register bit structure is exactly the same with ATmega328's. It lets most of all Arduino UNO compatible libraries and sketches work on the board with ATmega1284.
- Please find the comparison between ATmega328 on Arduino UNO and ATmega1284 on the Arduino compatible board to be built.
b. Power Source Selection:
- Unlike my previous design, Vin is directly shorted to the external power source from the barrel jack without a diode because Vin should sometimes be used for checking the voltage supplied by a external power source.
c. Power Regulators:
- I used SOT223 SMD type 1117V5 and 1117V33 for 5V and 3.3V voltage regulators respectively instead of TO220 through-hole type devices used for my previous design to save space on the board as ATmega1284 is too big to let the 2 big through-hole type regulators placed on the board with it. It is fine as my daughter is now able to solder relatively bigger SOT223 SMDs.
- Please find the details from my previous posting.
d. Serial to TTL(UART):
- I used CH330N just like the R1 model on my previous posting.
e. Buffer to drive the built-in LED for the digital pin 13:
- A small NPN type transistor, FJN3305R, which bias resisters are included in the package is used for it to save the space on the board.
- Please find the details from my previous posting.
f. USB Jack:
- I decided to use a USB C type jack to be in line with the trend.
- There are a few through-hole type USB C jacks in the market. I just used a SMD type device for R1 model as I currently have some in stock and a through-hole type device for R2 model.
- FYI, I actually built 3 slightly different models, R0~R2. The only difference among them is the type of USB jack. 5 pin Micro B SMD type, USB C SMD type and USB C through-hole type jacks are used for R0, R1 and R2 respectively.
[ PIC 2 ] R2 Schematic
|U1||IC||CH330N||1||CH330N||Jiangsu Qin Heng CH330N - USB to Serial Converter|
|U2||IC||1||TEXAS INSTRUMENTS - IC, V REG LDO 0.8A 5.0V, SMD, 1117, SOT-223-3|
|U3||IC||REG1117-3.3||1||TEXAS INSTRUMENTS - IC, V REG LDO 0.8A 3.3V, SMD, 1117, SOT-223-3|
|U4||IC||1||MICROCHIP - 8 Bit MCU, Low Power High Performance, AVR ATmega Family ATmega128 Series Microcontrollers, 20 MHz|
|IC Socket||20P SIP x 2||2||MILL MAX - SIP SOCKET, 20POS, 2.54MM, THROUGH HOLE|
|Q1||Transistor||FJN3305RTA||1||FJN3305RTA||ON Semiconductor - Pre-Biased Bipolar Transistor (BJT) NPN - Pre-Biased 50V 100mA 250MHz 300mW Through Hole TO-92-3|
|A1||Header||6P, 2.54 mm||1||2212S-06SG-85||MULTICOMP - Board-To-Board Connector, 2.54 mm, 6 Contacts, Receptacle, 2212S Series, Through Hole, 1 Row|
|Header||8P, 2.54 mm||2||2212S-08SG-85||MULTICOMP - Board-To-Board Connector, 2.54 mm, 8 Contacts, Receptacle, 2212S Series, Through Hole, 1 Row|
|Header||10P, 2.54 mm||1||2212S-10SG-85||MULTICOMP - Board-To-Board Connector, 2.54 mm, 10 Contacts, Receptacle, 2212S Series, Through Hole, 1 Row|
|J1||Jack||Barrel Jack||1||FC68148||CLIFF ELECTRONIC COMPONENTS - DC Power Connector, Jack, 5 A, 2.1 mm, Through Hole Mount, Through Hole|
|J2||Jack||USB C||1||GCT - USB Connector, Charging Connector, USB Type C, USB 2.0, Receptacle, 16 Positions|
|J3||Header||6P(ICSP), 2.54 mm||1||2213S-06G||MULTICOMP - Board-To-Board Connector, 2.54 mm, 6 Contacts, Header, 2213S Series, Through Hole, 2 Rows|
|J4||Header||2x6P, 2.54 mm||1||MULTICOMP PRO - PCB Receptacle, Board-to-Board, 2.54 mm, 2 Rows, 12 Contacts, Through Hole Straight, 2214S Series|
|R1, R2||Resistor||1K Ohm, 125mW||2||MCCFR0W8J0102A20||MULTICOMP - Through Hole Resistor, 1 kohm, MCCFR0W8J Series, 125 mW, ± 5%, Axial Leaded, 200 V|
|R3||Resistor||10K Ohm||1||MCCFR0W8J0103A20||MULTICOMP - Through Hole Resistor, 10 kohm, MCCFR0W8J Series, 125 mW, ± 5%, Axial Leaded, 200 V|
|R4||Resistor||1M Ohm||1||MCCFR0W8J0105A20||MULTICOMP - Through Hole Resistor, 1 Mohm, MCCFR0W8J Series, 125 mW, ± 5%, Axial Leaded, 200 V|
|RN1||Resistor Array||4x1K Ohm||1||4605X-101-102LF||BOURNS - Fixed Network Resistor, 1 kohm, 4600X Series, 4 Elements, Bussed, SIP, 5 Pins|
|C1 ~ C7||Capacitor||0.1uF||7||MCFYU6104Z6||MULTICOMP - Ceramic Disc Capacitor, 0.1 µF, 50 V, MCFY Series, +80%, -20%, Y5V, 5 mm|
|C8, C9||Capacitor||47uF 25V||2||UHE1E470MDD1TD||NICHICON - Electrolytic Capacitor, Miniature, 47 µF, 25 V, HE Series, ± 20%, Radial Leaded, 5 mm|
|C10||Capacitor||10uF 6.3V||1||EEA-GA1C100H||PANASONIC - Electrolytic Capacitor, 10 µF, 16 V, GA Series, ± 20%, Radial Leaded, 4 mm|
|SW1||Switch||2P or 4P tect||1||MJTP1230A||APEM - Tactile Switch, MJTP Series, Top Actuated, Through Hole, Round Button, 160 gf, 50mA at 12VDC|
|D1, D2||Schottky Diode||1N5819||2||1N5819RLG||ON SEMICONDUCTOR - Schottky Rectifier, 40 V, 1 A, Single, DO-41, 2 Pins, 600 mV|
|D5||LED||L, Yellow, 3mm||1||L-7104YC||KINGBRIGHT - Yellow LED 3mm Through Hole|
|D6||LED||RX, Red, 3mm||1||L-7104EC||KINGBRIGHT - Red LED 3mm Through Hole|
|D7||LED||TX, Blue, 3mm||1||L-7104VBC||KINGBRIGHT - Blue LED 3mm Through Hole|
|D8||LED||ON, Green, 3mm||1||L-7104GC||KINGBRIGHT - Green LED 3mm Through Hole|
|Y1||Resonator||16MHz, 20~30pF||1||AWCR-16.00MD||ABRACON - Resonator, Ceramic, 16 MHz, Through Hole, 3 Pin, 40 ohm, ± 0.5%, 30pF, AWCR Series|
The gerbers files are attached.
[ PIC 3 ] R2 PCB Layout
I had to do some trick to fit all the components in the small space on the PCB and to make it look better. I put most of all ceramic capacitors, resisters and a resonator in the thin space between the microcontroller and the PCB.
You can make it better than this with smaller axial type capacitors. I used the bigger disk type capacitors as I have too many of them in stock and wanted to use them off first.
[ PIC 4 ] R1 Assembly