DIY Arduino

We build us a D.I.Y. Arduino Copy.

creator: x14km2d | build: 2021-12-04 | update: 2021-12-26

Intro

In most cases, a keyboard consists of several main components. These include the push buttons with the circuit board on the one hand and the microcontroller and the connection cable on the other. Since we have so far only created one board with the pushbuttons, in the next steps we have to ensure that the keyboard is also recognized as such by a computer or software and that we can send data. For this we will use an Arduino D.I.Y. microcontroller, which enables us to develop fast results in simple and small steps.

We will also not immediately create a working keyboard controller, but build an Arduino copy to adapt it to our project. In the first step we will let a light-emitting diode flash, which is like a Hello World of electrical engineering. This way we can be sure that everything works so far and that hardware and software will run smoothly. It is cumbersome to build a complex circuit and then find out that it does not work. If we fix errors in a basic circuit, we can concentrate better on the important sources of errors later.

The research took place mainly on the Internet, as this is a do-it-yourself topic and is therefore more up-to-date. The main focus was on the large online video service provider, which is used by a large scene of hobby craftsmen, hackers and developers. There one could collect most of the information, compare videos with each other and choose especially according to the requirements. There were also other sources, but they were not up to date or incorrect in terms of the technical requirements.

All materials were ordered and delivered online by wholesalers. The delivery time of the material was not included in the time planning, since this can extend over months. You should always have a sufficient amount of material at home, otherwise projects can be very much delayed. I already mentioned this in the other documentation. I ordered the Arduino microcontroller with the USB-to- TTL converter from a major online mail order company. There are different models, so you can look around among a large number of providers.

Basic Arduino

The main component of our keyboard controller is the Atmega328P microcontroller. This has tillers, which are arranged one after the other from 1 to 28. Pin 1 starts on the side with the small triangle printed on it and the bulge, which looks like a semicircle. They are arranged counterclockwise. As you can see on the following pictures, our microcontroller is arranged so that pin 1 is on the left side in front of us. In the further work process the direction changes and this should be taken into account if you want to avoid errors in its construction.

In the first step we place the quartz oscillator on tiller 9 PB6 & 10 PB7. It does not matter in which running direction the component is used.

The first ceramic capacitor is connected to tiller 8 GND & 10 PB7.

The second ceramic capacitor is connected to tiller 8 GND & 9 PB6.

The LED is applied to pins 19 PB15 & 22 AVCC on the other side, the resistor is located at pin 19 (PB15). The LED is required to perform the first function test.

We turn the breadboard by 180° and use the USB-to-TTL converter. We take care to leave enough space for further cabling.

In the next steps we refer to our model, if there is another end product of converter, we have to pay attention to the labeling. USB to TTL converter labeling right to left OTR, RXI, TX0, VCC, CTS, GND.

Connect the first cable (red) from VCC (positive power supply) from the converter to pin 7 (VCC) microcontroller. This ensures that our microcontroller is supplied with power.

To close our power circuit, we connect the black cable to GND (converter) and pin 22 (GND).

Connect the green cable to pin 1 (PC6) and let the cable run to the right of our USB-to-TTL converter into the void. Why do we get explained at the end of the documentation.

The yellow cable is connected to pin 2 (PD0) on the microcontroller and TXD on the USB to TTL converter.

The orange cable is connected to pin 3 (PD1) and RXI. Between the green to empty running cable and the DTR pin of the converter we place another 100nf ceramic capacitor with a 104 printed on it. Before we can use our microcontroller to make the LED flash, we have to install software on the microcontroller. To do this, we download the Arduino IDE to our computer.

We start the Arduino software and open the flashing example. For this we follow the path File > Examples > 01.Basics > Blink We will not program or script ourselves, because we only want to run a first test with our built circuit. If you really want to learn about Arduino programming, you should download and read the documentation. In this project, the module is only a functional extension and in due course we will have to deal with programming again. Next, Tools > Board > Arduino Uno there we select the board with which we are currently working or simulating. We have to tell this to the application, because there are a lot of different boards from Arduino and not all work the same.

Tools > Serial Port > dev/ttyUSB0 we’ll shut down our port. Since I work with Linux Mint, dev/ttyUSB0 is displayed on my monitor. Please don’t let this confuse you. If the port button is grayed out, you have to connect the microcontroller with the USB cable to your computer and restart the IDE. With File > Upload (Ctrl+U) we load the example sketch onto our microcontroller. The LED on our microcontroller starts flashing and with that we can be sure that our microcontroller or our technical structure works so far that we can remove it in the next steps and upgrade it to a working keyboard.

In the next steps we will attach push buttons to our circuit so that we can send certain codes to our laptop or other output device. This will initially be limited to simple functions, since we first want to prove feasibility in a study. Later our self-developed keyboard will be added to the project.

LCD Display

We took the first step towards our own d.i.y Arduino by purchasing an ATMEGA328P microcontroller and testing its functionality in a first attempt. In this documentation we will connect an LCD, i.e. a liquid crystal display, to display simple information. I have oriented myself on the design of learning computers, such as the LC80, POLY880 CP1. These are classics, new models are primarily known through VTECH. My plan is to display information later.

It should then go in the direction of a very simple computer. Of course you ask yourself why you can’t develop a Raspberry Pi right away. In the Heinz-Nixdorf-Computer-Museum this was shown to me very well, because the whole technology of computer science available to us is based on the basic ideas of information storage, processing, transmission and presentation. For example, Ada Lovelace, George Boole, Charles Babbage and Gottfried Wilhelm Leibniz can be described as pre informaticians, since they have made important achievements in this field. The history of computers does not start in the 21st century.

During my research I focused on what liquid crystal displays are available and which are the easiest to connect to an Arduino Uno, respectively to an Atmega328P microcontroller. I first watched some videos that go in this direction, but then orientated myself on a Hello World tutorial by Arduino. My goal of spending as little money as possible on an ad was easily achieved with the HD44780. It was also so easy to set up that it could achieve results quickly.

The bare diy Arduino with an LCD

For this documentation I had to order some pin headers, because I didn’t have any more in stock. Unfortunately the delivery from China took me much too long and therefore I looked around for another solution. Desoldering of components is possible, but also quite time-consuming. It also bothers me when too much electricity is consumed.

Since the main board is too big for a helping hand, I simply clamped it firmly into the parallel vice. There it cannot slip if we unsolder the tiller with the hot soldering iron. We desolder the tiller by melting the soldering iron on the underside, so that we can pull the tiller or metal pins out of the main board with pliers. Normally we hold the pliers with one hand and the soldering iron with the other. But since I only have two hands, I still have to take the photo with one. If a pin is bitchy and does not want to be released easily, it sometimes helps to fuse the old spot with new solder and then try to desolder the pin again. In most cases this has helped me quite well. Here we see the desoldered tiller. At the lower ends you can still see the old solder. In the upper right corner we can see a roll of new solder.

After we have soldered enough tiller from the main board, we clamp the liquid crystal display into our helping hand and solder the first pin. It doesn’t matter whether we start left, right or in the middle. Everyone can decide for himself and doesn’t influence our working step. The helping hand can turn out to be a very bitchy tool and you need to gain some experience on how best to work with it. By the way, we have to be careful not to break off the resistors on the back of the display.

Before we solder on all the tillers, we test on our pin board whether everything works as we thought it would in theory. Especially when we are soldering something firmly, it is better to have a closer look first and go through the work step in our heads. Soldering is easy, soldering something off is stressful and annoying. When we’re done, our liquid crystal display should look exactly like the picture above. Please pay close attention to the gaps between the solder joints, so that no unwanted connections have formed. In the worst case, they can cause a malfunction and damage your display.

This is our basic structure, with which we can then continue working in peace. Wasn’t that difficult so far and there shouldn’t have been any relevant problems. At the beginning soldering is always a little difficult and unfortunately you can only learn this through experience, time and constant practice. Once again the note: This article sets the cables between the individual tillers differently, since we do not use a purchased Arduino Uno here. I set up and dismantled this circuit a total of three times to test how it all works. This documentation is therefore a special application case.

In the first step we connect a yellow cable from RS Register Select RS = 0 (instruction register), RS = 1 (data register) to Pin18 PB4, (PCINT4/MISO), Digital Pin 12 to our microcontroller. The register selection distinguishes whether instructions or data are sent by us.

The next cable is connected from E (Enable) to pin17 PB3, (PCINT3/OC2A/MOSI), Digital Pin 11 (PWM). I wasn’t quite sure about the importance of lettering on the liquid crystal display because it may differ on models (which differ in quality). I had read it again in some article, because it is also sometimes referred to as EN.

We connect the LCD D4 data bus to pin 11 PD5, (PCINT21/OC0B/T1), Digital Pin 5 (PWM). Since we only use a 4-bit instead of an 8-bit data bus, we only have a total of four steps, or cables, that we can use from D4… D7 together.

Yellow cable 4 is connected from D5 to pin6.

Yellow cable 5 is connected from D6 to pin5.

Yellow cable 6 is connected from D7 to pin4.

We integrate the potentiometer into our circuit, with which the brightness of the liquid crystal display can be adjusted during the function test. It doesn’t matter where exactly the potentiometer is, there should only be enough space around it so we don’t build ourselves a rats nest.

We use the 200kOhm resistor (red, red, brown, gold) in our circuit. This goes from A (on the display) to the plus (+) line on our pinboard. Plus(+) are the horizontal slots on the pinboard above the red line. Minus(-) is then below the blue line. There are always four horizontal slots on a pin board to help us set up our projects, as we always have to form a closed circuit.

Blue cable from Potientiometer middle up to V0.

Red cable 1 from pin7 to plus + line on breadboard.

Red cable 2 from plus + line on pinboard to potentiometer bottom right.

Red cable 3 from plus + line on pinboard to VDD.

Black cable 1 from pin22 to minus - line. The black and red prototype cables are current- carrying lines with red plus(+) and black minus(-) defined. You should keep this in mind, because if we cut out a USB cable, we can see the two colors mentioned above between the data cables (white, green). Believe me. There are reasons why I rebuilt and dismantled the circuit three times.

Black cable 2 from Minus - line on breadboard to VSS.

Black cable 3 from Minus - line on pinboard to RW.

Black cable 4 from minus - line on breadboard to potentiometer bottom left.

Black cable 5 from minus - line on breadboard to K. Thus our circuit is finished from the hardware side. And here’s another piece of advice. Work as cleanly as possible, as this saves you time in troubleshooting. As already explained in the keyboard controller documentation, load the source code LCD.txt into our Arduino IDE and transfer it to our microcontroller. After we have transferred our software to the microcontroller, our LED flashes several times and the text entered by us is displayed. Besides, our circuit counts up from zero as long as it is switched on.

Some potentiometers do not have a small knob, in this case you take a slotted screwdriver as you can see at the top of the picture and insert it carefully and can adjust the potin. A toothpick is incredibly practical for rough hands and helps to count the individual slots on the pinboard. It can also be inserted somewhere as a memory aid and it is very difficult to trigger a short circuit (because it is made of dry wood). If you only see black boxes on the liquid crystal display, you have placed one or more cables incorrectly. So you have to check your whole setup again and see exactly where the error is. This only happens if you have worked uncleanly. In this documentation we assume that we have not changed the source code and that the display has been bought and tested again. Once we have connected our liquid crystal display to our project, we need to think about how we can use it sensibly. I imagine that this could be used as a source of error output. Although there are also some projects on the net that also use the display as a screen for very simple computers. I don’t know if I really want to. I still have some thoughts and ideas that I want to try out.

Battery Update

When designing a computer on a breadboard, there is no uniform set of rules regarding the structure. The design of the base is based on a keyboard that can be used by the user like a carrier bag. The appearance is influenced in all cases by the personal taste of the developers or materials used. A breadboard computer must therefore have an autonomous power supply in order to be able to function for a few days without charging. For this, electricity must be a storage within the construction, e.g. by batteries, accumulators, etc.

In addition, a reset button is required, which can restart the complete system by rebooting, just like on a desktop computer. This means that the breadboard d.i.y. Arduino does not have to be isolated from the current power supply. Sometimes the running processes or tasks help to interrupt, for example you can run a programming loop that counts up to
infinity and continues until the power supply is interrupted. In the second part of this documentation, a voltage regulator is implemented that allows various power sources to be connected to the breadboard computer.

In this chapter, the material can be purchased from an regular online electronics shop because there are no special or unusual components. One battery holder, with clip and batteries. We use it to power the diy Arduino, so that we are no longer dependent on the power supply of the laptop. Various components we need to provide power support.

Before implementation, the entire project was rearranged once and arranged more compactly on the breadboard. This will free up space for the next updates. First, the micro button is applied to the microcontroller. The button is now on the side where there is no notch.

The black cable is connected from the micro button (top left) to GND (Ground) of the USB to TTL converter. This integrates the pushbutton into the power circuit.

The red cable is connected from the micro button (bottom right) to the ATMEGA328P microcontroller at 1 PC6 (PCINT/RESET) reset. By pressing the button, the microcontroller is rebooted and starts counting again from the beginning in this example.

Now, the voltage converter is installed. This will protect the rest of the electronics or the sensitive circuit and components from voltage peaks. It is then also possible to connect autonomous power supplies to the diy Arduino and is no longer dependent on the power supply of the USB to TTL. If microcontrollers have already been used, it is likely that there is already a preferred way to connect a power supply to the plug-in board. In the next steps, a 12v battery pack is used and converted to 5.5v.

For the basic design of the voltage regulators, the current VCC and grounding cables GND are added. The circuit is located at the other end of the breadboard, so that there is enough space on the rest of the board for further components.

Add the two 10uF capacitors between the IN of the controller and ground and a 10uF capacitor on the right rail between power and ground. The silver strip on the capacitor indicates the earthing arm (GND).

The LM87058 voltage regulator is added. The controller is a TO-220 package in which the input of the external power supply is on the left, the ground is in the middle and the 5V output is on the right.

The circuit on the left side of the board consists of the LED, a ground cable and the 1× 0.22 Ω (with a tolerance of ±5%) (red, red, brown, gold) resistor. An LED connected to the power supply in this way is a great trick for troubleshooting. So you will always know when the board is powered or if it is short-circuited due to a fault.

The red and black cable to the left of the voltage regulator is where the battery pack is connected. The red cable is for VCC and the black cable for ground (GND). Care must be taken to connect only one battery pack (or power supply) between 7 and 16 V, otherwise no 5V will come out of the regulator. If the power supply is higher, the controller may be damaged. A 9V battery, 9V DC supply or 12V DC supply is suitable. Now only two cables are used and the first test of the circuit is started.

The voltage regulator is connected to the rest of the circuit with two further prototype cables. This means that the diy Arduino is no longer dependent on a power supply via the USB to TTL module. It can be operated with the battery pack until the individual batteries are empty.

The next step will be to install a USB accumulator and a solar cell. This means that the deck can also be supplied with solar energy.


Download the diy_arduino.md source file or follow this page with RSS. Some readers will want to know what Equipment I use. Who wants can Support my work or leave a Comment. Please use my PGP-Key for your submission.

x14km2d.com | 2021-2022 | Made for the Web1.1 with a Terminal and Pandoc.