Tuesday, September 22, 2015

Hiking near Tokyo: Mt. Jinba

Since I moved to the Kantou region (Tokyo and surrounding prefectures), I have only hiked Mt. Nokogiri and Mt. Takao. This post reports on my third hike around Kantou: Mt. Jinba (陣馬山).

First, take a train to Fujino station (藤野駅). From Fujino station, get on the bus no.8, and get off at the last stop (和田, Wada). You are 355m high now. The bus ride is 247yen (as of Sept/2015) and takes 14min. You can pay either with an IC card (e.g. suica or pasmo) or in cash. You can check the timetable on google maps by specifying 神奈川県陣馬自然公園センター (Kanagawaken Jinba Shizen Kouen sentaa) as your destination. My bus departed at 9:50 and the next one was leaving at 13:10. Make sure that you check the departure times in advance.

Walk on the same direction as the bus. After 3-4 minutes you will find the entrance to Mt. Jinba on your right. Then, walk up until the top of Mt. Jinba (855m) which will take you about an hour and a half. At the top of the mountain there is this phallic sculpture of a horse. Notice that the name of the mountain is composed of two Kanjis: 陣 (Camp) and 馬 (horse). If you are lucky, Mt. Fuji will be visible from the top. But don't count on it during Summer or Autumn. From the top, I could also listen to quite a few amateur radio stations.

Walk down the mountain using a different trail (栃谷尾根, Tochiya One). There are several trails and it's a bit confusing. Make sure you follow the one indicated by the sign in the picture above.

Whereas the walk-up is mostly inside the forest where you can't see much, the walk-down has much better views. After approximately 50 minutes of walking, you will see a sign with the letters 陣馬の湯 (Jinba-no-yu) or 陣渓園 (jinkeien) written on it. You can have a hot bath and some tea there for 1000 yen (Sept/2015).

After a refreshing stop, continue walking down. For some reason, I found many dead snakes on the road. Fortunately, I also saw many insects alive. After 30 minutes, get on bus no. 8 back to Fujino station (陣馬登山口バス停) or just walk your way to Fujino station. It's not that far.

Conclusions: this is a nice super-easy hike perfect for a 1-day trip from Tokyo and surroundings. With only 580m of ascend and 740m of descend, you can complete this course in less than 3 hours. Most importantly, it's not crowded like Mt. Takao.

Sunday, September 13, 2015

First experiences with Software Defined Radio (SDR)

Software defined radio (SDR) consists of implementing most of the components in a radio transmitter or receiver (filters, modulators, mixers and the like) using software. The only parts that remain analogue (the RF front end) are a high frequency low-noise amplifier connected to the antenna, switchable band-pass filters, and a variable-frequency oscillator that moves the received signal down in frequency for it to be sampled with a high-speed analogue-to-digital (A/D) converter. I would say that the advance of A/D converters, with increasing conversion speeds, is the key enabler for this technology.

For beginners, I suggest to buy a DVB-T dongle based on the Realtek RTL2832U chip. These dongles, originally made for watching TV on your computer, are very cheap (I got mine for 1000 yen) and well-supported by the rtl-sdr project. If you have the money you can try other boards specifically made for SDR such as osmoSDR, FUNcube, USRP, bladeRF, HackRF or VNWA3 (as my friend Paco suggests) for example. As I explain in my SDR notes, you can test your DVB-T dongle on Linux using the following command (82.5MHz is the NHK radio frequency in Tokyo):

$ rtl_fm -f 82.5e6 -M wbfm -s 200000 -r 48000 - | aplay -r 48k -f S16_LE

Other radio frequencies I could listen from my home were:
  • NHK: 82.5MHz (Tokyo)
  • Tokyo FM: 80.0MHz (Tokyo)
  • FM yokohama: 84.7MHz (Yokohama)
  • Inter FM: 76.1MHz/89.7MHz (Tokyo) / 76.5MHz (Yokohama)
  • 放送大学: 77.1MHz (Tokyo)
  • J-WAVE: 81.3MHz (Tokyo)
  • Bay FM: 78.0 (Chiba)
  • Nack 5: 79.5 (Saitama)
  • Radio city: 84.0 MHz (Tokyo)
  • FM844: 84.4MHz (Tokyo)

Apart from being able to listen to a wide range of frequency bands, the fun part of SDR is that since the signal is all handled by software you can do whatever you want with it. For example, one of the most expensive equipment for an amateur radio fan is a spectrum analyzer. Thanks to SDR and an awesome software called 'gqrx' (powered by the amazing GNUradio project) you can turn your cheap DVB-T dongle into a spectrum analyzer.

Watching the spectrum was useful for understanding why my FM microphone wasn't behaving as expected. In fact, I found out that the center frequency of my FM transmitter was moving around quite a bit and that was the reason it was rather hard to tune.

An not only that, you can also easily create your own receiver designs by using a software called 'gnuradio-companion' that already has a lot of blocks ready for you to use. I shared my gnuradio-companion designs on my github account.

Conclusions: SDR is really fun and will give you insights on how signals are sent, received and processed. I wish I had had the chance to use SDR when I studied electrical engineering (telecommunications) at University. Make sure you check my notes and gnuradio-companion designs on github.

Ham Fair 2015 (Tokyo)

Last August I attended Tokyo's ham fair 2015.

Actually it was my second time attending this event, and I was very excited because this time I had my own amateur operator license (see my previous post here). The picture shows my call sign (JI1OJQ) painted with ketchup onto an omurice at a maid bar in Akihabara.

This year was also special because a friend of mine had his own booth. My friend sells retro stuff (vacuum valves and the like) at Ikenoya radio in Akihabara's electronic town. Apart from that, I found an interesting radio amateur group of people called yama-to-musen (mountains and radio). Climbing two separate mountains and trying to communicate from the top sounds like fun.

FM microphone kit from Aitendo

In one of my random visits to Aitendo I got the AKIT-334 FM microphone kit on sale (200 yen).

Unfortunately, once I compared the kit's circuit diagram with the components I actually got, I finally understood why the kit was selling so cheaply. In particular, I got a 20pF capacitor that should have been a 10pF; and 2 resistors with the wrong values that I replaced from my own stock. Also, thanks to this site I figured out that I had to cut the track that was shorting 2 of the C3 trimmer capacitor's leads. As if that wasn't enough, I also had to modify the LC resonant tank so that the transmitter would align to the FM frequency range in Japan (76~90 MHz). In particular, I made a solder bridge between the pads where capacitor C2 was supposed to be, and then put C2 (in my case 20pF) in parallel with the C3 trimmer.

The board comes without a coil so I had to make one myself. For me that was the fun part of building this kit. First, I calculated the theoretical value for the coil on this LC resonance calculator. You can also do it by yourself on any calculator application (I use qalculate) using the following formula:

Resonant frequency (Hz) = 1/(2*pi*sqrt(L*C)).

I tried to cover a bit more range so for 76.2MHz (C==40) ~ 108MHz (C==20), I got that my coil's inductance (L) should be 109nH. Next, you need to figure out the physical properties of your 109nH coil. For that use the following formula:

L = perm * (N^2 * Pi * R^2) / length

The permeability of air (perm) is 1 so that is a fixed value unless you use a core. By trial and error I ended up with these values:

109nF = 1 * (7^2 * pi * 2.4e−3^2) / 8e−3

That means a coil made of 7 turns, 2.4mm radius (including the wire), and 8mm length. For the magnet wire, I bought 0.6mm diameter (⌀) polyurethane copper round wire from Akihabara's Ikenoya radio, located in the famous electronics mall radio center (Tokyo hacker space has a nice list of electronic shops in Akihabara here). When I made the coil however, theory and practice differed and I had to tune my coil a little bit using an LC200A LC meter that I ordered from Aliexpress at a very reasonable price (~4000 yen).

This is how the FM microphone kit looks like when assembled. Notice how I applied a bit of hot glue to components that seemed to have more mechanical stress (the power switch, the battery case and the antenna), and I used a short cable for the antenna.

Finally, I used this FM radio receiver that I assembled from a kit sold at Sengoku (Akihabara). Don't worry about interfering with commercial radio stations since this kit can radiate just enough power to listen to yourself from a few centimetres, or perhaps a bit more depending on your antenna and receiver quality.

Reflow soldering and Achandeino

A week ago I got a super cheap arduino kit from Akihabara's Aitendo: Achandeiino. The name is a Japanese joke meaning "I'm just fine with A-chan". The kit's circuit diagram is here. It comes with a few SMD components. And so, I thought it was about time to learn how to do reflow soldering.

After cleaning the pads where the SMD components were supposed to be mounted on, I applied a bit of flux to them. Then, I put a bit of leaded solder paste (XG-50) on each pad (I think I could have used a bit less solder paste) using a toothpick (you could also use a solder paste syringe with a tip in the range of 0.26~0.43 millimetres). During this step it's important that you follow safety procedures because lead can cause cancer. Keep your room ventilated (I used a fan near a big open window) and don't touch it with your fingers because you could end up eating it (be careful when you use the toothpick or use nitrile gloves). You can also buy lead-free paste but it requires higher temperatures to melt, and that could well be as hazardous. When you are done, place your SMD components onto the solder paste using tweezers. After using the solder paste, you should ideally conserve it at a low temperature, within 2~10 °C, or otherwise it will dry out in a few weeks. However, you need to get a small refrigerator for that (never use the one you use to store food because the solder paste can slowly release toxic fumes even at a low temperature).

The next step consists of reflowing the solder paste by heating it up according to what it's called a thermal profile. You can use many different tools for heating the solder paste: hot air, a modified toaster oven, or a hot plate for example. In my case, I used a Yamazen HG-1200 hot plate for several reasons: first it's cheap (~3000 yen in my case), second it has a glass lid very convenient for checking the state of the process, and what's more important it can heat over 230 Celsius degrees (essential for reflow soldering). Besides that, this Japanese fellow explains a few tricks on his website that he had to learn the hard way in order to use the Yamazen hot plate successfully for reflowing solder paste. The thermal profile I ended up using was:
  • Pre-heat at 160 °C for 10 minutes.
  • Place the PCB onto the hot plate.
  • Wait for a minute.
  • Change the temperature to 170 °C.
  • Check the temperature: when it reaches 170 °C, switch the hot plate off.
  • Wait 2 minutes (the hot plate's temperature keeps raising up to 180 °C for some reason).
  • Change the temperature to 210 °C.
  • Check the temperature: when it gets to 210 °C turn it off again.
  • Check the temperature: when it gets to 220 °C, wait for 40s (the hot plate will peak at about 230 °C).
  • Finally, open the glass lid and let it cool down. Once its cooled down you can clean it with isopropyl alcohol and cotton sticks (q-tips)
During the process, I kept an eye on the temperature of the hot plate through a cheap (2000~3000 yen in my case) but very well-made infrared thermometer from SainSonic. Also, since the leaded solder paste releases toxic fumes when heated, I did the whole thing on my balcony and only came close to the hot plate a few times, while holding my breath, to check the temperature.

After reflowing, I used a multi-meter to check for possible shorts. Fortunately, there weren't so I just continued soldering the rest of components by hand with my soldering iron (a hakko FX600). If you get shorts or "bridges" try fixing them with your soldering iron.

And this is the result. Next, you need to buy the ATMEGA328P-PU microcontroller either with or without bootloader, and a USB-Serial converter like this for loading your Arduino sketches.

Conclusions: reflow soldering is fun and easy once you have the appropriate tools. It is great for soldering little SMD components which are cheap and allow you to create high density boards.

Thursday, September 3, 2015

Disassembling a hair clipper

After several years of use, my electric hair clipper (a.k.a. trimmer) finally broke. For that reason, I decided to buy a new one. When I saw that the prices were actually quite cheap, I got interested about how manufacturers are cutting down on costs.

The body of my hair clipper consisted of just 2 pieces of plastic and a mechanical switch connected directly to the internal board. A detachable part (not shown in the picture) with two blades oscillates from side to side driven by the internal DC motor and a fancy spring. The electronics are as simple as it gets with just a classic AC->DC rectifier whose output is connected directly to a Mabuchi FK-290PY-051100 DC motor (100VDC, 6800RPM without load).

The motor has a cam attached that allows transforming rotary motion into linear motion for moving one of the two blades.

The board's circuit diagram is a classic that any electronics hobbyist should know. The input wave (mains electricity) is a SINE with 100V amplitude and a frequency of 50Hz (Tokyo). The 1MΩ resistor is used to increase the input impedance (ideally infinite). Then, a 100nF/125VAC ceramic capacitor is used to filter out noise from the mains signal. The result is rectified through a diode bridge (i.e.: a full-wave rectifier), and then smooth out with an electrolytic capacitor in parallel (a low pass filter). The output voltage is 98,88VDC instead of 100VDC because of the forward voltage (Vf≈0.56) of 2 diodes. In sum, here is the bill-of-materials (BOM):
  • Resistors: 1x1MΩ, 1x150Ω
  • Capacitors: 1x100nF (125VDC), 1x4.7μF (160VDC, electrolytic)
  • Diodes: 4x1N4004-TP (Vf=~0.56)
  • Motor: Mabuchi FK-290PY-051100 (~4 dollars)
  • Camshaft
  • Blades
  • Spring
  • Plastic body
  • Power cord
  • Others: size attachments, oil, brush..
  • PCB
Conclusions: making profit from selling an electric hair clipper at about 2000~4000 yen looks quite challenging to me, unless you sell enough of them so that you can average out the cost of the initial mold for the plastic body and attachments. There are lots of brands competing in the market with completely different plastic bodies. I wonder if all of them are selling enough to compensate those initial costs.