 So, to not further cut into your presentation time, please welcome with a very warm round of applause Dan and Laura and car hacking back to the future 1917 style part two. So is this on now? Hello. Cool. Hello. Hi everyone, welcome to car hacking back to the future in 1970 style part two. I'm Dan Smith and this is Laura Hyatt. Today I'm going to be talking about my continued journey on what I've been doing for the last couple years since I was here two years ago, last EMF. So a little bit about me, I first attended EMF in 2014. I spoke at last EMF, which was the previous talk to this one. I'm an engineer working in automotive security and you know, I have a bit of a mixed background it wasn't until quite recently that I actually discovered that I am an engineer now at heart and you know, I have a background in computer science and also cars and a few other things. And yeah, so for those of you that didn't attend the previous talk, I'll just quickly go over, give you some context of what I've actually been working on. So otherwise it's not really going to make much sense. So this is the car that I pretty much have worked on the last four years like solidly. It's a 1974 Ford Escort Mark I. It's my first car. I've owned it for over 10 years now. It's still rocking the original 1.3 Ford Kent Crossflow engine. You know, some of the things I've done to it over the years, it started off with the three-speed automatic gearbox and then it was converted to a four-speed manual and to make it a bit more fuel-friendly, it's now got a five-speed manual in it and it's mostly still looks pretty stock and it's got like a stock interior. It's just, you know, just an old car really. And slowly over the years I've added things to it. You know, the first thing that I did really was convert it over to fuel injection. So this is my original setup that I made a few years ago, four or five years ago. It was a single-point injection, so there's one injector that serves all four cylinders and I added a turbo to it. It's running seven PSI boost, it's running a mega-square three ECU and it made about 120 horsepower with about 130 pounder torque and yeah, you know, it's a fairly nippy car for that amount of power in a car that small and doesn't weigh much. And it was nippy up until the point where it effectively melted a little bit, a couple of the pistons, so yeah, it's been off the road a few years now. This is the mega-square ECU. It's the main computer responsible for controlling the engine, controls all of the fuel, does all the calculations for the air and it controls the ignition coils. You can buy it preassembled or as a kit. I bought it as a kit, came from the US, soldered it together, did a lot of bench testing, got it working, got it in the car, started the car, pretty good. It's a fairly steepish learning curve to kind of get your head around it, but once you know a little bit about cars and a little bit about embedded electronics, it's not too bad and it's a very capable ECU if you're willing to put the time in to learn it and it's quite cheap as well for what it is. So kind of that summarizes the previous talk, like all the things I did previously and then in the last couple years, this is kind of what I'd done on the engine side. So I've gone from the single-point injection over to multi-point, which has been an interesting journey. So now there's four injectors for each of the cylinders like you would find on a modern car and it's also got an electric radiator fan. So the fan can be turned on at will by any time by the ECU when it needs it. So that's quite handy on a cold day during the winter when previously you start the car and the fan immediately would come on and start cooling the engine because it's directly belt driven. Well, now it doesn't come on until it needs. Saves a bit of power, engine warms up faster, all's good. It's also got like electric water pump, which again is PWM controlled by the ECU directly so the ECU can make the decisions if it wants to speed or slow down the water pump. It's got boost controller so it can dynamically change the power if the turbo is output in when you're driving, which is good because you can dial the power down when it's in the wet, when you're on the motorway, when you're overtaken because you get wheel spin quite easily and there's no traction or anything. It's also just got like an extra few sensors just to make the drivability a bit better. It's got a MAF sensor, which is similar to what you find on the modern engine today. It's got an IAC control valve, which again just makes it a bit easier starting on the cold day. I'm currently working on putting the clutch switch in it so you can have launch control like for Aries and stuff and it's got lots of extra sensors dotted around the engine bay because last time when the engine kind of went kaput, I didn't have enough data, I didn't have enough sensors which kind of indicated where the problem was coming from. So I've added them in this time and they're all there and all that information is overcan so you can do a lot with it. But the other things that I've been working on, I've mainly been fabricating parts a lot for the last couple of years and the big game changer for me, I'm on the right slide, yeah the big game changer for me was I've been using 3D printers for a while but it wasn't until about 18 months ago or so that I actually got one at home and as soon as I got one it just changed how I worked all together and I was no longer having to spend like so much time fabricating parts out of aluminium and steel, it was more time was focused on actually designing the parts and perfecting that design and then once it was right it was just clicking the button print and off you go. So I've been using that for lots of different things in the car which we'll cover now and so originally I just started using it to prototype parts that go in the engine bay like brackets and holders and clips and things like that nothing that you know I might use it I might not use it if it breaks it doesn't matter and I quickly moved on to to do in larger parts so in the photos there everything that you can see in red has been 3D printed and the main the main part that you can see is the intake manifold and part of the turbo plenum and that's all been designed using Fusion 360 and the reason why I designed it was because those parts that I need are not available off the shelf for that engine so I'd have to make it myself if I pay someone else to design it and make it that costs a lot of money so I designed it myself using Fusion 360 the measurements were taken using measurements from some of the original Ford manifold and then adapted to suit my design so it's mated to a Cosworth YB turbo plenum and yeah the ability using the 3D printer to iterate through the design very quickly and test out new ideas was greatly beneficial and ultimately and the model that I designed that I put so many hours in I was actually able to send over to a fabricator and they were able to use the same model to make what I designed out of aluminium so the bits that were read in the previous slide they're there now but they're made out of metal aluminium and the design is literally exactly the same as the 3D printed model that I made the reason why I didn't use the 3D printed model is because it might work for like two minutes but you know plastic bolted directly to a hot engine with you know pressurized air going through it probably isn't a good thing to do and yeah so ignore the engine in that photo that's just a scrap engine we I just put that in there just because the engine that I blew up I took out I put that one in just so I can and just so I had something for reference points because I've got to make a new wiring harness so just so I just put it in just so I can get all the wires perfectly to length I kind of then moved on to actually trying to use the 3D printer to make a functional part that would actually be used in the engine when the car's running so the part that I made there is an adapter that goes in between the the Gen-V throttle body which is 48 mil diameter bore to a Cosworth YB throttle body which is 55 mil and this part will be under pressure it won't have any fuel or anything near it but it will be under it will be under pressure it'll be very close proximity to the engine lots of heat lots of vibration you know external weather all sorts of nasty things and it's also got to be sealed on both sides so it's got to be ideally perfectly flat and with like an o-ring on the one side to stop any boost leaks otherwise you're just throwing power away and it's also got to have some bolts threaded into it because the actual Gen-V throttle body has got a mount to it and it's got to be held and I haven't done the final version yet but the final version will be printed using carbon fiber X carbon X filament which I think is from the States and that's carbon fiber reinforced nylon that supposedly passes the PA66 spec which is commonly used for plastics in the engine bay so I don't know if it might last it's it's a it's a simple enough part I can always carry one in the engine in the car with me if it ever went and I can change it on the side of the road or I could just get it machined out of aluminium and but you know it's I kind of want to try doing a functional part and 3d printing the plenum or an intake was that's just too risky but this part simple enough that you know it's I might as well try and see what happens and I know people have done 3d printed parts with naturally aspirated engines but I've not really seen anyone do anything on the turbo so I thought why not I might as well try and the part there you get so that's the design on the left just for reference and then on the photo on the right and it's just behind the throttle body it's the slightly dark gray you can kind of see it so yeah but that's got to be that that's in PLA at the moment just for prototyping just because it's cheap but that's going to be in carbon fiber so I don't know see how that goes and other things I've worked on 3d printing this is actually been quite useful and I've actually used it to reproduce proprietary Ford connectors that were manufactured long time ago in the 70s you know that you just can't get anymore the main connector the most interesting one is the main engine firewall connector which is a sealed unit and it's made out of some kind of rubber when Ford made it and it came from the factory when they stamped it together if used can't get it apart it looks kind of looks fairly watertight so if you kind of go in there and start cutting it up you know you're probably gonna like reduce the reliability of that section of the harness and it's considering it's the main one is probably not a good thing to do so I got my calipers out measured it all over and started putting together a design of my own and it actually worked out pretty well it's printed using a partially flexible filament again from the States by a company called Ninja Tech using the cheetah filament it's a very very strong even though it's flexible it's resistant supposedly to oil and fuel and it's got a fairly high strength rating and yeah I'm actually able to reproduce some of these connectors that you just can't get anymore and that's very very handy and I've actually sold a few of those because there are people that are interested in and you can't get them and so the other thing that I have been working on as well which I previously talked about in my previous talk is the digital cluster that I built and so this is how it looks today literally I took that photo today I bought it here with me and it's still very much a prototype but I have sunk a lot of hours into it and it's definitely been an interesting project to learn and work on both hardware prototype and you know designing fabricating and a lot of software as well and so it's running a Raspberry Pi 3 every time they release a new version I just take the old one out put the new one in and get a little bit faster performance it's got it's got a couple stacked Raspberry Pi shields on it the first one is again off the shelf product sleepy pie to that's the power management board effectively it maintains a state machine the current state of the vehicle ignition so it knows when the ignitions turned on or off when it's on it effectively turns the Raspberry Pi on starts booting it up and again when the ignition state has been lost after 10 seconds it starts a clean shutdown and that can be turned on independently you know if the power management decides it can it wants to turn on it can turn it on the rest of the car can be turned off so you know if you wanted to remote into the car and start it up or something like that that that makes that possible and the other shield is the pike and to and that enables the Raspberry Pi to communicate with the Megasquare ECU via canvas and so you can display whatever you want from the Megasquare on the screen RPM speed all the sensors da da da da da and the other bit that I've also added I've just budget in some perfboard and that allows me to accept some of the more analog vehicle signals and inputs so from from the indicators and you know the alternator and the main beam and that allows me to show the graphic upon the screen as with the original cluster and the software it's it's pretty custom but again it's kind of simple once you got your head around it I'm using a toolchain called build route to build a customized image of Lennox it's running a fairly recent kernel and they release updates about every quarter so every quarter you you know you get slightly newer kernel a bit newer firmware for the Raspberry Pi which is cool and they also do an LTS release which I'm currently using and the GUI components for the cluster what you see is made up of Qt5 Qt and Pi Qt I use Pi Qt just for prototyping and the boot time at the moment from totally off to totally on working is about five seconds and I haven't spent much time trying to optimize it so I'm sure you can get that down if you really wanted to and getting rid of Pi Qt and going over straight to native C++ would definitely help that and the power management state machine all that that's wrote in C++ and it's kind of cool it's all linked into GitLab I have runners at home so you know anytime I make a change it automatically kicks off a build and you know an hour later I have a finished image that I just flashed straight onto the Pi and it's really cool build route is awesome I really like it and you know for those that haven't used it and have Raspberry Pi and don't want to use Raspbian or they want to try something their own and get it their hands in a bit more one they want to get a bit more dirty but you know without kind of going full-on you know Linux from scratch Raspberry Pi Edition those are the commands that you need literally to get a custom Linux running built using build route it's very very simple yeah once once those commands have ran after an hour just flash it using something like Etcher and the documentation that they have is very very good it's pretty easy to understand once you've you know started tinkering around a little bit so I built this dash it you know it functions fine as a prototype I kind of wanted to test it more than just on the bench on the bench everything worked fine but in the real world I know obviously there's unexpected problems that you run into and but the car that it was built for didn't have an engine that ran so I needed something to do so I just took my daily driver which is a Mondeo and I took a couple tools I had a contact and a panda and I just reverse engineered the can signals for the for the RPM and the speed and I then just went into my cluster code and just altered those couple IDs flashed it and bodged together a very crude model printed it and combined it with some hot glue and just shoved the dash in there and just bodged together like an OBD little connector that just plugs into the OBD port and I ran that for like two months daily my primary concern was at night it would be too bright and it wouldn't you wouldn't be able to have much visibility but everything worked out fine so when the engine eventually drops back into the car that'd be going in and there is actually audio but it's playing from here but yeah you can see it you can see it with Evan it's got no lag whatsoever it's it's really responsive and that's just the OBD down there and I think that's me done so that's kind of more the hands-on side the fabricate and the engine and the car and the electronics and the wiring but another bit that I wanted to do was actually start connecting the car online and that's where Laura comes in to talk about some basic telematics to remotely monitor and control the car so yeah that's me so yeah I'm gonna be talking briefly about adbs greengrass and how I incorporated it into the car so to kind of give you a bit of context about basically why I'm here so I've kind of been on an adbs journey I guess this year so in January I got my cloud practitioner certification in May I did my solutions architect associate and then about three or four weeks ago I got the developer associate so really for the last year because I've been studying beforehand I've been learning about adbs and Dan wanted to basically connect the car online and so he was like why don't you get involved with it then and use the skills you've been learning adbs to help me out so this is why I'm here so I'm gonna briefly talk about greengrass now I'm sure many of you have used adbs but has anyone used adbs greengrass before okay that's good one person and that's good because I was worried that was gonna be preaching to the choir here but essentially greengrass is a service that allows you to run adbs compute functionality locally on connected devices so essentially you could run a lambda function you know in Python no JS whatever and run it locally on your Raspberry Pi now the reason why this is obviously good is that means you can connect to physical hardware so you can use your lambda function to trigger GPIO pins and so you can kind of see why this could be useful in a car for example so we obviously have used a Raspberry Pi to power functionality in the car so the adbs projects that we did so there were three that we wanted to do before this talk obviously we're gonna do some more following it but there was a limited amount of time now I just want to point out that two of them use greengrass and one of them doesn't want it works and it's absolutely fine it's just that it runs locally on a Pi because essentially greengrass runs in a sandbox and there are some limitations with that and I'm obviously gonna explain these in more details in a minute but just to give you a brief overview the remote engine start so this is my favorite it's the first one I did and essentially you can remotely start the car engine from anywhere in the world is basically how it works the GPS tracker was the next one that we did because obviously it's a classic car Dan has spent so long working on this I imagine if it was stolen it'd be devastated so we wanted a way to be able to track the car in real time in case it was stolen and then the final one was the car telematics using can and I would and brief the mention can this is the one that we didn't get working in greengrass for some reason and obviously we're gonna continue working on it we couldn't get the can Python module to work with greengrass but we do have it working locally in a normal Python script on the pie so okay let me explain the remote engine start so I'm gonna show you basically a brief video because obviously I don't have a car here to give a demonstration so this is a little video that I just filmed a couple weeks ago sorry the audio is not great I wrote that in Python and that turns on the relay board which is connected to the starter motor which then starts the car so let's have a go so yeah that was actually my first thing that I did so obviously it's a it's like my baby and I'm really really proud of it because like I said it's kind of I'm on this AWS journey at the moment so essentially like I kind of explained greengrass is installed locally on the pie and then obviously connected the GPIO pins to the relay board which is then connected to the starter motor and then basically I wrote just a really simple Python script on lambda essentially all it is is like an on off script it's about this big the lines of code and when it runs the lambda function is executed locally on the pie and that basically turns on the relay board which then starts the engine motor so actually a pretty simple concept but obviously it's quite a cool idea but then essentially to make it truly remote I connected I could basically configured an IoT button so I don't know if you obviously there's a little picture there I don't know if you've used one of these before it's essentially like the the dash but effectively I configured that so when the button was pressed it would execute the lambda function and what this kind of means is that I could have the button with me say in Australia and as long as I'm connected to the Wi-Fi or 4G and obviously the pie is turned on I could press that and the car could be in England and it would remotely start so it's kind of a cool thing so that's what we did first now with this one successful and we moved on to GPS tracker now got GPS receiver which is connected to the Raspberry Pi and basically again Greengrass installed on pie using GPS Python module wrote small bit code eventually outputs longitude and latitude coordinates of the car in I say real time wrote it that it does every five seconds because every second it kind of gets a bit crazy and you can't really read anything so that's what essentially that does and then I think it kind of mentioned the telematics using can whilst not using greengrass it obviously we've got that data so things like RPM now obviously all this data is great but it's kind of in its raw form you know you have longitude and latitude spitting out and if you know the car is stolen it's not exactly very useful just to see longitude coordinates moving you know they're changing if the cars move in and so we need some way to visualize this so this is where it lives on to freeboard now this is an open source bit of software that essentially its purpose is to visualize IOT data and this is running on any C2 instance they've got in my account and as you can see at the top well I've got time but then the GPS coordinates on now a Google map so this will update in real time and the pin will move as the car moves and actually what we did was I had my laptop on my lap with the Raspberry Pi plugged in and GPS receiver and we drove around our town and the pin was moving so it's great you know hopefully it doesn't get stolen but the car was stolen you'd be able to literally track it on a map and then as you can see below these are the car telematics so you've got like RPM for example and those little sliders again they update in real time so you put your foot down and the RPM moves literally the slider moves like this so it's a great way to sort of visualize your IOT data that kind of really like wraps things up that I've been doing obviously I'm going to be working on lots of other things in the future but I just I'd like to say that Greengrass is a great way to sort of bring AWS capabilities to sort of physical hardware so there's lots and lots of capabilities with this and you don't have to use on a car you can use other things you've you know turn on your lamps and stuff at home so I hope this is kind of like inspired you to use maybe check out AWS after AWS Greengrass after this and yeah I hope you've enjoyed the talk thank you thank you you almost did it in time perfect thank you very much so as we are pressed for time questions and answers you will do outside on the side of the tent if you're leaving please take a look around you and take