Arduino is an open source platform supported with hardware and software which can easily be used and operated by makers all around the world. I had a chance to play with it thanks to OD LAB conference offered by a joint degree master program, Master of Open Design, which is being held by UBA and HU Berlin.
Arduino Uno is a type of microcontroller which enables to be programmed. The electronic products work in the axis of “command” and “action”. So basically, we connect Arduino to our computers, we program it for a certain job, that means we create commands, and connect it to the device to implement the algorithm of the action.
Arduino board includes;
- analog and digital outputs, (you can also program whether it is going to be an input or output),
- arithmetic and logic unit (ALU) to do the calculations,
- a processor, to organize the algorithm and process the information,
- a memory unit to store the codes and commands.
Since it is an embedded computer, it operates by itself in a loop as long as it is connected to a power source.
Arduino has both analog and digital outputs. One of the best examples to illustrate the difference between analog and digital is listening music from vinyl players or computers. For analog, everything is real, a little needle touches the carvings in vinyl and produces continuous sound for it to be amplified later. In computer, the sound is not continuous, it is composed of little fragments created by digits which human ear cannot sense.
LIGHTING A LED
LED (light emissive diode) is a light source which has a positive and a negative leg. Shorter leg is negative and it should be connected to the circuit in the right way. The current goes from negative charge to positive charge, that’s why shorter leg should be connected closer to the negative charge with a serial connection.
LDR is a “light depending resistance” as you will get, its resistance depends on the amount of light caught by LDR itself. If there is more light, the resistance will increase, and if there is less light, it will decrease accordingly.
In a safe circuit everything should be calculated and excess voltage should be balanced with resistors. Resistors kind of consume extra voltage and protect other equipments from burns or damages by excess voltage. I had 33o ohms, 1 kohms and 10 kohms resistors for OD Lab. Resistors can also be combined to create other resistors in desired values. When connected serially, we simply add values to each other and calculate the sum, which is used for increasing the resistance. When they are connected parallel on the other hand, the value decreases.
serial: R1 + R2 = R3
parallel: 1/R1 + 1/R2 = 1/R3
A basic knowledge of circuits and electronic design is necessary to work with Arduino effectively and safely. Normally, we can connect everything together without a protoboard, but the advantages of using one are many, such as keeping the circuit tidy and easing the process of assemble and disassemble. Since we are working with relatively small voltages, protoboards are making sure that every element is connected with each other properly. Still, sometimes there can be disconnections.
There are basically metal sticks in a protoboard and when we plug a LED, its legs touch these metal sticks. Therefore, it is good to know the structure of your protoboard to avoid short circuit or any kind of damage that can affect your electronic pieces, your Arduino and sometimes even your computer.
INCLUDING LDR TO THE CIRCUIT
LDR is connected to the circuit serially but unlike LED, its legs are identical. LDR also needs to be connected to an output of Arduino board. In the right, my LDR is connected to A0 (red cable). With this connection we were able to monitor the change in resistance value in time. However, for better results, LDR and LED should be kept in a dark environment. Daylight affects the results considerably.
BUILDING & TESTING THE BALANCE
I worked with the 3D printing studio which I usually send my CAD models to be printed. It took one day and the model which was given to me was in good standards. I have just sanded the pieces as Heidi instructed and I used a little bit glue for some parts to give it more stability.
I used the small slit to have more precision, attached the LED and the LDR as instructed. When building the balance, some knowledge about soldering helps a lot. We created the circuit on protoboard however legs of the LED and the LDR are supposed to be extended with wires. Again, I used color coding for the LED connection because it has polarized legs. I used a neutral color for negative leg and a bright color for positive one. It would have been so hard to decide the negative leg if it would all be wrapped up. I wrapped all open parts with insulation tape later and fixed the sensor and light source to the balance.
The idea of building a scale by using LED and LDR seems interesting at first. How can we measure weight of an object by using light?
In order to understand this, we need to identify mobile and fixed elements of the scale. The weight of the object creates pressure on the balance and directly on the LED. Since LDR is fixed, when LED moves down the amount of light that is captured by LDR reduces. Heavier objects push down the LED more, and therefore the light captured by the LDR is less than the lightweight objects. This is the technique behind the idea.
We also do need a software like “INO”(arduino software) or “Processing” to be able to do the testing, calculations and calibration.
ARDUINO INO & PROCESSING
INO:
This is the code for lighting three LEDs from the section above “lighting a led”.
In the code, there are some lines start with “//” These are the comments or info and is not used by ino. So instead of deleting a piece of code, we simply can make it a comment.
We also need to put “;“ at the end of every line. Every code group also should be defined inside “{}”
Knowing these basic info gives one to read and understand a code even if one cannot write. When coding in ino, we first need to create our constants, and define our outputs. This basically means that you need to inform ino about which output you have connected to your element. it could be LED, LDR or any kind of sensor.
In this example, data is inserted with “int” command. “define” command can also be used for giving name to any element. As you see we have 3 LEDs on protoboard which are connected to A0, A1 and A2.
Then we need to do void setup. Pinmode decides that it is going to be an input or output. In this case we want our LEDs shine. So it is an output.
“DigitalWrite” assigns High or Low value to an output. When the LED is on, it is High, when the LED is off, it is Low. “Delay” command indicates time passed in this action in miliseconds. (1000 miliseconds make 1 second)
digitalWrite(LED_0, HIGH);
delay(2000);
digitalWrite(LED_0, LOW);
delay(2000);
Void loop defines how the LEDs going to behave for the entire process. (until a new code uploaded to the board or the board is unplugged from power source) For instance, in this code, LED0 will shine and it will last for 2 seconds, and then it will go off and stay like that for 2 more seconds.
After writing the code, it needs to be checked and uploaded to Arduino board which is possible with a click.
The code for creating a scale is more complicated than that because we have an LDR and it is an input that brings information to the computer. In ino, we can monitor this information in serial plotter. We have also defined the baudrate value, (38400 – picture below) and it should be consistent with the one in serial plotter. It is a predefined series of values used for serial communication.
This is my serial display on ino. Normally, Arduino operates with two different voltages. 3.3V and 5V and the highest resolution on the plotter we get is 1023. For this project we have rearranged this value with a reference on the protoboard. As you see above, my highest value is 300 instead of 1023. This is because of reference voltage.
The green jumper in the middle connects between resistors goes directly to AREF which is a pin used for reference. Black jumper carries negative power and yellow carries positive. By doing this, we reduce the fixed voltage to nearly 0.8V.
PROCESSING:
We used processing for calibration because its ability to do the calculations is faster than ino. Here is my first attempt of calibration:
I used couple of 1 Turkish Liras to do the calibration. One weighs 8.3 grams. In this code, we have built a little screen to monitor the value of LED moving downwards. For instance, if the value is 7330, it means the scale is empty. when I put a coin on the scale, which makes 8.3 grams in fact, it becomes 7500. If I put 5 coins on it, the value is 8540. Calibration means that we are correcting code according to our own conditions. We change the code and we run it. For doing the calibration, we need to wait for some time after plugging Arduino to find its natural balance, and we need to do the calibration quickly.
Although I got really close results to what I predicted, (for two coins it should be 16,6 and in the window it is 15,6) the scale was still losing its calibration when I start to testing the other day. So, I decided to attach some lightweight coins on the plate because the plastic was too lightweight to do the calibration. Then I repeated the calibration one by one.
EXPERIMENTING WITH PNEUMATIC ACTUATORS
Pneumatic actuators can be designed as “open” and “close” systems. In open systems pressure is changed by an outer pump which means we are pumping more air to the system which naturally increases the pressure inside. However, in closed systems the pressure is changed by temperature.
This is a closed system and we are changing the pressure inside by using temperature, in this case, it means touching the bottle with our hands. This is the calculation of my estimation when touching the bottle with one or two hands. According to the calculations, 1 hand should make 16.5 grams on the scale. In monitor, it was 10.7 grams. Although the calibration was not that precise, I would say that the scale was very sensitive and involving my hands to increase the temperature of the bottle was of course creating some small inconsistencies.
Overall, Arduino is fun to learn and we can make many things by experimenting with it. What experimental design means so far to me is, not constructing or imagining the design first but trying to unlock its possibilities and letting the nature itself reveals the perfect form for the object. For doing this one must develop an idea step by step, by adding one thing or removing one thing from the design each time, and if the idea is not good enough, one should feel free to jump another related one, go to the previous phase and think it again further from a different perspective.