Our Covid baby journey

I think everyone can agree life has been challenging in many ways since the Coronavirus pandemic began. The disruption caused by multiple lockdowns and the inability to go about our normal lives. Not being able to visit family or spend time with friends. It has been a very unique and tough time for all in many ways so I wanted to describe how it affected our journey through multiple pregnancies and our first born son.

It was the first week of March 2020, just as the pandemic was beginning to intensify across the world. I had been away for a few days on a work trip to Amsterdam and it was becoming noticeable that concerns were rising. People had not started wearing masks but I had been unable to buy any anti bacterial hand sanitizer in all of London, Brussels and Amsterdam, the panic buying had begun!

I returned home and over the next few days myself and partner received the joyous news that she had become pregnant, we were over the moon to say the least. Due to the rising news stories and talk of what could be to come, the happiness was mixed with a degree of anxiety as to how we may fair in this situation. At this point both of us were still commuting into London on multiple forms of public transport so we felt susceptible to the risk of infection. There had been very little studies on the virus or the long term effects so the possible risk to a pregnant woman and baby were concerning. Thankfully my office closed that week and hers shortly after, just in time for the first national lockdown.

Due to the pregnancy we took the first lockdown very seriously, stuck to food deliveries where possible and barely ventured out of the flat. The only time we did was for hospital medical check ups related to the progress of the pregnancy. Hospital visits were surreal during lockdown, we used Pembury and from my experience the place was a ghost town. All visitors or patients were turned away as much as possible unless critical due to the risk of Coronavirus unknowns. This made it feel eerily quiet from the outside, even more so when you are expecting quite the opposite. Only my partner was allowed to enter the building and I had to wait in the car, in an empty car park, one that would usually be filled to the brim. It’s again a surreal experience to be expecting a child yet not be allowed to attend any appointments, it makes the whole situation feel less real as you only see the outcome of those appointments via messages or photos of scan monitors etc. It’s a very nail biting wait on hearing the progress and updates from your partner when you’re not by their side physically. These appointments and ventures to A&E for sporadic advised check ups often take a while too, on one occasion I sat in a dark car park, rain pouring down beside our puppy for 5 whole hours whilst a shift change occurred. Unfortunately if you visit mid shift change it’s pot luck as to if you might be seen within an hour or 5 but that’s just how it is as they’re understandably busy.

Heartbreakingly it was during one of these check ups that I learnt while in the car via Whatsapp that our pregnancy had failed to progress past the first trimester. Both of us were devastated and we had to update our families without the ability to be with them for any sort of comfort or reassurance. I went straight back to work, on reflection I should have taken longer to process the events. The next few weeks in the midst of the lockdown were tough for both of us.

Even though we had a very sad outcome from our first attempt we were advised that a lot of couples go through miscarriages during the first pregnancy, it’s a lot more common than you would think. Many people choose to keep their experiences private which is totally fine but I’d like to be open so others who go through similar experiences can relate and know that it’s hopefully not the end of the journey. A useful piece of advice we received was that if you try again shortly after, the odds of a successful second pregnancy are much higher.

It was at this time we decided we definitely wanted to try again and whilst recovering bought a little puppy and listed our flat for sale. Talk about doing all of the big life changes at once… oh and we got engaged in February, so 2020 was turning into somewhat of a busy year even with the pandemic!

A few months later and we again had the exceptionally happy news that we were expecting. At this point in time the lockdown rules had been slightly eased so we could distanced visit family and share some of the emotions. All appointments were still limited to no partners so I still had to await updates from the car park. We did however pay for private scans and that allowed me to join and see first hand our teeny baby on the ultrasound screen, that was special and brought me a lot closer into the journey.

Again due to Coronavirus and the unknowns we were still taking it very cautiously, only ever distanced visiting people, delivered shopping, masks and lots of antibacterial hand washes, etc. At this time this was the norm and everyone was doing the same. Some family members were still at increased risk so it was quite rare they managed to share the in person experience of being able to feel the baby or in the future when he would start to kick and wiggle around more but for the safety of him that was a sacrifice we all agreed as a family was correct.

To stay sane we met up with a few friends at this point, again distanced and in a safe manner to not put ourselves or anyone else at any risk. One particular day we visited a friend at a park, this was during the later stages of the first trimester so we were very much worried about the risk of making it past the first trimester due to our previous experience. Just as we sat down to have takeaway pizza from a local restaurant in boxes, my partner experienced heavy bleeding, immediately this was a huge concern so we left little puppy with our friend (thank you again for taking such great care of him even if he did whizz on your rug…!!) and headed to the nearest A&E department. They saw my partner quickly due to the situation and had her wait in a room for a doctor. At this point the nurse told my partner I was allowed to join her but the security guard on the door of the hospital wasn’t so keen so there was a short back and forth via Whatsapp before the nurse came and permitted my access. Some time passed as we awaited in despair. Heartbreakingly again the doctor informed us that it was likely a miscarriage and to prepare for the worst. As it was a Sunday there was noone around that was able to perform an ultrasound so instead they rang our local hospital and booked us in a few days later for an ultrasound. There is no suspense worse than having to wait days for an ultrasound to check the status of your unborn child. We spent a few days together accepting the worst had happened.

By some miracle at the ultrasound a few days later we were both absolutely relieved and ecstatic to hear that our baby was fine, his heart was beating and everything looked okay! It turned out to be a misdiagnosis and in fact caused by a hematoma, something that happens in around 3% of pregnancies. The result was my partner had to rest for a few months to heal fully and lower the risk to a normal level.

Over the next few months the situation stabilized, going into the new year of 2021 I still couldn’t attend any appointments but as they progressively went more smoothly the anxiety of the updates lowered and we continued into the last trimester.

Before we knew it, we were on our way to the hospital in the middle of the night. As with everything during this pregnancy the birth wasn’t as smooth as desired. My partner had opted for a natural, stress free birth using a birthing pool but after the first 9 hours that option was abandoned and moved toward an epidural to relieve the discomfort onset mainly by tiredness. Another 9 hours passed and it was decided the little one was being very stubborn and an emergency caesarean section was the best option. After some convincing the medical staff managed to coax me into the operating theatre and after a few moments of sitting beside my partner we had our tiny son in our arms and the last year instantly became worth every second.

Due to the stress of the birth our son was taken into neonatal for some extra care and antibiotics. We stayed in postnatal and visited him throughout the day. During Covid birth partners were not allowed to leave the hospital so once you have entered pre birth, you have to stay in the hospital. There are special exceptions to this rule, for example we only packed enough clothes for 2-3 days so after 5 days I had to get special permission to go home without seeing anyone and just to replenish supplies. Thankfully Pembury hospital has a Costa Coffee and WHSmiths which you we were allowed to visit anytime and those treats came in very handy. Another bonus was as birth partners can’t leave the hospital they were fed too, this meant I got breakfast, lunch and dinner everyday and I have to say the food was deliciou. I probably ate better than I would at home!

On day 2 our newborn was discharged and joined us in our postnatal room, which meant we had to start feeding and changing nappies which made it feel instantly more real. It wasn’t until day 7 when his course of antibiotics finished that they allowed us to leave as a family and return home, a euphoric feeling that we had completed the first stage of this journey as parents. Also a relief we no longer had to wake at 5:45am to take him for those antibiotics.

Since his return home rules have been relaxed even further so we have been able to welcome family and friends to distanced visit. Again we have been overly careful with masks for visitors when inside as babies are susceptible to all sorts of illnesses due to their weak immune systems anyway. As parents you’re working 24/7 to keep your baby fed, changed and not crying so any avoidable illnesses are a must to keep up with that routine!

I want to give a special mention to the NHS. The care, dedication and attention we received was first class, especially in the midst of a pandemic. The extra care taken by staff to encourage myself when squirmish and hesitant to join my partner in theatre was a special touch, to be there and hear his first cry and immediately be passed him was a moment I’ll never forget and for those staff that took the time to reassure me was way above what they needed to do. To all the NHS staff we were privileged enough to interact with, you were truly fantastic, thank you.

If you are ever in a similar situation or you came across this blog post and would like to chat about anything then please do get in touch, I would be more than happy to give any advice or support to you. You can comment here or provide a place to get in touch and I’ll send you a message.

The infrastructure behind SmiteStats.com

I built SmiteStats.com as I regularly play Smite game with friends. The initial aim was to create a clan based smite stats site just for fun. However it has evolved into quite the project and stores around 4GB of player data including over 5,400,000 match records.

Smite stats relies on the official Hi-Rez Smite, Paladins and Realm Developer API (more details can be found here). The API provides a source for all player and match data. Consequently if the API became unavailable then the site would cease to provide real time data. In that case it would be more of an archive of smite stats data.

I set the site up using Symfony 5 and a large set of custom entities that model the incoming API data. A mapping class then formats this raw json into an entity prior to persisting to the database with Doctrine.

Minimising API calls

The API has a daily usage limit, Hi-Rez will increase the limits over time if you speak to them and demo a suitable use case. If you limit the amount of calls you make to the API then there’s no reason to do this. For instance this site will cache all API responses with as long a cache TTL as possible. When generating the latest players for a match the site queries the matches endpoint. It then checks if those matches are in the database and stores them if not. Using a matches_updated property on the player entity this is set to the current datetime. The recent matches API query only happens again after fifteen minutes have elapsed. This is particularly helpful to avoid high API usage when a search engine bot crawls the site.

Currently the site is using Redis to cache in memory in the server. It has a suitable memory allocation with a cache eviction policy set to allkeys-lru. This Redis policy means old cache entries are removed to free up space for new entries. For this site this policy works well as the cache items are disposable.

Architecture

The site uses source control via Github and the repository is private with separate branches per feature.

For the server it uses a suitable AWS EC2 instance combined with Elastic Storage to accommodate for data storage needs. I have found EC2 paired with Route 53 for DNS zone management very suitable for small projects.

One limit of the current setup is the lack of automated deployments. A deploy at the moment consists of a PR merge to master. Followed by a cache clear and yarn install. In the future this process will improve with the implementation of Jenkins jobs and/or Ansible playbooks.

Monitoring

To monitor the system I have setup AWS CloudWatch. This integrates well with EC2 and effectively syncs the logs and custom metrics as required.

One of the most useful features is the ability to almost near time remotely monitor the storage, CPU and memory levels. Alarms and events can then be trigger to warn of production critical issues. It also comes in handy when debugging historical events as you have a full system usage graph history.

Database

Currently the MySQL database is local on the EC2 instance. This has issues because it doesn’t scale as well. Ideally the MySQL database would be remote on another instance with it’s own environment configuration. An even better solution would be to use Docker containers but on initial setup I wasn’t too familiar with that approach combined with EC2. Something to improve and blog about in the future.

The database is has version control via the aforementioned Symfony Entities combined with Doctrine migrations. I find this to be a very effective approach to easily storing and managing entities.

In total the database has 16 tables, these are all fully relational with correct data types, indexes and foreign keys. As of writing the largest table, the match_player_item has ~28,590,000 entries. This table alone consists of around 982MB data around what items a player made use of in a match. However size wise the match_player is the largest and ~5,467,000 entries store 2.1GB. Some may argue this is too large for one table but the data maps 1-1 with the match player API response. To separate this data further would only increase the complexity for the mappers to little gain.

Smite stats mysql database

Front-end

The front-end of the site is of a minimal design (design creation has never been my strong point). Bootstrap 4 is in use for the markup and design style. I wrote some custom css to give it more of a Smite feel. Chart.Js is in use for the graphs but they could do with more customisation. The Smite build generator tool makes use of AngularJS as it requires more dynamic data. However as AngularJS has been deprecated React may be a possible to replace that at some point. Lastly webpack encore is in use with yarn to manage and install the dependencies.

Summary

Overall this covers the setup used for the site. There are areas that could do with improvement but I feel the above is a solid setup for a relatively small website.

So go and install Smite via Steam, Xbox One or PS4 and join us in the game! You’ll then have a perfect platform to check your playing stats to see if you’re any good.

I also welcome feedback on the site and suggestions for improvement. The whole purpose was to create a communal Smite stats site that benefits all those who make use of it.

Arduino RC Tamiya – Part 3 – Adding Wifi Control

Last time we replaced the standard receiver with a custom coded Arduino. This allowed us to program the car ourselves and run simple automated scripts to turn around in a circle. In this post we’ll enhance our remote control car so it can be driven over WiFi.

The Arduino board we have been using is WiFi ready, due to its secure ECC608 crypto chip accelerator. This is perfect as we can use the readily available Arduino WiFi library in our code.

Tamiya Arduino WiFi Setup

The first step is to write some basic code to check the Arduino can connect to the Internet. In the following example, we’ll be connecting through a home router but you could hotspot your phone and connect directly. (If you’re using source control remember not to add your WiFi credentials!)

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "yourNetworkName";  // your network SSID (name)
char pass[] = "secretPassword";   // your network password

int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);

  // check for the presence of the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue:
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv != "1.1.0") {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);

    // Connect to WPA/WPA2 network
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  printWifiStatus();
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

The above code will connect to a WiFi SSID of your choice with a given password. Next it checks your Arduino has an available WiFi module and a supported firmware version. After that it tries to establish a connection. The debugging information about the connection will be recorded via the serial port output, so you can monitor the progress.

Tamiya Arduino WiFi Control

Now we have a successful WiFi connection it’s time to allow the Arduino controlled car to receive some commands and start moving.

To allow the car to receive commands we will program the Arduino to operate as a web server. It will host a web page available via the WiFi shield’s IP address that will have just enough HTML to control the digital Arduino pin inputs.

The following demo gives us the ability to steer left or right, it’s important to start simple and when confident add more control. This helps avoid breaking the car, precious household objects and people in close vicinity!

#include <Servo.h>
#include <SPI.h>
#include <WiFiNINA.h>

Servo steering;
WiFiServer server(80);

char ssid[] = "yourNetworkName";  // your network SSID (name)
char pass[] = "secretPassword";   // your network password

// Include a web page template with the UI car control buttons
const char *webpage = 
#include "uipage.h"
;

int leftTurn = 0;
int rightTurn = 180;
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);

  // check for the WiFi module:
  // removed for cleaner demo, view above snippet
  // check the firmware version
  // removed for cleaner demo, view above snippet

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  // start the web server on port 80
  server.begin();
}

void loop() {
  // listen for incoming clients
  WiFiClient client = server.available();   
  if (client) {                             // if you get a client,
    String currentLine = "";                // make a String to hold incoming data from the client

    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out via the serial monitor
        if (c == '\n') {                   
          // if the current line is blank, you get two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            // this is where we load our HTML UI template
            client.print(webpage);
            
            // HTTP response ends with another blank line:
            client.println();
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if anything but a carriage return character,
          currentLine += c;
        }

        // check if client request was "GET /left"
        if (currentLine.endsWith("GET /left")) {
          steering.write(leftTurn);
        }

        // check if client request was "GET /right"
        if (currentLine.endsWith("GET /right")) {
          steering.write(rightTurn);
        }
      }
    }
    client.stop();
    Serial.println("Client disconnected");
  }
}

The following code is the HTML UI template. This is what we load in the above code to allow user input for sending commands to the car. For now we only have a left and right button. Bootstrap and jQuery are included to allow for pretty buttons and Ajax request handling.

R"(
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  </head>
  <body>
    <div class="container-fluid">
      <div class="row">
        <div class="col-xs-6">
          <button id="left" type="button" class="btn btn-default"
            onmousedown='makeAjaxCall("left")'
            ontouchstart='makeAjaxCall("left")' 
          >Left</button>
        </div>
        <div class="col-xs-6">
          <button id="right" type="button" class="btn btn-default" 
            onmousedown='makeAjaxCall("right")'                                                 
            ontouchstart='makeAjaxCall("right")' 
          >Right</button>
        </div>
      </div>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script>
        function makeAjaxCall(url) {
            $.ajax({"url": url});
        }
    </script>
  </body>
</html>
)"

With the above loaded onto your Arduino and running you should be able to navigate to the Arduino cars IP address in your browser and see the UI.

WiFi Remote Control Tamiya UI Web Server

In the above, clicking on either the left or right button will send a HTTP request to the running web server. The Arduino reads this request and converts the url path into an action that changes the Arduino pin value and the servos move. If all has gone well you should be able to steer your RC Tamiya via the Arduino through the web served UI!

Summary

Tune in for the next post where we’ll add more remote control functionality. At that point it gets a bit more complex as you try to mimic the remote control logic of an actual RC car. For instance steering straight on release of the left or right button and being able to stop and reverse.

Before I go, here’s a quick demo of forward and reverse working that will be coming very soon! Although I need to find a better way of sharing my phone screen and recording at the same time…

Arduino RC Tamiya

Arduino RC Tamiya – Part 2

In the previous post the Tamiya RC car was built and we covered the electronic components. This gave us the knowledge required to look at replacing the factory components and control the RC car via code! Now let’s look at adding an Arduino for custom functionality.

Setting up the hardware

For this step I will be using an Arduino board to replace the receiver. This means the car will no longer have any radio transmission. Instead the servos and electronic speed controller will be controlled via code written to the Arduino board.

I’ve chosen to use the Arduino Uno WiFi Rev2 board because it has the required power and functionality. It also has the added bonus of WiFi which will be useful to enable Internet remote control of the car. Take a look at the above link for more information on the technical specification of the board.

I also bought an Arduino Proto Shield Rev3. With some soldering this will sit on top of the Arduino Uno board and allow custom ports and wiring. The servos can then be quickly plugged in or unplugged.

Arduino Uno WiFi Rev2
PROTO SHIELD REV3

The first step is to act on the above and do the custom modification to the proto shield. This involves adding two 3 pin connectors to the board over the 5V, gnd and 8, 9 digital inputs. You can see the outcome of doing that in the following photos:

Both the three pin connectors shown allow for a servo and electronic speed controller to be directly connected, powered and controlled by the Arduino.

Writing Arduino code

We are ready to write and apply some custom code to the logic. I highly recommend that you try your code with the servos not connected to RC car parts to begin with. It is far too easy to accidentally upload some code that runs a servo at full speed and your fully built RC car flies off your desk and cables rip apart, drinks go flying and screens smash etc… I warned you!!

At this point we can open up the Arduino IDE to start writing some c++ code. There’s many tutorials out there on how to use this IDE to upload code to the board and it’s straightforward. A quick Google will get you on the right track.

The first step to setup the code is to declare which digital pins the two servos are connected to. I mentioned earlier that I’ve chosen to use pins 9 and 10. If you have good eyesight you might be able to see that on the board in the photos.

Fortunately there’s an Arduino Servo class ready for us to implement: https://www.arduino.cc/en/reference/servo

#include <Servo.h>

Servo steering;
Servo throttle;

void setup()  {
    throttle.attach(9);
    steering.attach(10);
}

Our first movement

Simple, now we have two Servo variables that we can write to and control the physical Servos. The next tricky bit is figuring out the ranges of your Servo, most Servos range from 0 to 180. In the acceleration configuration there’s a neutral range around 90-100 with forward and reverse above and below those ranges respectively. The higher or lower the value from the neutral the faster your speed. In the steering servo configuration 90 is straight, 0 -> 89 is left and 91 -> 180 right. The higher this value the tighter the turn.

The below is a very simple script to demo forward movement and stopping. The car will first steer straight and then move forwards at a slow speed for two seconds before stopping for five seconds. This gives us a few seconds to grab the car before we realise our speed controller works in a different range and accelerates into the nearest wall at full speed… (you’re testing without the Servos attached to the car though, right?!).

#include <Servo.h>

Servo steering;
Servo throttle;

void setup() {
    throttle.attach(9);
    steering.attach(10);
    // Before we move the car, reset the steering
    steering.write(90);
}

void loop() {
    // Accelerate forwards at a slow speed for two seconds
    throttle.write(105);
    delay(2000);

    // Enter the neutral range for 5 seconds
    throttle.write(90);
    delay(5000);
}

If the above was a success we can try getting our car to turn around in circles by itself. The following code will repeat an automated three point turn:

#include <Servo.h>

Servo steering;
Servo throttle;

int accelerationSpeed = 89; // Slowest accelerate speed 90
int reverseSpeed = 104;     // Slowest reverse speed 102
int neutral = 91;
int brake = 180;

int noTurn = 90;
int leftTurn = 0;
int rightTurn = 180;

bool debug = true;

void setup() {
    if (debug) {
        Serial.begin(9600);
    }
    throttle.attach(9);
    steering.attach(10);
}

void Logger(String message) {
    if (debug) {
        Serial.println(message);
    }
}

void MoveBackward() {
    Logger("Move: reverse");
    throttle.write(reverseSpeed);
}

void MoveForward() {
    Logger("Move: accelerate");
    throttle.write(accelerationSpeed);
}

void Brake() {
    Logger("Move: brake");
    throttle.write(brake);
}

void Stop() {
    Logger("Move: stop");
    throttle.write(neutral);
}

void SteerLeft() {
    Logger("Steer: left");
    steering.write(leftTurn);
}

void SteerStraight() {
    Logger("Steer: staight");
    steering.write(noTurn);
}

void SteerRight() {
    Logger("Steer: right");
    steering.write(rightTurn);
}

void loop() {
    SteerLeft();
    MoveForward();
    delay(2000);
      
    Brake();
    delay(250);
    
    Stop();
    delay(2000);

    SteerRight();
    MoveBackward();
    delay(2000);
    
    Stop();
    delay(2000);
}

Summary

You should now have an RC car that does something similar to the one I made in this video:

That’s all for part two. Have a play around with the code and see what you can make the car do. There’s a couple of projects out there that have incorporated sensors at this point. They would stop the cars movement before it drove into anything. That could be quite useful functionality if you’re looking for more small additions.

I’ve created a GitHub repository for the above code samples and I’ll be adding more along the way. Check it out: https://github.com/dant89/arduino-rc-car

Stay tuned for part 3 coming in the near future. The next step will be using the WiFi on the Arduino board to allow remote control over the Internet.

Arduino RC Tamiya Car

Run for Heroes 5K

With the current COVID-19 lockdown situation it can be all but too easy to accidentally stay in your home for a few days without doing any of your permitted daily exercises. I’m guilty myself of submitting to the mindset of “Oh I’ll just go running tomorrow…” and then never actually making it out the door.

Thankfully there’s a great incentive right now to get people up and moving, the Run for Heroes challenge and it’s very simple too! All you have to do is run 5K, donate £5 and then nominate 5 of your friends to complete the challenge too. This results in people staying fit and also much needed funds for our NHS Worker heroes who have been going above and beyond for all of us.

I did my 5K yesterday and now it’s your turn to step up to the challenge because I nominate you! Go and enjoy the nice weather and get some lovely fresh air. Even for non runners it’s a great time to give running a try, you don’t have to bit fit and you don’t have to run fast, it’s just about doing your best and enjoying it, even if that’s walking most of the distance!

Run for Heroes Instagram: https://www.instagram.com/run.for.heroes

Remote Control Arduino Tamiya

Arduino RC Tamiya – Part 1

This is my first blogged side project and it’s quite an exciting / fun one. I hope this set of posts inspires you to get involved and give it a go yourself.

What is this project?
This project is about taking a standard remote control Tamiya and replacing the electronics (in particular the receiver) with an Arduino. This then allows the introduction of custom C / C++ code so we can do anything we want with the RC car! One particular interest I have is to make the RC car remote driveable, via Wifi for example so that friends can drive around my location. Once that works there’s a future step to add a mounted phone to the car with an app that would allow friends to have a telepresence.

Why would you do this?
There’s two reasons for this, the first being that we’re currently stuck in-doors due to Coronavirus (COVID-19) and there’s nothing to do so I need something to keep my creative and constantly logic solving mind at peace. The second is that when I was 11 years old I received and built my first Tamiya, a TL01 and have missed crashing it into things. What better way to get back into that then let a robot drive into things at full speed… Okay I’ll try to avoid that but robotics and programming can create some interesting scenarios.

What’s the plan?
As of writing I’ve already dived head first into this project so firstly I need to update on my progress so far, here goes:

The first step is to get some sort of remote control car that uses electronic components that are easy to get at and modify. As I have experience with Tamiya I know exactly how these cars work and the parts included, due to the lockdown I also knew I’d enjoy the building bit so I went with the Tamiya Grasshopper. This is very much a hobbyist level entry RC car but for this projects that’s perfect, I didn’t want to spend too much and ideally I don’t actually want or need it to be fast.

I already have the radio equipment and car electronics from previously so I didn’t need to invest in more of that but this is the build list so far:

  • Tamiya Grasshopper
  • 1x Futaba T2ER controller (this has lasted 19 years at time of writing)
  • 2x NI-CD 7.2V batteries at 1800MAH and 3000MAH
  • Lots of random electronic speed controllers
    • Xtra Ripmac QUAKE
    • LRP Runner plus reverse digital
    • Tamiya TBLE-02S
  • Lots of random servos
    • Futaba
    • Hitec
  • Futaba FP-R122JE receiver with 40Mhz green crystal

The Grasshopper arrived and I spent an afternoon reminiscing how pleasurable and often extremely frustrating it is building kit RC cars. If you’ve never done this step then I highly recommend it, starting out with plastic moulds and finishing off with quite a powerful little car is very satisfying!

So that’s the first stage complete, I have a built and working remote control car that I can begin to adapt.

The car currently functions as normal with all the default parts an RC car has. To go through those quickly we have the receiver, this talks to the remote control and receives the transmission of data from the throttle and direction sticks. It sends this data to either the servo that controls the speed or the servo that controls the steering. Servos are small mechanical servomotors that contain a motor and gears, they perform movements such as rotating to push and pull steering rods. Most RC cars will have two by default, one works to steer and the second would control the speed via a manual speed controller, these have now mostly been replaced with electronic speed controllers so you’re more likely to only need a steering servo. The electronic speed controller does what it says on the tin, the receiver sends the speed related data to it and it tells the motor how fast to rotate, when to stop and when to put that car into reverse. Lastly connected to this is the battery that powers all of these components.

That’s all for step 1, we now have everything needed on the RC car side setup and working so we can begin to hack away with the electronics. In step two I will go into detail on replacing the receiver with an Arduino and how we can wire the servos into the Arduino so that we can program them to control what they do.

Part 2 is now available: https://dant.blog/arduino-rc-tamiya-part-2-33/

Hello World

As with all new blogs that feature a level of tech talk, Hello World!

I’ve decided to have another go at writing a personal blog, I’ve written a few over the years included topics not limited to: Arsenal, getting started in Web Design and running 500 miles for charity. However they’ve never stuck around due to a mix of server migrations / breakages and a loss of interest in the topic. I’ve decided this time to make it a bit broader and implement a more reliable back-end setup to ensure it sticks around!

So what will this blog be about then if you’re not picking a particular subject? Good question, it’s going to be a mix of all my interests; a bit of work, coding, sport, random side projects, etc. Hopefully it will end up quite diverse but also somewhat interesting to people.

Enough rambling, let’s go down to some serious blogging.

See you in the next post!