Skip to content

13. Networking and Communications

This week I learned about Networking and Communications.

13.0 Assignment of this week

13.0.1 Individual assignment

Design, build, and connect wired or wireless node(s) with network or bus addresses

13.0.2 Group assignment

Send a message between two projects

13.1 The personal object of the assignment this week

As I am planning in my final project to use wireless remote control function, so I focused wireless devices.
These devices have been widely used for the purpose and several professional/hobby grade products are available. I would like to make my own.

13.2 Design

I had some wireless boards in my stock and chose Raytac MDBT42V for my assignment.
MDBT42V is a BLE(Bluetooth low energy) module designed based on Nordic nRF52832 SoC solution, which incorporates UART interface in only peripheral/slave role for data bridge in compact size (L) 8.4 x (W) 6.4 x (H) 1.75 or 1.50 mm.
Usually, developpers should get their own certifications to use RF chips like nRF52832 in their products. MDBT42V is supplied with these certifications, so we can skip these certification process.
Nordic nRF52 series are also known as MCU of micro:bit, so we can expect to develop applications with which micro:bit and MDBT42V networking together.

MDBT42V boards(PCB Antenna and chip Antenna version):

MDBT42V board dimension and pin assignment:

I designed my own breakout board for MDBT42V:

STL file:
MDBT42Vboard.stl
G-code file:
MDBT42Vboard.cnc

I used ‘Snapmaker 2.0’ to engrave the board.

13.3 Soldering

I used a heat gun and a solder paste for soldering. But my attempts were failed. MDBT42V has flat pads with only 0.75 mm pitch, which was beyond my hand soldering skill.
I removed the chip from the board and connected the chip and the board with fine copper wires. Finnally the board was ready for programming!

13.4 Programming the boards

I wrote a couple of short javascript codes and compiled them to HEX files using MakeCode editor.
MakeCode editor is designed to work with micro:bit, so I should modify the generated HEX code to work with native nRF52 chips.

It actually works. But maybe these modifications are out of manufacturer support scope, so any tests should be done by each tester’s own responsibility.

Transmitter JavaScript code:

radio.setGroup(144)
let Pitch = 0
basic.forever(function () {
    Pitch = input.rotation(Rotation.Pitch)
    if (Pitch > 0) {
        basic.showString(“U”)
    } else if (Pitch <= 0) {
        basic.showString(“D”)
    }
    radio.sendValue(“PITCH”, Pitch)
})

Transmitter HEX file(not modified and ran on micro:bit):
TransmitterTest.hex

Receiver JavaScript code:

radio.setGroup(144)
radio.onReceivedValue(function (name, value) {
    servos.P0.setAngle(value)
})

Receiver HEX file(modified and ran on MDBT42V board):
ReceiverTest.hex

Programming micro:bit:

Programming MDBT42V with RedBearLab BLE Nano:

13.5 Test, failure and recovery

Initial test result was negative. The MDBT42V board didn’t work as I expected. I checked the board and found that I/O pins were dead(maybe caused by heat damage).
I had a few more stocks of MDBT42V, so I made a new test board with all hand wiring:

The board worked very well!

Wireless networking test of the MDBT42V board and micro:bit:

13.6 Other projects-1 (another MDBT42V test board)

I had asked SWITCH SCIENCE people to make a MDBT42V breakout board and they had kindly made a few samples for me.

MDBT42V breakout board by SWITCH SCIENCE

Programming the MDBT42V breakout board:

The board also worked very well! It became our group assignments of this week.

Wireless networking test of the MDBT42V board and micro:bit:

13.7 Other projects-2 (serial bus) (as group assignment)

Link to Lab Page

As my own project wasn’t completed, I made ATtiny412 serial bus demo boards by Adrian Torres as a supplementary lesson.


I programmed Arduino UNO with jtag2updi by Spence Konde and Arduino UNO became the writer for ATtiny412.


It was quite straight forward and the boards worked well!

13.8 Other projects-3 (SD-card)

I had developed my own SD card shield for Arduino UNO as a part of Week 11 assignment.
The board connects Sunhayato CK-35 SD-card adapter with Arduino UNO.


The board design:

Step file:
SDshield.step
STL file:
SDshield.stl

The board connects with Arduino UNO using SPI interface. Pin assigns are belows:

SD card shield Arduino pin
CS 9
MOSI 11
MISO 12
CLK 13
3V3 3V3
GND GND

How the SD card shield works:

13.9 Conclusion

I have tried several networking devices like as BLE, serial bus and SD-card. I learned how to program these devices using various programming languages like as javascript and C(Arduino sketch).
I used javascript for BLE and C for serial bus and SD-card this week, I would try C(Arduino sketch) for BLE next time.


Last update: June 28, 2022