Slider
Owen Kelly
Computer Science Student - University of Warwick
Banner Shadow

Programmer

Scientist

Mechanic

Raspberry Pi Robot

I’ve always been fascinated by the Raspberry Pi, it amazes me how they managed to fit so many possibilities into such a small computer. I first bought my Raspberry Pi in January 2015. Ever since I bought my Pi I’ve wanted to make a robot out of it, so I bought a chassis kit from the internet which came with motors, wheels and the chassis, I then bought an L298N H-Bridge in order to control the motor.

In order to help me building the robot I followed an excellent tutorial made by sentdex on YouTube called Robotics and the Raspberry Pi.

I found the tutorial really easy to follow and eventually I ended up with my very own robot.

I was really happy with my robot, but I wanted to do more, so after some research I found an open source program called Jasper. Jasper is an open source voice control software, it enables you to speak to your Raspberry Pi and have it talk back to you! While setting it up I ran into a problem where the Pi would outright refuse to output audio, I eventually found that this was because I had two sound cards in the system, one to power the microphone and the other which was the sound card built into the Pi, this meant when trying to use Raspi-config to force audio out of the 3.5mm jack it was trying to modify the settings of the other sound card, therefore throwing up an error. In order to solve the problem I had to use alsamixer to identify the different sound cards and then type the command to force audio out of the 3.5mm jack manually and then my robot was given the gift of voice, albeit very robotic voice!

I’ve now added some distance sensors and made my robot autonomous, you can see it here.

Voting on the Real Blockchain

Having successfully created my own voting app using testrpc it was time to venture out onto the real blockchain.

However, I am using the Ropsten test network instead of the main Etherum network, the main reason for this is because on Ropsten all the Ether used is fake and has no value.

After waiting two days for Ropsten sync and acquiring some Ether I was ready to deploy my contract, I used the same contract from my testrpc voting app but this time I was using truffle to deploy the contract so that I could create the web app to go with the voting system.

Let’s take a look at what happened:

So the first step was to deploy my contract, I used truffle and this showed up in the geth client:

As you can see the first item is the contract being created and then the transaction is the contract being initialised. Since the blockchain is public and open, we can have a look at the details of the contract creation on ropsten.etherscan.io:

This also shows the interesting part of Ethereum, gas. Deploying this contract used 300564 gas and the rate was 100 Gwei per unit of gas, therefore the total amount of Ether used to deploy the contract was 0.0300564 ETH, since this was on Ropsten the Ether was fake, however, if this was on the main Ethereum network at the time of writing it would have cost £6.60 to deploy this contract.

Now it was time to vote! Following the tutorial I talked about in my previous post, I created a web app which would display the votes and allow you to place a vote.

 

This webapp used javascript to cast votes and add them to the blockchain, since this is a function of the contract it costs Ether to cast a vote, therefore the webapp is designed to use the default account for that computer (found by typing ‘web3.eth.accounts[0]’ into geth), from here the transaction would be created and added to the blockchain:

Again, we can look at this on ropsten.etherscan.io to see a bit more about our transaction:

In this case, we can see that this transaction used 43006 gas, therefore it cost 0.00516072 ETH to cast our vote, or £1.13 at the time of writing if we were on the main Ethereum network.

Using A BT Home Hub As A Wireless Extender

Wi-Fi is Great! The ability to whip out your phone and be connected to petabytes upon petabytes of data in seconds with no wires in between you and that magic little box that connects you up! What’s not so great is when no matter how hard you try, you just can’t get a reliable signal in some places, this is a particular problem I’m having and therefore needed a solution.

I had a BT Home Hub 3 lying around that hasn’t been used for many years (We now have a BT Hub 5) and so I decided to put it to good use. I found an excellent guide by unixetc.co.uk that you can see here, but I will summarise the steps here.

In essence, there are three main parts to using an old router as an extender, you also don’t need to use a BT Hub specifically, this method will work with virtually any router on the market!

 

Part 1: Turn Off DHCP

DHCP is the service that assigns IP addresses to all your devices on your network, this is important since an IP address is an identifier for each device on a network, but you can’t have two of them on one network, so you must disable DHCP on the router you intend to use as the repeater.

Part 2: Change the IP Address of the Router

This is only necessary if both routers have the same Default Gateway, in my case since both devices were BT Home Hubs their Default Gateway was “192.168.1.254” however, just as you can’t have two DHCP servers on one network, you can’t have two devices with identical IP addresses on a network.

Part 3: Connect it up!

After that, just connect an ethernet cable running from your main router to your repeater and plug it into any port (Not the Infinity WAN port!) and there you go! Any devices that connect wirelessly to the repeater or via an ethernet will have internet access! In my case, I needed the additional signal a fair distance away from the main Hub so I elected to use a “Powerline” adapter, these work by sending the ethernet signals through the electrical wiring of your home, thereby I was able to easily connect the two routers together with no long cables or pulling apart the walls!

 

In conclusion, this method works well for someone who just wants to make their Wi-Fi go that little bit further, I did find that the ping according to speedtest.net had increased, so maybe this isn’t the best solution for gamers, but for casual surfing this worked more than well and I was able to get Wi-Fi in places it has never reached before!

Epilogue

Having now used the extended Wi-Fi network for a while, I found that it works well, as I leave the range of our main hub my phone or computer will connect to the extended network, however, I sometimes found that when I sat on the boundary of the two networks my phone couldn’t always decide which one to connect to and would frequently switch networks.

 

I have now updated this setup using the BT Hub 5 as an extender, you can see it here.

 

Installing Digital TV Into A Jaguar X350

It’s always been a dream of mine to have TV in the car, however, since we bought our car after the digital switchover (2009/10 I think) I’ve never had the luxury since the inbuilt TVs are analogue.

Fast forward to last week and the DVD player in our car kicked the bucket, looking on the internet a replacement Jaguar unit was £150… ouch!

And so it began, we decided instead to purchase a freeview box from the internet, it cost us £50, well under the cost of a new DVD player.

First things first was to make sure the concept worked, so touching the power connections to the battery and:-

It worked! The box was able to pick up channels, albeit not many, but what can you expect?

So then it was time to put it in properly! Installation took a day’s work, involved removing the rear seats and parcel shelf. Threading one antenna to the front of the car and one on the back window, also positioning the remote eye in the cabin and connecting everything to power.
This particular box also has support for USB sticks, so I decided to route the USB port into the cabin, so a quick trip to Maplin to get an adaptor, then I threaded it into the center armrest along with the RCA cables to connect the box to the TVs.

Since we were replacing our DVD player we decided to mount the box where the DVD player used to be, and I used an old radio and took all of the circuitry out of it and used it to mount the box, it does a good job of blocking the hole there:-

And thus, we were finished and we were able to get BBC One on the TV!

All in, we paid £50 for the freeview box and £8 for the adaptor to get the USB port into the cabin.

It’s definitely nice to see live TV returned to the car and even when there isn’t live TV we can store hundreds of hours of video on a USB stick!

Epilogue

I have now used the car for a few months since fitting the Digital TV and I have had a chance to really test it. In conclusion, I found that the TV works well driving near cities/towns, but less well when driving on rural roads. Overall the picture quality is good and when stopped the signal tends to be excellent, the TV does work while moving, however when you leave the range of one mast and enter the range of another mast the box has to be retuned, fortunately, this takes less than 5 minutes and there is a handy “Search” button on the remote to start the retuning process.

In good signal areas the box was able to receive almost all freeview channels, I was even able to watch half of an episode of Top Gear on Dave when the car was moving, however I found that when the car is moving the best signal tends to be on BBC One/Two.

In my opinion, the box was definitely worth the money since even when we are out of range of TV signal you can still watch videos from the USB stick. The only problem with this setup is the three AV cables stick out of the inputs in the rear armrest, therefore the armrest has to be down and has a “bump” when the TV is in use, this also, unfortunately means the TV cannot be used when there is someone sitting in the middle seat, but I am looking into a solution for this!