 This is mostly going to be of interest to people that have just assembled a simple bot. But if you're wanting to pursue this sort of thing outside of the Open Hardware conference, it could be interesting as well. So it'll just give you a bit of a kick start on how this simple robot platform works. Now there are, I just wanted to show you a few photos and give you a bit of background on how the simple bot project came about. It started off a couple of years ago with a project that ended up being called NodeBots. Now there are a number of related projects. The actual project originated with some demos that were being done at a JavaScript conference. I think it was called Boku, which is why it ended up following down this Node.js path. So there's always history and context in the way these things come about. And I know I've heard a few people saying, oh, JavaScript, why are we using that to run a robot? There are particular reasons that that came about. But you're certainly not bound to it. There are lots of options. But the way this came about was some demos that were being done showing bridging between the world of software, so JavaScript in this particular case, and physical environment. So physical computing represented in JavaScript. So over time, there was some helper software developed. There's a library called Johnny5 and a number of other related parts that go together to help build this very simple little software stack. So what you're looking at here is a thing called SumoBot Junior, which is a little laser-cut wood robot. And over the last couple of years at the conference, it's gone through a number of iterations of design. Sorry, at the JavaScript conference, not here. And a member of the Melbourne Hacker Space called Andrew Fisher has been over to the robots conf the last couple of years and got excited about this. And he wanted to be able to do some node bots days, taking school kids or hobbyists, anybody that was interested in Melbourne, and bring them together, have them assemble a robot very quickly and easily and give them a head start on something that they could then play around with themselves. And he liked this design, but the problem is that it was a little bit expensive and slow to iterate on it because it's laser-cut timber, and there is a laser cutter at the Melbourne Hacker Space, but it's fairly low power. And so what he wanted to do was come up with a design that was derivative of this, but using core flute as the material, which is why we've ended up with the design like this one here. So these can be made super cheaply. The core flute that it was cut from, we just bought at Bunnings in sheets that were 600 by 900 mil, so they're like big sheets. I think it was about four or five dollars per sheet, and you can make a bunch of robots out of every sheet. So there's probably like 30 cents of material in making one of these. So what that means is that it's very cheap to build a bunch of them. Obviously there is cost in the electronics, but it means you can do things like iterate on the design, you can decide you want to change it, alter the design, cut a new base plate, rebuild it. So you can evolve the design of the robot over time for very minimal cost. So that was the reason that this design ended up this way. So in terms of the software environment, no, I don't want to know what's new in Keynote. So we'll just run through a sequence that'll help you understand how the different parts fit together. So we've got our robot, which is a nice clean slate to build on. And we've got some continuous turn servos for movement and cable tie at the back for it to sit on, ultrasonic range finder on the front. So this is the basic physical structure. And then we chuck an Arduino on it. So what I'm going to show you here is really the architecture of the way a traditional node bot's robot works. And then we'll work from there into how a simple bot varies from that. So what you have is an Arduino which provides you with some IO. This allows you to control the servos, read from the sensors. And if you have some firmware which is running on your Arduino, this is really all you need to make something that's quite simple that will detect something in front of it and back up, go off in a different direction or do whatever you want to do. So in the simplest form, this is really all you need to make a nice little robot. So you have some firmware on there. So in this particular case, in the case of node bots, it's using some firmware called Firmata. Who's familiar with Firmata? A couple of you. Okay. So what Firmata does is it's a... Firmata is really a protocol with a couple of reference implementations. So Firmata is a communications protocol based on MIDI. And it is generally transported over a serial communications link. So the Firmata protocol exposes the interface in here so that you can request data from it. You can send commands to it. And the actual transport could be over like just TTL Serial, could be USB Serial, so you could have a bot with the USB cable plugged into it. And as long as you have something at the other end that talks the Firmata protocol, you can then use the bot as your slave. So it acts as a physical breakout to whatever is at the other end of that. Now it's pretty common to use something like ZigBee Serial or Bluetooth Serial so that you can have the bot operating as a dumb slave and you're just communicating with it over Bluetooth. So at the other end, you can write whatever program you like. These are some of the languages that have got bindings already for Firmata. There are a bunch there including Wolfram System Modeler and some strange ones. So there should be something in there that you can find that is an environment that you're comfortable with. So you're not limited to just JavaScript. There are a whole lot of different things. As long as you can talk Firmata, then you can talk to the bot. So in the case of a classic no-bots environment, we've got a laptop and then you have a program which is running on the laptop which could be written in one of those languages, which is communicating with it. So the logic of whatever the robot is doing is actually residing in the laptop. It's not on the robot. The robot is really just a dumb slave that is doing whatever you tell it to do and reporting data back. In the case of no-bots, the program is written using no.js and using a library called Johnny5. So Johnny5 provides things like the Firmata support. And what this means is that you can have a no.js program running on the laptop or whatever it is, which is quite simple and a whole lot of the plumbing is taken care of for you. So this gives a very easy entry point to being able to write simple programs that will then control the robot. So what we've done in the case of simple bot, you'll notice that a lot of the robots are doing things on their own. They're not requiring the logic to be running on the laptop. What we did was take the logic, or the part of the software stack that normally resides on the laptop and we've moved that into the bot itself running on the Raspberry Pi. And then it just links using direct serial connection. So there is a serial link between the Raspberry Pi and the Pi 11, which is the Arduino compatible board that Angus designed that is sitting on top of it. The two are just stacked together. So whatever software that you have running on the Raspberry Pi can communicate using Firmata to the Arduino, which in turn handles all of the IO. So it makes it a self-enclosed, like an encapsulated robot platform. So then simply by SSH'ing into the Raspberry Pi from your laptop, you can edit whatever you want to run on there. You can write new examples and things and make it do whatever you like. So that is basically as simple as it is. There's really not all that much more to it. What I would like to see after this, what we've done really is provide you with a platform which gives you the basic architecture and we've given you three examples and they don't even exercise all of the functionality of the hardware. But this is a conference of software geeks. So hopefully by the end of the conference we'll have a few more examples and incorporate some behavior based on things like sensor input. So one of the examples that we've provided is the ping example which reads the distance from the ultrasonic rangefinder and it just spits back the values in inches and centimetres. We've also got the simple bot example which just lets you drive it around with the arrow keys. But those two are totally independent examples and there's also another example for flashing the LEDs. We don't have an example at the moment for the light dependent resistor but that could be added and of course you can add other sensors and things as well. So the next stage, this is where you guys come in, is to combine some of those things. So what I'd like to see is reading from the rangefinder. If it gets below 10 centimetres then stop the motors back up and go off in a different direction. So start integrating some of those things and come up with some semi-autonomous behavior for the bot. So basically log in, poke around. Oh, right, yes, we need Wi-Fi. Yeah, maybe we should bring up the other. Yeah, okay, cool. All right, and there is the openhardwarecon.org wiki as well. So please if you make improvements on the design or work on the code or whatever, feel free to create an account or request an account on that, add pages and things yourself. So, and I'd just like to say thank you to everybody that's taken part in the assembly session this morning. That was a lot of fun to watch all the robots come to life. It was quite a buzz moment. As each one starts up and the owner goes, it's alive. That was really cool. So thanks for that. So that's all I've got in terms of the overview of the software. I don't think there's a lot of point going into the details right now of things like the examples because they're reasonably self-explanatory. And I expect that a lot of you will probably want to ditch the node side of things anyway and simply come up with something else that talks Firmata or even replace the firmware on the Pi 11. So I'd like to see what you guys come up with. So thank you. Next up, we're going to have Angus doing a quick demo of some KiCAD development. So do you want to explain what it is or shall I introduce you? Okay, cool. So we'll just give it, take us a minute to swap this over. Yeah, you just need BGA. Oh, you'll need the, oh, sorry. Yeah, I noticed that the case was a little bit bent. Do I have it on? It might have connected by now, it's kind of in there. Yeah, I noticed that when it goes in, I used to have to mention something about the XO. Also, if anyone has ideas for Lightning Talks that they'd like to cover right at the end of the day, that would be really cool. Right, do you have one? Yeah, cool. So we've got a few already, but we can certainly have more. So I had two things that I wanted to talk about in only 20 minutes to talk about them. So this is going to be a bit of a mash-up of two talks into one short amount of time space. I wanted to talk about the Simple Bot Shield, which is the very topmost layer of the Simple Bot that got built today. In the previous Simple Bot incarnations, they've always built it using a breadboard, so to make the point-to-point connections for the servo, connections for the inputs and things like that. But we decided for this one, because we wanted it to be as compact as possible, to have a shield that sort of drops on top and makes all the connections. And then there was some soldering as well. So the shield is relatively simple, actually, because mostly it's just connecting one pin to another pin on a few different places. It's just got the power supply as the remaining thing to supply six volts for the servo. So I wanted to talk a little bit about that, but I also wanted to use that as an interesting kind of jumping-off point to talk a little bit about KiCAD, which is the open-source PCB design software that I used for this and that I've used for some other projects. And to show off very quickly some of the features of that for people who might have thought about trying it out. I might have tried it out a couple of years ago and interested in the way that it's changed. So by way of motivation to that, a little bit about me. I'm not an electrical engineer. I did exactly one electronics-related subject at uni in first year, and I don't think I remember any of that. But after being a programmer for a while and thinking around with electronics, two and a half years ago, I made my very first PCB using KiCAD. That's the design there. It's a breakout for a connector on the back of this little handheld computer called the Zippit. This board never worked and cannot possibly work. The connector is backwards. The pins that are connected to ground are therefore the wrong pins and there are some power pins connected together and other things. So the USB is backwards. And as a bonus, if you actually plug this in, then the extra bit of the PCB on the end there blocks the power jack for the DC in for the Zippit so you can't power the Zippit. So this board is a failure in every possible way that you can fail to make a PCB. But it was still a formative experience and I did still enjoy it and there's something really neat about seeing something on a screen and then, I mean, I wasn't etching them myself, but then you get a nice little made PCB back from your PCB fabricator and you see what you've created. So I actually kept iterating on this like about a year and a half later. This is the same idea in a very different form factor. The connectors have all moved around. The connector for the Zippit that was on the bottom is actually on the other side of the board. There's a power supply and some other bits and pieces that have gone on there. This still doesn't 100% work. It's kind of a backburner project. I might pick it up again at some point. But at the same time that I was doing this, I was kind of learning more Kaikai and getting better at doing hardware design by myself and then with Freetronics after that. So I've done some more complicated boards in the interim time. This is a bit of the Freetronics Ether Duo which is a four-layer design with power planes, lots of components, lots of connections. But I'm pleased to say the only problem we've had with the production run of these turned out to be an Arata issue with one of the chips that wasn't described. So I can't blame the board designer for that one, which is good. Like another fancy design that I'm pretty proud of is this is still a work in progress, but it's an adapter board for the Kosage Naveena, the open-source laptop, to connect it out to the iPad 3 Retina display. So my point in showing those is not to say, look how clever I am. It's rather the exact opposite that by being persistent and kind of iterating on things even though my original designs were terrible and never worked, let alone having sort of lacking finesse, you can get better at this stuff. And I've still got a long way to go, but you know, practicing it is worthwhile. It's extremely discouraging using the tools for PCB creation. None of them are easy to learn. None of them are user-friendly, really. They're all very powerful, but they take a good while to get used to. And because it's hard where you don't fail instantly, you fail later on when you've built the prototype and you've found out what's wrong. So all of these things take persistence, but once you get past these parts, they're also very rewarding because it's really neat to actually hold something in your hand that works, that you dreamt up and designed, especially coming from a software background where usually it's just on a screen. So yeah, I would say as motivation, this is why I think I would encourage everybody here to have a go at designing a circuit board, a simple one or a complicated one, or start with a simple one and learn a little bit about the technology involved. So to get back to Qicad, I was going to give a bit of a tour of Qicad as a tool for this because I think it's an excellent choice, both because it's open source and because it's gotten a lot better in the last few years. It's developing at a very rapid rate, which is more rapid than any of its competitors, I guess you would say. I was going to actually try to, in 20 minutes, design a good chunk of the simple bot shield from scratch, like start from a bare template board and make a schematic and make a board and see how far we could go. I did a couple of dry runs that took about 30 minutes each time, so I've only got about 15 minutes now. So instead, I'm just going to give you a tour of the existing simple bot design. So this is the main Qicad window. Does that squeeze on there all right? Yeah. This is the main project view that you get in Qicad. Qicad just treats a directory as a project, so you actually see all the files here, even though this one's a PDF, for example, so it's not actually part of Qicad. There's a few things that I've included in here, like this library directory, which isn't mandatory part of the project, but it contains the Freetronics Qicad libraries that we've published. Qicad has its own built-in libraries, but a lot of the time there's parts you don't want or there's things you want to change, so you make your own parts. We've published the ones that we've done for Freetronics, and there are lots of other libraries out there as well, but you do end up creating your own stuff almost inevitably when you work on these things. So from the rest of the files, we'll start with the schematic. I'll get my trackpad to double-click. There we go. So this is the logical description of how things go together. Has everybody here seen a schematic before, to some level? So it shows where the wires of the electrical connections are joined together. So I'll take you on a quick tour around the side. We've got a single Arduino footprint kind of component. Qicad calls them a symbol. You could just do the individual headers as individual things, but because particularly Freetronics makes a lot of Arduino shields, we've just got a sort of single one that you can put together. And you've got wiring to join all the parts together, so say the reset pins connected to this button, which is the reset switch that you placed, which connects to ground. Where you don't have the direct wires, a lot of the time we've got labels. So, for example, the analog pins are labeled A0, A1, A2, A3. This means anything else with the same label or the same net name as it's called, are joined together. So the concept for schematics is the net, which is that any group of pins that are joined together are on the same net. So here we've got the reset pin and these two pins on the button here. And those are one single net. So anything with the A0 label on it here will belong to the A0 net and so on around the outside. That's the two fundamental ways in any schematic to join things together. One of the things you sometimes see, especially with beginner schematics, is that people will try to wire everything using direct wires. And nearly all of the time this results in like a big spaghetti mess of schematic. Whereas really the schematic is for you and kind of like code is for people to read and only secondarily for machines to execute. The schematic is for you and anybody who looks at your electronic design to understand how things are joined together. So if this looks like a ball of mess of wires, it's the equivalent of spaghetti code. You want it to sort of tell a story and be able to sort of understand where the blocks are, how they're joined together, where the interfaces are. It's quite interesting looking at, especially really complicated schematics. If you get the chance for things like mobile phones, they're nearly all labels. There's very, very few lines because that is so complicated that the components have to be joined together using labels. So if we go around, we can see we've got the servo headers on the board. So the two of those that you soldered today and the other ones that are still left, they're all connected to different digital pins, power and ground. These labels here are power labels. If I zoom in on one, you can see that it says plus six volts and that one over there is plus five volts. These are basically the same as these labels, but they're another way of like giving the human indication that you're going to create a connection to a power connection rather than something else arbitrary. So we can see here, this is our little linear regulator power supply with the two capacitors that we soldered. And it's got the plus, the V in power on one side and six volts on the other side. So we could replace these like we can go in and make this a label that says six volts instead. And I could just delete that and then go around and change all of the six volts to be this label instead of the other label. And it'd be the same schematic, but it's easier for people who understand how to read the schematic to see the power points as power points. Further down here, we've got the WS2012s. These are those LEDs on there and they're daisy chained together. So we've got the data signal coming in from pin D6. So digital pin six goes into the first one and so on and so forth and the power connections around those. So that's essentially the schematic. Usually this one's been finessed a little bit with lots of labels and things because we wanted to make it easy for people who want to look at it as a PDF or to pick up the Kaikai file if you're messing around with your simple bot to see how they go together. So there's lots of little sections that are all labeled. By the time you're sort of done labeling and sort of setting up your schematic, what you usually do is run an electrical rules check. So if I delete one of these connections here, say like an old one, so this now is not on any net. Like if that pin's just sitting there by itself and then I run this check to see that everything's okay which is this bug with the tick on it. And the first arrow I get is pin not connected and no connect symbol found on this pin and the pin number's there. And if I double click it takes my little cursor it takes that marker there to exactly where this has gone wrong. So like Kaikai will check that everything is connected to somewhere and will warn you if things aren't connected up. So I can either put the label back on that or say if I'm like, wow, I don't really want this pin anymore. I can use this X which is the no connect symbol to say. Actually, I don't care. Just leave that disconnected. Now if I rerun the ERC, that goes away. There's a whole lot more of these arrows here you'll see. This is a problem with not having a lot of screen real estate. Usually I've got big monitors. But these are actually that the grounds are connected together and Kaikai kind of tracks the kind of pins that you have in your design. Like it knows you tell it these are power sources. These are places where you have to put power. If there's a power input that doesn't have a power input output driving it, then it knows that there's no power getting there and that's an ERC failure as well. It also doesn't normally doesn't like power outs connected to power outs. In this case it doesn't matter because it's just two ground pins connected together. If you're sure about this you can actually go and adjust the rules here which say what may connect to what. So power output here to power output here was an error and I can say no, no error. That's fine. Now if I rerun my test. And this is actually telling me the same error on this end because I've got this pin that was A1. There's no other A1s in my design anymore. So I've got to put a no connect there as well. Okay, so that is usually... I mean the ERC will not tell you if your circuit is correct but it will tell you if there's anything glaringly wrong with the circuit. So normally now if I was designing this to begin with there'd be a bit of a review stage where you look at it and you see what's going on. The next concept is to generate this thing called a netlist which is like a text file that just represents the connections that are in the schematic because the tool doesn't really care what your schematic looks like. It just cares what pin is connected to what. So I just saved the netlist file there and that's just a list of rules that say pin AD0 or pin AD1 on this component is connected to the other pin that's marked with an A1 down here or A2 or whatever. Yeah, I just connected that one. Now Kycat at this stage has an extra step. Now we've sort of completed our schematic style. We're going to make our board. Kycat has a thing that annoys a lot of people who are coming from other EDA tools. Which is that it has this additional step where you've got all your components and you've got to actually tell it what footprint the component attaches to. So here we've got C1 as a capacitor. If I go back to the window with the schematic in it you can see C1 is like this guy here or one of these. C1, C2. You've got to actually tell it what kind of component it is. This is not enough resolution to really do this but the association is that this is 0603 which is a size of surface mount component. You kind of have to fish through your libraries and say here's 0603 size for example and you can do a little preview of what it's going to look like and say okay, that's what I want. You have to go through and do this for every component. Some people really hate this. I find once you get used to it it's not the worst thing and it does allow you to choose. If you want to change the sizes of your design or something you can do that without touching the schematic or anything in the schematic and things don't have to be associated with particular types of components. So there's the LED footprint for example. So when this comes up normally it's blank. This one's already been filled in. So this will say C1, 100 nanofarad. That comes from the schematic and then this is what footprint are we going to use for that and choose that over here. So say if I want to make OO5s instead. Normally in most ETA tools these are bound up in the same concept. You've got to assign it at the time that you sort of put the thing on your schematic. Here it's in this separate tool. It's the main difference. And there's a list of the libraries that are loaded into QI-CAD. So FT is AFRI tronics library. But there's also tons and tons of other ones that are built in. So say if I wanted a different SMD package these are the SMD packages that are built into QI-CAD so if you want a through-hole capacitor like the capacitors we used there's a capacitors through-hole package. What sort of differences are there between the sort of free tronics in QI-CAD? I don't know at the moment. The QI-CAD ones have been improving a lot over the last year or so. What's the example of ways to be different from QI-CAD? Early on for SMD in particular one of the obvious differences is actually just the silk screen pattern around the outside on the board like the labelling of where it goes. There are different sizes of pad for a standard size so the IPC standards for this kind of thing give three different ways like for a given size that the pad can be depending on how you're going to solder it. So for hand soldering you usually go with a slightly bigger pad so you've got a bit of room to get in there with machine soldering you go for the really minimal pad and there's one in the middle that's kind of best of both worlds. So the free tronics ones are usually best of both world sizes. The ones that are built into QI-CAD used to be a bit all over the shop but I think they've really cleaned them up basically in the last sort of year or so so I'd look at them again but I haven't because we've already got footprints that we're happy with. But say if I was going to use a three-hole capacitor there's like tons of sizes so you just measure the capacity you've got and try to find a footprint that's like it in terms of the dimensions. So after you're sort of done running through this process which is quite painstaking but it's not as bad as it looks when you see it like this you're ready to actually start your board and this is the board editor here I've run out of time to talk about the board editor and this is actually the most interesting part. So the board editor is where you actually load in all those files that you've just created and you can lay out your parts so you've got a grid usually to base it on pick up your components these are already routed but we can still move them around. The layers you see here are all described over here so we've got the front copper layer that I'm blinking that's got the copper tracks that go on the front the back copper layer the silk screen label layers just have text on them and you can sort of pick up like this is already all routed so the connections are made but you can pick up make the grid a bit smaller and you can kind of pick up a point and if I wanted to re-route it in some way I can do that. Usually re-routing is actually really good in Cockhead but today it's not should have already deleted that edge but I must have set something wrong at some point. No. The D9, D8 trace? No. So here it's got to go a long way around if it's not going to join this bank that goes up to here it'll have to go up the top here. Yeah, there's no good reason for that. Well done. We can probably fix that a bit. I think there's a setting for that normally and this is one of the nicest things about Cockhead most of the time it'll delete the old trace when you re-route something. We can go and fix that. Yeah, no there's no reason why it sits down on the top. You're running the P5 here let's say using copper layers the P5 is here. That's actually a comment file. So let's not push it on the board. No, you can make it on the board that's the designator part. In this board we're not actually printing any of the designator. All of this text is just added as a raw text so we can probably pick that up and move it around but there we go. I just pressed M for move it around. So one of the other things about Cockhead is that it's got reasonably good shortcuts but if you right click on anything you can find all of the shortcuts next to the tools. So if I say footprint move that's the whole footprint but I can pick up the reference for it as well and move that around. So I think I wanted to show a few of the other board writing features and some of the new stuff. I'll show it really, really quickly. This is the alternative view that CERN has been developing for Cockhead and this has the really fancy pants features. So if I try and route on this it has what's called push and shove routing. So I can set my router and say shove tracks and I can pick up say this and say drag this is why you don't do live demos folks there we go and I can move it automatically bump everything out of the way as much as it can to try and move things around or if you're routing a fresh trace say if I wanted to pick up off here pick up a new power trace from here this is a six volt connection it'll try and do its best to let me do it. You can make a mess really fast this way but when you've got a really big bank of traces and you want to say go through the middle like say if I wanted to put a wire in there and then put this on the bottom I mean it'll still make a mess but you can go back and clean that up and have a neat looking thing again in a lot less time than it takes to do it any other way right so the red one is the top so this is starting with the bottom so why was it moving the green traces out of the way when you were picking up a wire? Oh yeah so I dropped a wire, no no it's my fault when I was walking through so I dropped a wire there and it takes it to the bottom and now we're on the bottom and there's another there's an intermediate mode where it just highlights the traces that you're bumping up against which is not too bad either yeah this is the time where because the board is routed it's a bit hard I guess I could delete something and re-route it but I think we're out of time anyhow so yeah thanks I guess if anyone has any questions about Kaikad now's not a good time but come and find me and ask