This article was translated to English, and was originally published for deviceplus.jp.
This series will focus on learning the principles and basics of crafting electronic kits through simple crafts made with Raspberry Pi. Teaching us today will be Mrs. Naomi Ito, author of a series of books explaining about “deep mechanisms” in the media art field. In this article we’ll be applying all of the mechanisms we’ve learned up to now and go over the techniques and processes for building a new piece.
[Table of Contents]
Nice to meet you all again, it’s Naomi (I wonder if I have to keep introducing myself like this). Lately, I’ve done a couple of electronic kit workshops in a variety of places, including exhibitions on some pieces. I’ve learned a lot through that experience. Looking at this series of articles as a whole, today’s piece will be the fourth. We’ll be using the sensor I introduced in the third article to make some simple pieces, so let’s get things rolling!
The Photo Reflector RPR-220 is a combination of an infrared LED and a phototransistor that detects the presence or absence of light by reflecting it on an object. If you look at the data sheet, it is written as a copier or office automation equipment, so it may be used to detect the movement and position of mechanical objects such as paper, gears and cams.
Now, what can you do with Raspberry Pi using this? Last time I tried out a simple experiment using an LED that lit up whenever a finger approached nearby. When I tried out a variety of other experiments, I found that even transparent plastic reacts in some places. If you change the angle, such as tilting it, it may not respond. So the infrared light will be reflected on the surface of the plastic and it will enter the light receptor. Even if it is transparent, it does not mean the sensor does not work, rather that the usage has its limitations depending on the conditions and environments.
So you must be thinking, “What can I do with this?” or “What’s interesting that I can make with this?” Since photo reflectors detect objects, there’s no doubt that its role is to detect moving objects. For now, let’s try lining up four objects.
Lining it up horizontally, you’re probably wondering if it can detect motion, so let’s try out a simulation… and it’s a dud! I blame the heat, but that could be just me complaining about the summer, so that doesn’t resolve anything.
Anyway, one thing to look out for is finding out what makes something “interesting.”
If the movement of a finger or an object is a primary movement, it may be better to change it to a secondary movement so that it can be detected and use that to control. In other words, the switch is not turned on by directly pressing the button, but may be turned on by more difficult actions. In doing so, unexpected actions are developed by the movement of hands and fingers.
Then, I tried arranging four sensors, but instead of linear, it was cross-shaped. Attach this to the board, but not the breadboard. The board is used to connect parts, but I think it can also act as a way to fix parts in place. This time, we will use a substrate to hold down on any wiggle and withstand external impacts (although there are, of course, limitations). Inside the breadboard, the parts are inserted and hot molded into place (though if you’re going to go that far, I think just soldering them into place is good enough).
Moving on, the base design portion actually turned out to be harder than I thought. For this article, I used a universal circuit board. On the other hand, the design of the printed circuit board is highly flexible, so that makes this design pretty fun. Nonetheless, since it involves many troublesome tasks such as etching and drilling, which is better really depends on the person.
This time, we used universal boards lined up in 15 x 15 holes. Since four circuits are arranged in a cross shape, the same arrangement for one unit would be fine. The “unit” is just a photo reflector and a resistor.
Now, since I want to make the GND similar, I will turn it around and put the terminal part connected to the GPIO on Raspberry Pi all into one place. The power source, etc., have been consolidated to be separate from the GPIO input/output
Some people may mistake this, but the above figure shows the board from the component side. On the solder side (the side that is actually connected with a line), it looks like the following figure:
I’ll try soldering this ASAP. Since we used a universal board this time, we will solder using parts terminals, tin-plated wires, etc. Since we’ll be doing that, I want to take the opportunity to go over the basics of soldering.
Actually, it depends on the performance of the soldering iron used, and it greatly depends on the condition of the tip. A high tool that can adjust the temperature is still good, but in my case I often teach children, so I take that into consideration and use relatively inexpensive items that children can buy with their own pocket money.
The point is to moderately heat the point that’s going to be soldered until the solder is extremely thin. This “moderate” portion of things is the most difficult part, but practice makes perfect. Since soldering is also a technique, you can acquire it through careful training.
If you can do the solder, your circuit board should be complete.
I’m not as good at soldering, so I’m a little embarrassed, but the back (solder side) looks like this:
I then put the completed base into a case. Make a cut in the cross and put the photo reflector inside. Place a marble in this notch and tilt to roll. This is a mechanism that the photo reflector reacts to when the marble rolls. Let ’s call this the Katamuki Controller.
Let’s then insert this into the Raspberry Pi GPIO and use it. You can move the motor as described above with the Katamuki Controller, but first I tried to move the simplest and basic animation of a cat. I tried to make this shape on Scratch.
GPIO uses Nos. 4, 17, 22 and 27 and keeps them in a Pullup state. Since it is Pullup, the value of the normal sensor is 1. If the photo reflector reacts, the sensor value will become 0. The cat moves in a different direction according to the GPIO value of 0.
The cat moved in a slanted direction.
Some of my acquaintances are excellent engineers but have never soldered in their lives. Soldering itself is unexpectedly interesting, so please don’t try to avoid it and give it a chance.
Soldering seems to be the main topic for today’s article, but I think the important thing is realizing interesting ideas and technologies. Next time, I would like to talk about using the monitor screen as an interface.