A Tour of Silicon Valley

I recently did a self-tour of Silicon Valley, and as someone who works in the field of technology, it was a fantastic experience.

The first stop of the tour was Apple Park, the Head Quarters for Apple Inc. The only section open to the public is the Visitor Center, which mainly consists of a massive apple store (which was insanely busy as it was 2 days after the iPhone 11 and 11 Pro launched) as well as a sizeable Augmented Reality display of the Apple Park Campus and the famous UFO looking Apple Ring building. This AR display consists of a large model, shown in the photos below, that you can interact with using an iPad Pro which the staff hand out to guests entering the display area. On the iPad Pro graphics are superimposed over the model showing not only a realistic aerial view of the campus but also showing various bits of information relating to the design of the ring building such as how the ring building is designed in a way to take advantage of the environment (wind, etc.) to cool itself in an ecologically friendly manner.

The next stop was the Apple Garage, which is the garage at the house in which Steve Jobs grew up. It is commonly considered the birthplace of Apple. Steve Wozniak (Apple co-founder) has said that this is a bit of a romanticized myth, but it was still great to see.


Next came the Computer History Museum, a truly amazing museum with items covering the entire history of computers. From the abacus to mainframes and supercomputers to the current day smartphone, the items on display are truly astonishing. Below are some photos and descriptions of some of the items on display.

Numerous Abacuses on display, one of the oldest forms of calculation tools.

A variety of mechanical calculation machines.


A Curta Calculator, also known as the Pepper Grinder Calculator. One of the most advanced handheld mechanical calculators ever created.

A Selection of IBM Mainframe Equipment.


A model of ENIAC, the world’s first general-purpose computer.


A Selection of Fortran Programming Books and Promotional Material.

A PDP-1 Display, Spacewar! one of the first video games ever was programmed on and ran on the PDP-1.


A 486 DX motherboard.

A display showing the advancement of transistors, microprocessors, silicon wafers, and Moore’s Law.

Various Robots on display. Including expensive toys, industrial robots, and research robots.

Numerous bizarre and unusual computer peripherals on display.

Video and computer gaming displays, with various consoles and games on display.

Apple I, Apple II, Apple Lisa, and Original Macintosh computers.

IBM PC Model 5150 and an Altair 8800.


A boxed copy of Windows 1.0.


The NeXTcube workstation from NeXt Computers. NeXt computers were founded by Steve Jobs after leaving Apple in 1985, and Next Computers were acquired by Apple when Steve Jobs rejoined Apple in 1997. The NeXTStep Operating system became the foundation for Mac OSX.


Waymo Self-Driving Car.


A scale model of the Mars Rover.

World of Warcraft exhibition.

An exhibition showing the rise of MP3s and the rise and fall of Napster.

The next stop after the Computer History Museum was the Googleplex, the massive headquarters of Google. The Googleplex, which is mostly open to the public, has various significant things to see, such as the Android Statue Lawn, where retired Android statues representing previous versions of the mobile operating system are on display. From volleyball courts to Massive Statues to vegetable gardens, it is easy to see why the Google Campus has a reputation as the best working environment. Here are a few photos of the Googleplex.

The last stop in Silicon Valley was Stanford University, a University that amongst its alumni has various famous people. Stanford has a beautiful Campus, as can be seen in the photos below.

A Tour of Silicon Valley



The UCTRONICS Smart Robot Car Kit is an easy to build obstacle avoidance robot kit that also allows for direct user control of the robot through either Infrared (using the included remote control) or Bluetooth (an Android App is available on the Google Play Store).

This is a great starter kit as no soldering is required and additionally there is a lot of space on the robot chassis for customization and additions later on. Assembly instructions are provided in full color and takes the builder through the assembly process in a step-by-step manner, which is easy to follow.
A prebuilt Arduino sketch is available for download from the UCTRONICS website to make the assembled robot functional, however nothing prevents the builder from writing their own. This is however one area where I do feel the kit falls short as an educational tool, instead of just providing a prebuilt sketch, it would have been great if a step-by-step guide was provided taking the builder through the process of writing their own sketch, explaining concepts and what is being done and why along the way.
This is however still a great starter kit and I would recommend it for anyone getting started in robotics or Arduino related building.


DIY VR Headset for $80 (DIY VR Part 2)


The purpose of this series of posts was to look at ways to experience VR at home for the lowest cost possible. In Part 1 of DIY VR, we took a look at using a smart phone and a Google cardboard compatible headset to stream computer games to the phone in stereoscopic 3D. The main problem with this approach was that it was still relatively expensive as it required a smart phone (iOS or Android) to function.

Now in part 2 we will look at building a VR headset from scratch. My initial goal was to do this for under $150(USD), however after shopping around and changing some parts out for alternatives I managed to get this down to around $80. So let us get started.

The parts required are:

  • Toggle Flick Switch
  • 2x LED
  • 1x resistor 150 Ohm
  • 1x Micro USB cable (at least 2 meters long)
  • 1x HDMI Cable (thin ones work best as they hinder movement less, also at least 2 meters long)
  • Some jumper wires
  • DC Adapter plug 5V 3A (Raspberry Pi compatible one works great)
  • Push Button
  • Google Cardboard Compatible VR Headset (I recommend one with a phone compartment door that opens as it gives better access than the ones which uses a tray that slides in)
  • 6DOF MPU 6050 3Axis gyroscope and accelerometer
  • Arduino Micro (can use off brand alternative)
  • 5inch RaspberryPi LCD Screen 800×480 with HDMI interface

All of these parts can be acquired on AliExpress for about $80 ($82.78 to be precise), as shown in the image below:

Resistorflick_switchwireDC AdapmicroUSBHeadsetpushbuttonledMPU6050lcdHDMIarduinoMicrototals

You will also require Tridef3D or similar software (there are some free alternatives, but I have not had a chance to give them a try at present). Tridef3D is used to convert any Direct X 9/10/11 game into stereoscopic 3D. Tridef3D offers a 14-day free trial, which is plenty to give this a try. The full version of Tridef3D retails for $39.99.

Now that we have all the required components, let us begin with the assembly.

The assembly comprises of 3 main elements:

  1. The Arduino Micro circuit (containing the MPU 6050, push button and led)
  2. The Wiring (providing connectivity to Arduino Micro and power to Screen)
  3. Inserting the screen in the headset and connecting the micro USB cables as well as the HDMI cable.

The Arduino Micro circuit

The diagram below illustrates how the different components need to be connected to the Arduino Micro:


The push button uses digital pin 5 and the MPU 6050 is connected to the Arduino Micro as follows:

– MPU 6050 SCL pin to Digital Pin 3 on Arduino

– MPU 6050 SDA pin to Digital Pin 2 on Arduino

– MPU 6050 VCC to 5V pin on Arduino

– MPU 6050 GND to GND pin on Arduino

The code to be loaded on the Arduino is as follows:

#include <Mouse.h>
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>

MPU6050 mpu;
int16_t ax, ay, az, gx, gy, gz;
int vx, vy;
int inputPin = 5;
bool enableMouse;

void setup() {
enableMouse = true;
pinMode(inputPin, INPUT);
if (!mpu.testConnection()) {
while (1);

void loop() {
int val = digitalRead(inputPin);
if (val == HIGH) { // check if the input is HIGH
//Place logic here to execute when button is pressed
//Disables mouse movement while button is pressed, this allows you to set your view angle easily.
enableMouse = false;
enableMouse = true;
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
vx = -(gy)/150;
vy = (gz+100)/150;
Mouse.move(vx, vy);

Just note that the orientation of the MPU 6050 makes a difference to which of the axis of the gyroscope will be used. For the above code the MPU 6050 was mounted on the side of the headset as shown in the pictures below:


In the event of the MPU 6050 being mounted with a different orientation you might have to substitute between the gx, gy and gz values until the desired configuration is achieved.

For my configuration I am rotating around the Y and Z axis.

Also the numbers associated with calculation of vx and vy might have to be tweaked to get the results (movement speed etc.) you desire.

I also added a push button, that when pressed temporarily disables the gyroscopic mouse movement. This is useful when you want to reset you point of view in games.

I attached all the parts of this circuit to the VR Headset using double-sided tape.

The Wiring

In order to have as few cables as possible connecting to the VR headset I modified the USB cable so that it pulls external power from a DC power adapter (a single USB port will not be able to power both the Arduino and the 5 inch LCD) as well as splitting into 2 micro USBs on one end (one only provided power to the LCD and the other one both power and connectivity to Arduino.) the below diagram shows how the wiring is connected:


For reference a USB cables contains 4 wires:

  • Red wire – +5V DC
  • White or Yellow – Data connectivity
  • Green – Data Connectivity
  • Black – GND

I also included a switch to turn the power on and off (this is useful to turn off the mouse functionality until it is needed, otherwise it will interfere with mouse movement when it is not desired) as well as an LED to show when the headset is powered on.


Inserting Screen in Headset and connecting all the wiring

The LCD screen is held in place by the clamps in the headset used to hold a phone (it is a snug fit). Then simply connect the 2 micro USBs to the LCD and Arduino respectively (ensuring the plug with the data connections is plugged into the Arduino and that the power only micro USB is plugged into the power socket on the LCD display). Try to run the cables in the extra spaces in the Headset around the screen in order to keep them out of the way.

Lastly connect the HDMI cable to the LCD.

The assembly is now complete.


Connecting headset to PC and setting up software

To connect the headset to your PC do the following:

  1. Plug the DC adapter into mains power.
  2. Plug the USB connector into an available USB port in your PC.
  3. Connect HDMI cable into and available HDMI port on your PC graphics card (You can use a DVI port with an adapter)

Go to display settings and click on detect displays, then set Multiple displays to “Duplicate these Displays” and make sure your resolution is set to 800×480.

Open up Tridef3D and start-up a game.

You might have to play around with each individual games graphical settings as well as mouse sensitivity to get the best results.

For future enhancements I will look at getting a higher definition LCD screen and also work on head movement tracking by using infrared LEDs and a Wiimote (Wiimote used as a IR Camera).

And there you have it a DIY VR Headset for $80. Give it a try.

Here is a short demonstration video:

DIY VR Headset for $80 (DIY VR Part 2)



Today we will look at the last component in our 3 part series on basic electronic components, the diode.

Diodes only allows electricity to flow through them in a single direction, this is achieved by the diode having a low resistance, ideally zero, in one direction and a high resistance, ideally infinite, in the other direction. This does mean that diodes are polarized (they have 2 terminal, an anode and a cathode) and the direction in which they are placed in a circuit is of great importance.

Diodes are extremely important in converting AC to DC though their use in a bridge-rectifier, but that is a topic for another post.

Diodes usually have 2 markings on them, a band to indicate the side of the cathode and secondly the diode type code (for example 1N4148) this can be used to look up the maximum voltage and current the diode allows.

Here is the schematic symbol used to represent a diode:




Today we will cover the next in our series of the basic electronic component, the capacitor.


A capacitor is used to store and release electrical charge in a circuit. When the voltage in the circuit is higher than what is stored in the capacitor, the capacitor will allow current to flow in and the capacitor will be given a charge. When the voltage in the circuit drops lower than what is stored in the capacitor it will dis-charge, releasing its stored charge into the circuit. This will cause the voltage in the circuit to temporarily raise.

This is extremely useful as some components, such as electric motors, use more power when they are first activated then when they are already active which can cause a voltage drop in the circuit that can have negative effects on other components in the circuit.

Capacitors help level out these fluctuations in voltage.

There are 2 main types of capacitors, Polarized and Non-Polarized. I will not go into a great deal of detail regarding the differences, but in a nut shell non-polarized capacitors have no implicit polarity and can thus be connected to the circuit either way, whereas polarized capacitors have a defined + and – terminal and must be connected to the circuit corresponding to its terminal polarity. This also means that non-polarized capacitors are suited for use with AC, but polarized capacitors are strictly only suited for DC as they experience large leakage if the voltage is inverted across its terminals as is the case with AC, which can cause the capacitor to overheat.

The capacitance of a capacitor is measured in Farad(F). For most circuits you will likely work on microFarad(µF) and picoFarad(pF) sized capacitors will be utilised.

Here are the schematics used to represent both polarized and non-polarized capacitors:

Polarized Capacitor

polarized cap            Non-Polarized Capacitornon polarized cap



In a previous post we had a look at transistors, in the next few posts we will look at 3 other basic electronic components; resistors, capacitors and diodes.

Let us start with the most basic of the 3 today, the resistor. As their name suggest, they resist the flow of electrical current through a circuit. The change in current can be determined using Ohm’s Law, which states that the current flowing through a conductor equals the Voltage across the conductor divided by the resistance present in the conductor, or  I = V/R, where I represents current (measured in Amps), V represents Voltage (measured in Volts) and R represents the resistance (measured in Ohms Ω).

Resistors have coloured stripes along their sides which are used to indicate their values, here is the table used for value lookup:

Colour Value
Black 0
Brown 1
Red 2
Orange 3
Yellow 4
Green 5
Blue 6
Violet 7
Grey 8
White 9

A simple way to remember the sequence of the colours is with the rhyme:
Better Be Right Or Your Great Big Venture Goes Wrong.

The last stripe indicates the tolerance of the resistor:

Colour Value
Brown ±1%
Red ±2%
Gold ±5%
Silver ±10%

Here is an example of how to utilise the table:

resistor 220

The resistor above has 3 colour stripes and a tolerance stripe.

Red Red Brown with a Gold tolerance stripe.

This translates to:

2 2 x 10¹ ± 5% = 220Ω ±5%

Now for an example with a Resistor with 5 stripes:

resistor 10k

The resistor above has 4 colour stripes and a tolerance stripe.

Brown Black Black Red and a Gold tolerance stripe.

This Translates to:

1 0 0 x 10²± 5% = 10,000Ω ±5% = 10kΩ ±5%

Here is the schematic used to represent Resistors in a circuit diagram:

Resistor Symbol


Elecfreaks Arduino Advanced Kit


The Elecfreaks Arduino Advanced Kit is an AWSOME product. It contains everything you need to build some impressive Arduino based projects, including a MP3 player, an Alcohol tester and a Tetris game to name a few.

The Kit includes:

  • 1 x Freaduino UNO    
  • 1 x mini USB cable
  • 1 x TFT1.8 LCD 
  • 1 x Octopus ADKey     
  • 1 x Octopus Passive Buzzer Brick    
  • 1 x Octopus MQ3 Gas Sensor Brick     
  • 1 x MP3 Module     
  • 1 x Color Sensor     
  • 1 x 9 DOF Module
  • 1 x ESP8266 Serial Wi-Fi Module
  • 1 x BLE Adapter 
  • 1 x One Channel Relay Brick 
  • 1 x Octopus 5mm LED Brick
  • 1 x 9V AA Battery Holder
  • 30 x Jumper wires

The Kit comes with an Arduino compatible Freaduino board, which is simply an Arduino UNO R3 manufactured by Elecfreaks.

All the components come individually packed in small boxes (all of which are clearly labeled) and it is really well presented.

The kit also includes color printed cards illustrating each project and how to assemble it. Additionally the kit has a wiki page (http://www.elecfreaks.com/wiki/index.php?title=Arduino_Advanced_Kit_-_EN), which contains the source code for all the projects.

The Elecfreaks Arduino Advanced Kit is great value as it is less expensive than buying all the individual components separately (and also a great deal more convenient).

I highly recommend this kit to anyone interested in developing/building in the Arduino space.  

Elecfreaks Arduino Advanced Kit


I am starting an IoT project and wanted to share a little bit.  IoT or the Internet of Things is defined on Wikipedia as “the network of physical objects—devices, vehicles, buildings and other items embedded with electronics, software, sensors and network connectivity—that enables these objects to collect and exchange data. The Internet of Things allows objects to be sensed and controlled remotely across existing network infrastructure, creating opportunities for more direct integration of the physical world into computer-based systems, and resulting in improved efficiency, accuracy and economic benefit;”.  

To learn more I would recommend the book The Internet of Things Do-It-Yourself at Home Projects for Arduino, Raspberry Pi, and BeagleBone Black by Donald Norris. It provides an in-depth technical overview of concepts as well as some projects that can be built. The projects in the book are not particularly exciting but they do a good job at illustrating concepts and methods utilised.


So I am going to be using a Raspberry Pi2 running Windows 10 IoT core, which will be communicating with some Arduino boards.

I am also looking at integrating with Azure Machine Learning to do some interesting things. 

I have not decided on many elements of the final project, but it will involve a robot.


On a side note, do not try to deploy Windows 10 IoT Core on a SD card using a Mac, it is a huge pain. My main computer I use at home (and for most of my development, blogging, video editing, etc.) is a MacBook Pro and in the end I gave up trying to get the deploy working and used my windows laptop which worked almost instantaneously.

Once I have decided exactly what I want to achieve and made some progress I will post more on this topic.



Today we will have a look at how to connect a piezo buzzer to an Arduino and how to generate different audio signals with it. A piezo buzzer is a audio signalling device, it is the most basic electronic component by which to generate sounds at different frequencies.

A piezo buzzer has 2 connection terminals, one is connected to GND and the other to a PWM digital pin, for this example we will use pin 3.


We will use the tone() function to generate tones at different frequencies, for an Arduino Uno the frequency rage is between 31 and 65535 Hz. Please note that the possible min and max frequencies differ between different models of Arduino boards. The tone() function takes 3 parameters, firstly the pin to use, then the frequency to use and lastly the duration to generate the tone in milliseconds.

Here is the code used:

#define PIEZO_PIN 3

void setup()

void loop()
     tone(PIEZO_PIN, 31, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 15000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 30000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 45000, 1000);
     delay(500); // Pause between Tones 
     tone(PIEZO_PIN, 65535, 1000);
     delay(500); // Pause between Tones 
     noTone(PIEZO_PIN); // Silence Tones


A RGB LED is a LED that can change the colour of the light it produces depending on which of the LEDs’ Connectors have current flowing through them. The LED has 4 connectors, one connector for red, one for green, one for blue and then finally an anode or a cathode, depending if the RGB is a common anode or cathode LED.

So what is the difference between common anode and common cathode?

Well a RGB LED is actually a combination of 3 LEDs, a red LED, a green LED and a blue LED. All LEDs have 2 connectors, an anode and a cathode. So depending how these LEDs are connected together determines if they share an anode or a cathode, thus common anode RGB LED or common cathode RGB LED. The Anode\Cathode leg can be identified as it is the longest leg on the LED. Below are 2 diagrams that illustrates the difference discussed.

Common Cathode:

Common Cathode_schemCommon Anode:

Common Anode_schem

How these 2 different RGB LEDs are connected to a circuit also differs, let us first have a look at a circuit that contains a common cathode RGB LED:

common cathode arduino_bb

Here is the code used with this circuit:

int redPin = 9;
int greenPin = 10;
int bluePin = 11;
void setup()
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
void loop()
  setLEDColour(255, 0, 0);  // red
  setLEDColour(0, 255, 0);  // green
  setLEDColour(0, 0, 255);  // blue
  setLEDColour(255, 255, 0);  // yellow
  setLEDColour(80, 0, 80);  // purple
void setLEDColour(int red, int green, int blue)
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  

Now let us have a look at a circuit that contains a common anode RGB LED:

common anode arduino_bb

Code used with this circuit:

int redPin = 11;
int greenPin = 10;
int bluePin = 9;
void setup()
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);  
void loop()
  setLEDColour(255, 0, 0);  // red
  setLEDColour(0, 255, 0);  // green
  setLEDColour(0, 0, 255);  // blue
  setLEDColour(255, 255, 0);  // yellow
  setLEDColour(80, 0, 80);  // purple
void setLEDColour(int red, int green, int blue)
  red = 255 - red;
  green = 255 - green;
  blue = 255 - blue;

  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);  

Although the circuits and code differ between the 2 types of RGB LEDs, the end results are exactly the same.

Try changing the values passed into the setLEDColour function to see what different colours can be created.