Interfacing Arduino with rFactor

09/05/2012 Posted by Jason Carvalho

So, I’ve been fiddling around with an Arduino board for the last week or two. It’s a small microcontroller board that you can dump your own code onto and it’ll run it stand-alone as long as it has a 5V power source. It has about 20 digital and analog input/output pins, so the possibilities of what it can do are pretty much endless with the aid of various small electronic components – read temp sensors and control your central heating, be a complete weather station that transmits its data over the internet, control a robot using accelerometers and wireless comms, etc.

Driving an LCD display is dead easy, so I’d like to build a little onboard computer for the MX5 to display some convenience type data such as outside temp, mpg, speed, distance etc. Logging things like accelerometer readings to an SD card is also reasonably straightforward (and about 100x cheaper than a track day data logger).

I’ve also been playing with the rFactor API and written some code into a plugin to output RPM via the PC’s serial port. I’ve also popped a bit of code on the Arduino that receives this data and illuminates LEDs accordingly.

It might not seem terribly exciting, but it’s a proof of concept in terms of getting data out of rFactor and into the Arduino. Next phase is to build a small electronic dash display, so I can get rid of all the on screen info from my monitor for a more authentic sim experience.

Pulled pork baps

24/01/2012 Posted by Jason Carvalho

I’ve just installed a great new plugin here that makes it easy to add and keep track of recipes. It’s written by the guys at GetMeCooking and more info in the plugin can be found here. Here’s one to start off with…

Pulled pork baps

Serves 6
Prep time 12 hours
Cook time 5 hours
Total time 17 hours
Meal type Lunch, Main Dish, Snack
Misc Serve Cold, Serve Hot
Slow cooked pulled pork, cooked in a homemade bbq sauce. Ideal served warm in baps but would also work well served with rice or potatoes.

Ingredients

  • 1.2kg Pork shoulder
  • 1/2 medium Onion, finely chopped
  • 3 cloves Garlic
  • 100ml Tomato ketchup
  • 50ml BBQ sauce
  • 100ml Orange or apple juice
  • 50ml White wine vinegar
  • 50g Brown sugar

Optional

  • 1 tablespoon Wholegrain mustard
  • 1 Chilli, chopped

Note

This is a great recipe which at first glance looks like it takes a lot of time and effort to make. However, the time spent actually doing stuff is minimal and the meat spends most of its time either marinating in the fridge or cooking slowly in the oven. It should make enough for six baps, or four if you're feeling hungry. Note that all the ingredients are approximate - if you prefer your bbq sauce hotter/milder/sweeter/more tangy then feel free to adjust the amounts accordingly.

Directions

Mix all the above in a large bowl and put in your shoulder of pork, making sure it's all covered in lovely marinade. Cover it with some clingfilm and leave it in the fridge overnight.

The following morning, pop it all in a casserole dish with a lid on and put it in the oven at a nice low 150C for 4 hours. After 4 hours, admire the smell in your house, take out the shoulder of pork and put to one side and pour out all the juice into a jug. With a pair of forks shred up all the meat and put it back into the empty casserole dish. Chuck out any big bits of fat or rind.

Spoon some of your sauce over the shredded pork in the casserole dish - about a third of it - just enough to keep the meat moist but you don't want it swimming in liquid. Put the lid back on and put it back in the oven (at 150C) for another hour. Check the meat half way through this step to make sure the meat isn't drying out and getting tough.

The remaining sauce in the jug will be quite thin and runny, so bring it to a gentle boil in a saucepan and let it bubble for about 10 minutes until it's nice and thick. It'll thicken even more as it starts to cool.

That's pretty much it. Serve up your pork into nice soft white baps, top with the homemade bbq sauce. Lovely.

Concept 2 rowing

23/01/2012 Posted by Jason Carvalho

According to the American Psychological Association the three most popular New Year’s resolutions each year are to lose weight, quit smoking and exercise regularly. I’m not particularly original and I don’t smoke, so as usual I am spending the first couple of weeks of January planning my training in order to become some sort of sporting god by the end of the year. It won’t happen, obviously.

Challenges this year will hopefully include both Milton Keynes half marathons and perhaps a triathlon. A new one for me though is rowing. I’ve signed up to enter Concept 2′s online leaderboard and monthly challenge league in the hope of keeping me honest and in the gym on a reasonably regular basis. Unfortunately their league season runs from September to July so I’ve missed the first few events, but hopefully I can post a time for each of the remaining seven events.

More details on the Concept 2 leagues here

MX5 Trackday @ Stowe, Silverstone

20/09/2011 Posted by Jason Carvalho

MX5s at Stowe circuit

My Roadster

A while back I posted that I’d just picked up a new Eunos Roadster (MX5) and that photos would follow shortly. Well, over a year later, here are a few.

I attended an MX5 trackday this weekend at Silverstone’s Stowe circuit. It was the first time the car has really been pushed hard since I’ve owned it and I’m pleased to report that it handled the day well. The Roadster is well suited to Stowe’s short straights and twisty nature. Handling was spot on – this car is so easy to steer on the throttle, even in the wet – and the car kept up with most stuff through the bends. The straights were a touch frustrating though, lots of cars in attendance were either bigger engined models or fitted with turbos or superchargers which left me pretty much bottom of the pile in terms of straight line speed.

The car feels a little exposed on track in standard trim, a proper roll bar/harness bar and a decent seat with harnesses would be nice. More power would be great too but it would be difficult to justify the cost of a supercharger conversion when the car only cost £1000.

Mazda On Track are running a day at Brands Hatch in December which I’d like to attend. I’ll have to see how money is looking in the run up to Christmas.

The rest of the MX5 trackday photos are here in my Flickr stream

Behind the scenes – timelapse video

01/09/2011 Posted by Jason Carvalho

 I was recently asked to help out at a Taekwondo studio shoot with photographer Ben Luckman. In between moving lights and backdrops around and generally being in awe of these guys’ martial arts awesomeness, I decided to shoot a little behind the scenes video and set up a time lapse camera in the corner of the studio to capture the whole session.

For the techie geeks out there, the time lapse frames were shot on a Nikon D70 tethered to a Macbook running Sofortbild timelapse and camera control software, shooting a frame every 12 seconds for the duration of the two hour shoot. I set the D70 to manual focus and exposure to avoid the camera hunting around and to give stable light levels. Video clips were shot on a Flip HD pocket video recorder and the whole lot was put together in iMovie ’11.

This is the result:


TKD Shoot Aug 11 from Jason Carvalho on Vimeo.

I’ve got a long list of things I’d do differently next time, but I think the concept seems to work quite well.

For more info on Ben’s photography, check out his flickr stream and website.

Roadster

28/07/2010 Posted by Jason Carvalho

I bought a new car from a friend a couple of weeks ago. I didn’t really need another car but it was a bargain and I couldn’t resist. It’s a 1990 Eunos Roadster (Jap import Mazda MX-5). Not sure if being 20 years old makes it a classic car or just old.

It’s not perfect. One of the rear dampers feels like it’s knackered and a bit bouncy so left and right cornering isn’t entirely consistent when pushed hard, there are a few paint chips and scuffs here and there, the diff needs an oil change and the stereo speakers are ready for the dustbin. On the plus side though, it has extremely low mileage, a new hood, a brand new stainless steel exhaust, two sets of wheels, a sweet running little engine and has just sailed through an MOT with no problems at all.

By my reckoning it should make for a very cheap little toy to stick in the garage and take for a drive on sunny days. Unlike my previous Roadster this one’s ‘just’ a 1.6. I say ‘just’, but the difference in power between this and the 1.8 is negligible and if anything I would say that the 1.6 is the revvier, more sporty engine. I think this one’s had an uprated flywheel too which feels great, especially on downshifts. Makes the VX220′s powerplant feel positively lazy.

I’ve only had a chance to drive it properly a couple of times so far but I’m absolutely loving it. It’s not fast by any stretch of the imagination but the steering is quick and precise, the brakes feel great (especially after driving modern over assisted cars), the gearchange is sweet and the raspy little exhaust puts a grin on your face when buzzing about with the roof down.

I think I’d forgotten what a pleasure driving could be.

I need to take a can of anthracite/dark grey paint to the naff looking red wheel centres and get hold of some cheap door speakers so I can listen to the radio, but that’s about it. New shocks and bushes would be a luxury but they can wait till next summer.

Pictures to follow soon no doubt.

Electric bicycle

07/06/2010 Posted by Jason Carvalho

If I’m honest, I’ve never really seen the point in electric bicycles until now. They’re not really quick enough to mix it up with other traffic, like you can on a scooter, and if you’re going to pootle along at 10-15mph on cycle paths then you may as well just pedal a normal bike and get some exercise in the process. Still, I was offered one for the weekend so I thought I’d give it a go.

Essentially it’s a regular town bike with a motor inside the front hub. The battery for the motor is where your bottle would usually sit (it’s about the same size) and the right hand handlebar grip doubles up as a throttle. There’s also a small control box sitting on the rear pannier rack and a bunch of wires connecting it all up. It still has front and rear mechs and shifters so can be pedaled like a regular bike without any assistance if you so wish.

Once on the go, it makes surprisingly rapid progress. The motor is limited to a maximum speed of 15mph which sounds slow but is actually plenty quick enough for buzzing about on cycle lanes and you can always use a bit of pedal power to boost that if you wish. I passed four other cyclists puffing away uphill on regular bikes on my 15 minute commute, like they were standing still. On the flat it’s up to speed in a few seconds, although there is a second of so of lag between twisting the throttle and the motor kicking in. On the uphills it struggles a little but will still get you up slowly without pedaling. However, it really only takes the lightest of effort on the pedals (imagine an exercise bike on low resistance) to assist the motor up hills without losing any speed at all.

I’ve now ridden the bike both to and from work and in both directions it took pretty much exactly the same amount of time to do the door to door journey of around 3 or 4 miles as it does in the car. Milton Keynes has an excellent network of cycle and foot paths that mean I can do the journey without touching any roads, however I’d feel fine riding this on the road through town in 30mph zones. Anything more than that and a scooter becomes more appropriate. Range is supposedly around 25 miles, but the battery unclips easily and can be recharged at your desk in a few hours. I believe this model had a 250W motor although there are bikes available with over double that power which would be better suited to hilly locations.

The two barriers for me that make riding to work difficult are secure storage and shower/changing facilities at work. The electric bike doesn’t solve the secure storage issue but does mean you can ride into work in a shirt and smart trousers without needing to shower or change when you get in, which is a big plus point over a regular bike. I don’t really have a need for one at the moment but if I had a commute of up to about 10 miles each way then I would seriously consider one of these as my daily transport. Bought through one of the employee tax free cycle schemes, it would work out pretty cheap. No road tax or insurance to pay and a daily charge only costs a few pence of electricity (I’m led to believe that it’s less than 10p).

Career change

17/05/2010 Posted by Jason Carvalho


A lot has happened since January. In February my employer announced a restructure, with some inevitable redundancies. At the end of March my time at Cranfield University came to an end, after nearly eleven years. During that time I gradually moved from IT to marketing, working as a sys admin, then web application developer and finally as online marketing manager, qualifying with the Chartered Instistute of Marketing only a couple of months ago.

Time for a change now though and a chance to pursue something that’s been on my mind for a few years. In September I begin my PGCE year to train to become a secondary maths teacher. Time to start revising my calculus.

Trail centre – Cwmcarn

28/01/2010 Posted by Jason Carvalho

My new year resolution of visiting some of the mountain bike trail centres around the UK is progressing nicely, last Sunday I took a drive over to South Wales to ride the Twrch trail at CwmCarn. It’s only a 30 minute drive past the Severn Bridge, so dead easy to get to for those living in the south and close enough for me to drive there and back in a day. Bar a few hundred metres of wider fire road, the Twrch trail is 18km of excellent windy singletrack. It starts with a pretty hefty climb that took about an hour with a few stops to take photos and catch breath. It’s an interesting climb though, winding alongside a river then zig zagging up the hill with plenty of roots and rock steps to keep you occupied. At the top is a freeride area with tabletops and berms aplenty, followed by about 45 minutes of mostly downhill or flat singletrack back to the carpark. The last couple of minutes of descent in particular is very smooth, very swoopy and very fast, which puts you on a nice adrenalin high when you come to a halt back at the car. Just time to grab sandwich and a drink before heading out for a second lap…
Definitely worth the effort for a visit, although next time I have a spare Sunday I might try Afan which is another half an hour or so along the M4 and has a wider selection of trails.

Bike skills coaching session

25/01/2010 Posted by Jason Carvalho

I attended a mountain bike coaching session last Friday with Tony Doyle of UK Bike Skills. The day was bought for me as a Christmas present last month and I’d been waiting for the date to come around with some anticipation. I’d heard good things about Tony’s courses but was also a tiny bit sceptical about what there was left to learn having been mountain biking for 20+ years.

I’m happy to say that any negative thoughts instantly evaporated once we got underway. Turns out there is plenty to learn and I picked up more in 5 hours on Friday than I have done in years. Particular focuses for me were cornering, smoothness through complex series of sections and a fear of my wheels leaving the ground. By the end of the day I was clearing tabletops, handling small drops with ease and flying through berms at what previously would have felt like impossible speeds. Swoopy singletrack is now more fun than it’s ever been.
Big thumbs up to Tony and UK Bike Skills.