INap Malinka, Your NRF24L01 Transmitter That Can Play Pokemon

by leonek in Circuits > Raspberry Pi

7462 Views, 76 Favorites, 0 Comments

INap Malinka, Your NRF24L01 Transmitter That Can Play Pokemon

inapmalinka.jpg
malinkaservo.png
obraz_2022-08-25_133357311.png
obraz_2022-08-25_133428792.png
obraz_2022-08-25_133524597.png

iNap Malinka was mostly made as a decent, Raspberry Pi based NRF24L01 transmitter. But as it turns out you can play some games on it as well! It's a small DIY handheld that runs RetroPie so any retro game, including ports, can be played on Malinka. But as it's mostly a device for tinkering on-the-go, there's an additional USB for any kind of peripheral, an HDMI port, and a decent audio section too. Not only that, it's just as big as your phone, with only 12mm thickness. Two joysticks, 3.5" capacitive touch screen, powered by Raspberry Pi Zero 2W.

But, if you're interested just about gaming, you can totally ignore the radio section and use it as a small, DIY handheld! Formally it's a mobile HMI, as besides the NRF24L01 you can use WiFi and Bluetooth to control your devices!!

In this instructable I will show how to assemble the handheld. Remember to visit github wiki for more!

This tutorial assumes you're not totally new into electronics, and you have some experience with Raspberry Pi, soldering, and printing in general.

Supplies

183702449-c6f3fb2d-e3fe-41d1-b9b4-91c1cb5fd377.png

To assemble the handheld, you will need both tools and soldering skills. It would be really cool if you had a hotair station - but in this tutorial I will show you how to assemble the Malinka just with a soldering iron. Tool checklist:

  • cutting pliers
  • tweezers
  • solder (preferably thin and containing lead (Sn60Pb40), I use 0.4mm)
  • desoldering wire
  • kapton tape
  • double sided tape
  • flux or soldering paste
  • IPA alcohol/isopropanol
  • a multimeter (even a cheap one will do)
  • a screwdriver
  • ESD cloth along with an ESD brush
  • third hand and/or PCB holder
  • and of course, a soldering iron.

Optional, but really recommended:

  • straight pliers
  • desoldering pump
  • compressed air
  • a magnifier
  • haribo bears

BOM

183704973-146618c2-46a1-47fd-b507-26c418b1bcdf.png
Schematic_iNap Malinka_2022-08-17.png

The Bill-Of-Materials is included in the repository. You will also need two M2.5 screws with nuts and washers for the assembly process. Don't forget about the SD card too! Check the instructable files for the PCB files, schematics and BOM. Remember that the latest files you will always get from the github repository.

System Installation

obraz_2022-08-24_170953590.png

The recommended way to install the OS onto the Malinka is to install a provided OS image available here. It's as simple as burning the image onto an SD card using your favorite software, and that's all. However, if for any reason you wish to install everything on your pure RetroPie install, this guide will show you what to do.

After you burned your system image, we need to enable SSH connection and tell Raspberry to which wifi connect. After burning your SD card, you should see a "boot" partition - copy the files "ssh" (note the lack of extension) and "wpa_supplicant.conf". Open the latter file and remember to update your country, SSID and password!

Log in to the Pi via SSH, with default "pi" login and "raspberry" password. You need to know the IP address of your Pi, which you can either check on your router page, or using an IP Scanner. On Windows, you can connect with ssh pi@your-pi-address and then typing in the password. You should see a screen like this:

Which means everything is set correctly! The last thing to do is to run:

sudo apt-get update
sudo apt-get upgrade

to fetch latest software, as the source image could be quite old.

Printing the Case

186395935-77ec2ccb-8ea2-405d-a5bc-394d617aa4cf.png
186395982-9c283ce4-fd4f-4ee0-bcd9-2ce217ab9ad8.png
186396494-697f5401-067b-4dd5-8dce-171406825f15.png
186394576-16712635-3302-4662-b161-7db80d8709b2.png
186394734-61035eac-86b7-4f1f-9808-ddf3e941720c.png

Before printing anything, ensure that your printer is calibrated, bed leveled, and your filament is in good condition. You will see the case everytime you use your handheld, so it should be something nice to look at!

A good material for printing the case would be ABS or PET-G. Pick colour of your choice, and if you can, grab samples of other colours for buttons. There are two versions of the shell, one with SMA (antenna) connector, and second without it - print the latter if you don't want to use radio. There's no need to use supports for the shell and the cover, but use 'supports on the build plate only' for the triggers.

You also need to print the power switch, system button, and 8 gamepad buttons. You can either print them flat, but I don't recommend that unless you'd sand buttons or the case. If you don't plan sanding anything you may want to print and glue only halves of the buttons - this way the buttons can move smoothly.

Postprocessing

186401275-38726853-4aa9-4e88-934e-cfcb2cf5091d.png

Heat up your soldering iron up to 200°C. Put an insert on place:

Gently push it down:

Don't push all the way! It should be left just almost pushed in:

Gently press a piece of metal on it, but don't press too hard. This could result in deforming the print, which we don't want. You can see I pushed a little too hard here:

Repeat the process for the other 5 inserts!

Buttons

186402074-50242827-ae64-483d-ae74-ace2abc214e4.png

If you printed the buttons as halves, you simply need to glue them together. Put a little bit of glue on one part:

And connect the pieces together. Repeat for all buttons left!

Soldering the FFC Connectors

183708737-d713f1f8-480a-4619-8ff1-ae8125ab58b4.png

We finally come to soldering! We will begin with the hardest part - just so if you screw up, you won't waste as much time. Preheat your soldering station to your favorite temperature. Mount your PCB so it's rigid and so you can solder it in a comfortable way. Apply a generous amount of solder flux on the pins.

Stick the connector in place, and align it so the pins are meeting the pads almost perfectly. Take your time. If you are sure you did it well, solder one mounting pad on the side of the connector:

Solder the other side too, and check if nothing moved again. If you think everything's fine, then apply solder on all the pins. Basically, you want to make a huge solder bridge like here:

Don't panic if it looks ugly, everything's under control! Take the desoldering wire, and slide it across all the pins. Remember to cut down tinned fragments, and apply more flux if needed.

Once finished, it should look quite neat already. Make sure if there aren't any bridges left, and if so, remove them.

After this step, the connector is basically soldered. Now we need to clean the remaining flux - apply a lot of IPA alcohol, and use a brush and some cloth to remove the remaining flux. It should be removed from the connector and pins, and of course be sure to brush the inside of the connector too. A good approach is to put some alcohol inside, wait a second, and then spray some compressed air inside. No flux can remain inside the connector! Remember to flip the lever during cleaning too.

Once finished, the connector should look pretty good, and no flux should be visible.

If you made it this far, congratulations! Take a break, and eat a haribo bear. There are only 3 smaller connectors left!! Repeat the process for them too, but if you feel confident, try soldering them just by applying only the necessary amount of solder. Use a magnifier or your phone if you need to see connections more clearly, as I do:

Raspberry Pi

183710273-c8f56247-7bc9-4fd5-a4cd-28fe45b20867.png
183709747-08b61a7e-930d-4063-9cac-60bd311f5d45.png

Once we are done with the FFC connectors, the hardest part is over. Time for the semi-hard part - the Raspberry Pi. (please don't mind that my Pi is cut in the corner, you don't need to do it)

Mount the Pi in it's place using two screws, washers are necessary to not damage the PCB!

The Pi is surface-mount, which means that soldering it will be quite different. You need to put the tip of soldering iron into the "cup", put some solder on it, and remove the iron. Remember to apply the flux if needed. Repeat the process for the other 39 cups. Remember to clean it of remaining flux using IPA, cloth, and brush after soldering. This is also a good moment to desolder the power USB, as we don't need it. Do it very carefully. Once you think you're done, you must check if you have soldered all the pads correctly. Use some common pins and exposed pads for that, and check along with this list (first 3.3v pin is the square one):

3.3v,       VBAT
I2C_SDA,    VBAT
I2C_SCL,    GND
RADIO_CE,   BTN_SELECT
GND,        BTN_UP
MCP_CS,     RADIO_CSN
BTN_LT,     GND
BTN_LEFT,   BTN_RIGHT
3.3v,       TFT_DC
TFT_MOSI,   GND
BTN_Y,      TFT_RESET
TFT_SCK,    TFT_CS
GND,        BTN_DOWN
BTN_RT,     BTN_A
BTN_B,      GND
BTN_X,      SOUND_L
SOUND_R,    GND
RADIO_MISO, BTN_START
TFT_LED,    RADIO_MOSI
GND,        RADIO_SCK

ICs

183713616-6d0e90d4-e514-49df-9d2b-acfb0439c0a1.png

Once you're done with the Pi, and all connections are checked and fixed, it's time for another haribo bear(s). Now only small SMD components are left - let's begin with smallest U3 - tin one corner pad:

Mount and align the IC properly. Spot that the dots are indicating the first pin - the dot on the IC must match the dot on the PCB!

Solder the other corner, and all the remaining pins. As you can see, my IC twisted a little but it's fine as long as connections are correct:

Remember to take your time, and apply a lot of flux. Repeat the process for the U7, Q1, U1 and U2:

Now we will attach the radio module. If you don't want to use radio at all, you can omit soldering it, as well as the SMA connector. Once again, tin and align using one pad:

Apply even more flux, and when pressing the module into the main board, solder the mounting pad. It will keep the module flat and attached well.

Solder the rest of the pins.

Connectors

183717755-b9731446-968f-4e1c-9627-d8dc6234984c.png

Now it's time to solder the connectors. The process is quite repetitive, as again, we need to attach the connector using one pad.

Solder other pads (but for this USB-C connector, they must remain flat as LCD goes in top of them!

And all you need to do is tin other pins as well.

Make a similar thing with the SMA connector. It's meant to be mounted on the edge of thicker boards, so make sure it's flat on the radio side, and "floating" on the screen side:

Passive Components

183721666-6cfd5f9f-bd0e-4c31-869a-077332669591.png
183721577-3c4e15c9-e584-4640-82dc-eafe48041f2f.png

We will move our focus to an LED now. On it's underside, there's a green line indicating the cathode. That line must be facing the "LED1" label:

Solder the resistors too. Follow the schematic to check all components' places!

Continue soldering the passive components, and don't forget about the D1 in the top left corner. A note here though, DO NOT solder L1-L4, or C3-C6, but instead short them as shown:

Keep those elements in case your audio ends up being poor quality.

Don't forget about D1 on the other side!

The audio capacitors are surface-mount too, despite being THT. Just cut their leads as shown:

Bend them down:

And attach in place. The blue/gray strip on them indicates the cathode (minus side). The other one goes on the plus! Make EXTRA sure that you haven't swapped their leads, or else they won't work properly.

One of the last things to do is to connect the radio module with the SMA connector. There's a small IPX connector on it, so I grabbed myself a small kit with a coaxial wire and an SMA antenna. Cut it down to about 40mm in length, or whatever is suitable for your setup:

Very carefully strip the coaxial wire so the core and shield are exposed well. Make some kind of a "cross" shape as shown:

Tin it (and make sure to not make bridges!)

Solder it symmetrically, and once again make extra sure that the core isn't shorted to the shield. Use a multimeter to check it!

This is another checkpoint. Eat some more haribos. We can boot up the Pi already! Make sure that your board looks just like this one:


Testing

obraz_2022-08-25_153749299.png

If you feel confident about your beautiful work, insert the SD card you prepared earlier. If everything goes fine, the green LED should start blinking. If not, well... welcome to the club of having a fried pi.

Just kidding, check if you connected the battery properly, if your SD card is all good, and try to maybe flip the switch. Once you finally got your Pi working, log in via the SSH and type in sudo shutdown now. After a minute or two, flip the switch off and remove the battery. Time for the final step!

Assembling the LCD

obraz_2022-08-24_181847815.png

Everything you see is exposed and goes under the screen, you must hide with a piece of kapton tape : audio jack, all test pads, as well as part of the USB C connector. Stick some double-sided tape too:

Do a similar thing for the battery.

Now, open the connector levers and very carefully slide the large ribbon through the hole. Use tweezers to push it inside the connector, and once it's properly aligned, close the lever. Do a similar thing with the smaller ribbon too. The backside of the PCB should look like this:

But don't stick the screen yet, we will do that soon! One of the last things to do is to prepare the speakers. Cut the wire on one speaker so it matches the shorter one in the picture below, and use those wires to expand the second speaker. Once you're done, twist the wires so they look just like they do in the reference below. The shorter speaker goes to SPK_L and longer one to SPK_R.

Aaaaaaand we're done! Insert the battery and turn the Malinka on. If you can see that the screen shows EmulationStation after few seconds, there's nothing left but to attach it with the double-sided tape. If you don't see any picture, head to the troubleshooting page.

Mounting the Case

186493796-b419f9f1-4031-4ea3-bce7-a10d16b3d8f3.png

Shutdown the Pi again, and detach the battery. Push the controller buttons and check if they're sliding smoothly - they must slide smoothly.

Put the rubber pads on them. You can see that they're not symmetrical, one side is 1mm longer - make it parallel to the longer edge of the PCB (horizontal).

Don't forget about side buttons too! Make sure to slide the switch to the right.

Now, very carefully, push the PCB inside. The SMA connector should go all the way through the hole. The rubber pads must remain in place!

Press the PCB down. The USB connector on the Pi should 'jump' into the place, and power switch should be matched too.

Inspect the alignment of the rubber pads. Fix them if they're not in place - you can easily detect that by pressing button and "feeling something wrong"

Put the joysticks on place, and screw them as well. Do not use too much force!!! The plastic mounts on them are really thin and too much torque can break them. Stop once you feel more resistance.

Pull up the lever, and even more carefully slide the ribbon inside using tweezers. The joysticks have carbon paths so they will wear out after 3 or 4 insertions. Once in place, you probably don't want to disconnect them.

Time for the triggers. A trigger in place should look like that:

The backside should look as shown. If the cables are getting over mounting holes, secure them using kapton tape.

Finally, gently push the cover, making sure that triggers are still in place. The 6 screws shouldn't stick out at all.

User Guide

obraz_2022-08-24_232516950.png

The instructions are pretty straightforward:

  • the system button is configured as "BTN_C"
  • it can be used as a hotkey!
  • the default configuration is with "select" button as the hotkey
  • to change the volume, press System+L or R
  • to hibernate the device, press System+A
  • to mute/unmute the sound, press System+B
  • to hide/show overlay, press System+Y
  • plugging in headphones automatically turns off the speakers
  • USB-C is only for charging. It's still preferred to not use a high voltage charger.
  • RED means charging, GREEN means that the battery is charged.
  • User USB is meant only for USB peripherals. Trying to charge the battery from micro-usb will damage it permanently, and the device may even blow up!
  • external antenna connector is needed only if you want to use the NRF24L01 module. Any SMA antenna should fit.
  • you can connect a monitor/tv through Micro HDMI. Remember to change resolution!

Switching the power off while the device is running may corrupt some data! Remember to execute a system shutdown first. Malinka will force a shutdown once the battery is almost fully drained.

What's Next?

malinkaservo.png

The main destiny of Malinka is to be a radio transmitter. You can write your application in any language you want: C, C++, Python, or even Java. You can also use any GUI library. But to keep things simple, my recommendations are:

  • RF24 library, because it works on both RPi and microcontrollers flawlessly
  • LVGL, one of most popular GUI library for embedded devices
  • Nuklear instead of LVGL, if you want a really lightweight library

Note that both RF24 and LVGL can be programmed in C and Python! You can create any kind of application, the only thing that limits you is your imagination.

Oh, and remember to put some games in it!

Share!!

malinaeevee.jpg

Remember to visit github for even more! If you liked this project, share the word, post how your console does look like! iNap Malinka is licensed under CC BY-NC-SA 4.0, so you're free to adapt and remix my project as much as you want (well, as long as you don't use it commercially)

Good luck and have fun with your new handheld!