[00:16.810 --> 00:19.790] I'll be presenting today the design of a wireless EMG system. [00:20.490 --> 00:27.270] Prior to building this design, I actually had very little experience in Eagle and basic SMD component. [00:27.410 --> 00:30.810] However, I learned a lot over the course of a year and a half that I've been working on this. [00:31.350 --> 00:41.710] It's still a work in progress, so if anyone's interested in designing code for it, I'm going to be releasing it open source so anyone can observe it and design whatever they'd like for it as well. [00:43.610 --> 00:44.410] There we go. [00:44.610 --> 00:45.390] Is this better? [00:46.390 --> 00:46.890] Cool. [00:49.090 --> 00:59.790] So this basic design started with a class I took in senior in my junior year in Union College, which was ECE 497, which was an ethics course. [01:00.050 --> 01:03.490] It was originally intended to be as an ethics course. [01:03.630 --> 01:06.310] However, it was also used to introduce us to senior projects. [01:06.470 --> 01:11.270] It was meant for us to do research on what we were interested in building or interested in creating. [01:11.270 --> 01:21.670] And I decided to get together with a group of my friends, Joshua Hernandez, Travis, and Connor O'Reilly to create a much larger senior project than one normally would take on by themselves. [01:22.790 --> 01:29.690] After doing multiple research, or rather, I'll give you a presentation outline of what I'll be presenting. [01:29.890 --> 01:41.250] There's three main parts to my presentation, which is going to be the hardware section on what I actually designed in terms of a wireless system, microcontroller applications, and power supply for the device. [01:41.710 --> 01:43.250] As well as USB connectivity. [01:44.030 --> 01:49.210] The software that I used, which is actually a modified code of the OpenBeacon software. [01:49.550 --> 01:51.930] So some of you I'm sure it seems familiar. [01:52.730 --> 01:59.090] And also the amplification stage that I designed, which is currently based on a prototype board. [01:59.250 --> 02:10.790] However, it along with the power supply for the amplification stage is able to fit inside of an Altoids tin, which would be possible to wear around the forearm, which was where our original device was intended to be worn. [02:12.110 --> 02:26.910] Our original plan was to separate the division of work between myself, Joshua, and Connor O'Reilly, and Travis O'Reilly working together, where they would be designing a wrist strap that has an electrode array, and would be able to pick up signals and differentiate which muscles of the fingers are moving. [02:28.050 --> 02:36.910] Joshua was in charge of designing a C source code that would be able to pick up the signals and analyze and determine which one was working and which one wasn't. [02:36.910 --> 02:42.950] However, due to various reasons, they dropped out, and I've been working on it myself since then. [02:44.630 --> 02:49.970] So there are particular influences for this design where we came across a couple of really interesting articles. [02:50.130 --> 02:54.250] The first is bi-directional human-machine interface via direct neural connection. [02:54.850 --> 03:00.790] In this article, written by Kevin Warwick, Gasson, Hutt, Goodhue, and Kibbert. [03:00.990 --> 03:03.890] This is published in the IEEE journal in 2002. [03:03.890 --> 03:14.750] They actually describe a 50 micron by 50 micron neural, well, electrode array which was implanted on top of the medial nerve in the forearm. [03:15.050 --> 03:27.870] This electrode array was able to receive the electromyogram signals that were sent to control the muscles and to tell them to move, and at the same time was able to send signals back and trick the brain into thinking that it has this sort of like sixth sense. [03:27.870 --> 03:39.990] It's able to receive signal that isn't actually there, and it's able to... he was able to determine that signal is not like part of his body and be able to like feel something that isn't actually there, which we all thought was really awesome. [03:39.990 --> 03:47.930] The second of the two papers is thought communication control. [03:48.410 --> 03:50.310] A first step to using radio telegraphy. [03:50.670 --> 04:03.410] This paper, it also uses this exact same setup where there was a big device mounted to Kevin Warwick's arm and the implant so that it wouldn't move around and it wouldn't cause damage when it was being pulled or whatnot. [04:03.410 --> 04:08.230] But in this talk, they describe how he was able to control a robotic hand over the Internet. [04:08.530 --> 04:16.490] He was located in New York and the robotic arm was in England, and depending on how his fingers were moving, he was able to move the robotic hand in the exact same fashion. [04:16.690 --> 04:21.270] At the same time, he was able to be able to... he was able to determine how hard he was holding something. [04:21.470 --> 04:26.950] So he was able to pick up an egg without actually breaking it, which is seen in that arm there. [04:27.730 --> 04:38.190] Another thing they were able to show with that particular setup is that his wife was able to get a simple implant of two electrodes across the medial nerve. [04:38.410 --> 04:41.710] And they were able to communicate using sort of a telepathy. [04:41.870 --> 04:49.610] They were able to move their fingers and the other person, the spouse would be able to sense these signals and they were able to send information back and forth. [04:49.890 --> 04:52.450] And this was actually achieved at a 98% accuracy. [04:52.450 --> 04:54.210] So, it worked quite well. [04:56.810 --> 04:59.290] So, an introduction to electromyograms. [04:59.430 --> 05:05.170] So, you may be wondering, an electromyogram is a device that is used to pick up the electric potential across a muscle. [05:06.090 --> 05:12.150] And amplify it so that a microcontroller or a person could observe it and use it for the control of something else. [05:12.450 --> 05:14.950] That chart shows a typical electromyogram signal. [05:15.250 --> 05:20.210] And if you look on the bottom, on the x-axis to time, you'll notice that it's actually long scale. [05:20.210 --> 05:22.670] So, all the frequencies involved in this are very small. [05:23.870 --> 05:26.090] Powerful microprocessors aren't really needed for this. [05:26.270 --> 05:30.230] You can observe an EMG signal using simple envelope detection. [05:30.970 --> 05:37.610] I use the microcontroller in my design to create the SPI interface to the NRF so I can be able to transmit these signals wirelessly. [05:37.790 --> 05:41.270] However, for digital signal processing, that's not actually a necessity. [05:43.870 --> 05:44.470] All right. [05:45.850 --> 05:49.030] First, I'll tell you about the typical electromyogram devices on the market. [05:49.610 --> 05:52.250] There aren't many electromyogram devices on the market. [05:52.430 --> 05:59.430] Like, the ones that do exist are either very large and you can't really use anywhere, or they're small but very, very expensive. [05:59.430 --> 06:10.690] The cheapest one I found was the MyoTrack, which was $400 for a simple device which would monitor your electrical activity and display it in a LED graph. [06:12.290 --> 06:13.390] $4.50 now? [06:13.630 --> 06:14.070] Wow. [06:15.250 --> 06:15.690] Yeah. [06:15.950 --> 06:17.870] And this is a device that was made in the 80s. [06:17.910 --> 06:19.890] However, they're still producing them and selling them. [06:19.990 --> 06:21.170] So, it's kind of ridiculous. [06:21.230 --> 06:27.810] And I felt there was a need to design something that was low cost, open to the public, and anyone could use. [06:27.810 --> 06:30.070] Because it's actually a really simple interface. [06:31.490 --> 06:36.750] So, our original design or our idea for our project was to create this bi-directional interface. [06:37.110 --> 06:42.450] We wanted to create this bi-directional interface by using surface, like a non-invasive method. [06:42.590 --> 06:43.670] We didn't want to have electrodes. [06:43.810 --> 06:49.470] We wanted to have just an array around the forearm so that we could receive and hopefully send back the signals, of course. [06:49.670 --> 06:50.730] That poses a problem. [06:50.930 --> 06:52.250] There's a lot of skin resistance. [06:52.490 --> 06:56.570] So, in order to get signals back into the body, we'd have to use tens of thousands of volts. [06:56.570 --> 06:58.690] And that would be really just shocking people. [06:58.850 --> 06:59.990] And that's not very ethical. [07:01.910 --> 07:07.570] So, we decided to just go with being able to receive signals and control things depending on how our fingers are moving. [07:08.570 --> 07:17.210] So, our project went from being bi-directional interface to making a simple wireless EMG system, which was used in array around the forearm. [07:19.890 --> 07:26.790] So, in terms of my section of the project was to create the microcontroller side and the transmission side. [07:27.010 --> 07:29.150] So, I wasn't focusing on amplification at first. [07:29.350 --> 07:32.050] Hence, I have some well-designed boards. [07:32.410 --> 07:35.310] But the amplification circuit is still on protoboard right now. [07:35.590 --> 07:41.210] But in terms of my original design, I plan to use a chip with large signal processing. [07:42.350 --> 07:46.530] Mainly because it's better to have more power than it is to be underpowered. [07:46.810 --> 07:51.250] And after doing some research, I found the PIC32, which is a 32-bit processor. [07:51.350 --> 07:52.010] So, it'll be able to. [07:52.270 --> 07:55.310] And it has its own digital signal processing library built into it. [07:57.670 --> 08:02.030] The PIC32 also is relatively low power and has built-in USB. [08:02.030 --> 08:09.250] So, I wouldn't have to create any sort of USB interface or use any serial to USB converters allowing to maintain the size to be small. [08:10.030 --> 08:12.250] It's a very relatively powerful PIC. [08:13.550 --> 08:20.470] For the transmission, I decided to go with the NRF2401, which is a 2.4 gigahertz transceiver. [08:20.570 --> 08:24.190] It's able to send and receive packets over the 2.4 gigahertz range. [08:24.310 --> 08:27.550] It's actually the exact same chip that they use currently in our badges. [08:27.970 --> 08:32.330] It started with the last HOPE conference, I actually was introduced to it. [08:32.810 --> 08:35.810] And since then, I've been doing research on it and I found a lot of people are using it. [08:35.950 --> 08:40.950] And there's a lot of tutorials and support available for it to develop your own things for it. [08:42.030 --> 08:45.450] And also, I tried to focus on maintaining surface mount. [08:46.570 --> 08:48.270] The use of surface mount components. [08:48.270 --> 08:52.290] That way, it maintains a small size and could be... [08:52.850 --> 08:55.930] They're relatively inexpensive at the same time. [08:58.550 --> 09:00.970] Now, this is actually my very first Eagle schematic. [09:01.270 --> 09:05.980] So there's a few traces that are going diagonally, which isn't very neat, but... [09:07.630 --> 09:08.470] Laser pointer. [09:09.330 --> 09:11.770] On the top, I have the CMOS. [09:11.930 --> 09:13.490] This is a CMOS crystal that I'm using. [09:13.910 --> 09:19.590] It's 80 megahertz, powering the PIC32, which is capable of running 80 million instructions per second. [09:19.750 --> 09:20.670] I figured, why not? [09:20.670 --> 09:26.930] But there's a USB port up here for communicating with the PIC32, which is going to be implemented. [09:27.550 --> 09:32.090] In-circuit serial provider on top is a very simple port. [09:32.230 --> 09:33.970] Like, in fact, the programmer for it will cost only $30. [09:34.110 --> 09:38.010] But you can actually program any sort of PIC chip, including the PIC32 with that. [09:38.930 --> 09:43.450] I have capacitors here to filter out voltages in case there's any stray voltages coming in. [09:45.010 --> 09:45.490] Yeah. [09:45.710 --> 09:48.950] On the left-hand side, I put in an 8x2 port. [09:49.610 --> 09:55.170] The second row of that 8x2 port hasn't been implemented in this design. [09:55.390 --> 10:03.250] However, all eight pins go into the analog zero through seven inputs of the microcontroller, so I'd be able to receive analog signals. [10:04.270 --> 10:08.390] These actual inputs can be reconfigured to be outputs as well. [10:08.390 --> 10:13.990] So since this device is meant to act as a transceiver, you can have two of them and configure one to be like a robot controller. [10:14.290 --> 10:16.710] And at the same time, the other one would be the one transmitting the signals. [10:18.350 --> 10:21.650] The circuitry on the bottom was used with the... [10:22.070 --> 10:28.990] Everything here was designed with the standard library that comes with Eagle, which proved to be a problem later a little bit. [10:28.990 --> 10:31.730] But this is the NRF chip that it doesn't... [10:31.730 --> 10:35.590] This actual package doesn't refer to the bottom pad. [10:35.830 --> 10:46.450] There's all QFN chips, which the 2401 is, have a pad on the very bottom of the chip that allows you to connect it to ground and reduce noise. [10:46.790 --> 10:50.250] However, this package did not tie anything to that ground. [10:50.750 --> 10:56.310] Also, for the NRF, I used a CMOS clock thinking it'd be a 16 megahertz clock. [10:56.430 --> 10:58.090] It'd be able to run on 3.3 volts. [10:58.430 --> 11:00.330] And I was intending to run it off of... [11:01.950 --> 11:02.730] Sorry about that. [11:07.520 --> 11:09.820] Anyway, I was intending to run it off of batteries. [11:10.080 --> 11:11.180] If you noticed that on that... [11:11.180 --> 11:12.480] Well, I can't really notice it. [11:12.600 --> 11:15.100] But on the actual circuit, I had no... [11:15.100 --> 11:16.500] Any sort of power regulation. [11:16.500 --> 11:24.960] I was intending to use the in-circuit serial provider port since it is tied to positive and negative to supply power to the device. [11:26.180 --> 11:27.380] How'd we get that far? [11:28.920 --> 11:36.500] But the output of the oscillator is tied directly to the NRF, which is the X1 port. [11:38.240 --> 11:41.080] This is the board design of the very first thing. [11:41.860 --> 11:46.200] This package right here, that's the 16 megahertz oscillator that I was talking about. [11:46.500 --> 11:56.800] I had to design my own package for that, which if you ever have to do, it's relatively simple, but it causes problems later on if you mess up, which is annoying. [11:57.600 --> 11:59.520] But I have this part right here. [11:59.820 --> 12:08.500] You don't see it in the previous design, but that's actually a fuse that I used to prevent any excess voltage from burning out the circuit. [12:08.640 --> 12:11.960] It's actually a 1-amp fast-acting fuse in case anything goes wrong. [12:12.660 --> 12:15.060] They also have, like, notes here. [12:15.180 --> 12:16.720] I mean, silk screen writing. [12:17.400 --> 12:28.500] But to get this circuit designed, I went to BatchPCB, which I don't know how many of you have heard of, but it's a really good service for getting your circuit ports designed and, I mean, manufactured. [12:29.200 --> 12:35.820] And I spent about a week figuring out that I had roundness on these edges of 3%. [12:35.820 --> 12:40.200] You couldn't actually see this, but the bot picked it up and said, sorry, we can't manufacture it. [12:40.340 --> 12:43.680] So for like a week, I was trying to figure out why isn't this working. [12:43.860 --> 12:46.180] And eventually, I was like, ah, son of a bitch. [12:48.680 --> 12:51.200] It was actually really relieving to finally get it printed it. [12:51.360 --> 12:55.360] But another thing you'll notice is that over here, this is actually where the antenna would go. [12:55.500 --> 12:57.940] I had no idea how to make trace antennas at the time. [12:57.940 --> 13:04.970] So I just put a little hole that you would actually just solder in a wire into that would match the 2.4 gigahertz thing. [13:05.140 --> 13:10.140] And if it didn't work, you could just snip it off and eventually figure out the right length of it. [13:12.750 --> 13:20.900] But in mounting the components, I don't know if all of you know how to mount surface mud components, but what I found to be useful was to first tin the pads. [13:21.970 --> 13:25.320] Generally, when you buy a board, it doesn't come with the pads pre-tinned. [13:25.320 --> 13:29.470] They are copper trace and it's easier to solder to them. [13:29.620 --> 13:32.520] But otherwise, you have to align the component and then apply solder. [13:32.660 --> 13:36.780] It's much easier to actually apply solder before you actually align the component and mount the chip. [13:37.420 --> 13:42.140] But afterwards, you remove the excess solder with a copper wick, which helps a lot. [13:42.740 --> 13:44.140] Then you align the component. [13:44.460 --> 13:53.080] And another way of doing it that works really well is to get a ball of solder onto the tip itself and run it along one side of the edges. [13:53.080 --> 13:59.540] Once you have that side soldered down, everything is going to be bridged. [13:59.680 --> 14:02.210] But you don't have to worry about that right now because you're not applying power, hopefully. [14:03.710 --> 14:09.380] But once you have everything soldered down on that one side, you can check all the other sides to make sure that they're aligned as well. [14:09.540 --> 14:14.300] And once you've verified that, you can apply the ball of solder to every single side. [14:14.300 --> 14:20.280] And that'll have the pads connected to the pins, even though they may still be bridged. [14:20.590 --> 14:25.400] But once you have that done, you could just take solder wick and apply it to the legs. [14:25.520 --> 14:26.710] And that'll suck up the excess solder. [14:26.860 --> 14:31.380] But at the same time, the solder wick can't touch the area in between the pins and the pads. [14:31.380 --> 14:35.800] So it's able to get rid of all the bridges at all at the same time, preventing any... [14:36.510 --> 14:39.660] But at the same time, maintaining the integrity of this mount. [14:41.800 --> 14:44.400] Soldering the QFN was not as easy. [14:45.420 --> 14:48.960] I've heard rumors that you could solder it with a soldering iron. [14:48.960 --> 14:55.060] And I don't know how many of you have tried that, but I've not had success with that. [14:55.260 --> 15:02.160] But luckily, I got a hot air reflow oven at the university I was studying in. [15:02.260 --> 15:04.940] So I was able to use that to actually solder that QFN. [15:05.900 --> 15:09.120] Unfortunately, the only sort of flux I had was rosin core. [15:09.380 --> 15:12.940] Which, if you use, it'll leave brown crap all around the pick. [15:13.240 --> 15:16.210] And it's not a very clean design. [15:16.210 --> 15:19.040] But in terms of... [15:19.620 --> 15:22.210] But it's very important to use it to actually maintain a circuit. [15:22.330 --> 15:25.470] You'll need to use some kind of flux to have a clean build. [15:35.980 --> 15:36.480] But, yeah. [15:37.580 --> 15:39.820] Once you've fluxed everything, you just check... [15:39.820 --> 15:40.980] You clean it off. [15:41.200 --> 15:42.680] And that's just wiping it down. [15:42.960 --> 15:44.760] Afterwards, you just take the ball of solder. [15:44.920 --> 15:47.210] Like, you pre-tin the pads just like before. [15:47.580 --> 15:50.330] And once that's done, you check for even height. [15:50.560 --> 15:56.360] Which means that you want to make sure that the solder that's left on the pads isn't like varying too much. [15:56.540 --> 16:04.320] Because if it is, you might have a problem with the connection between the leads of the chip with the actual component... [16:04.320 --> 16:06.080] With the circuit board. [16:08.250 --> 16:13.960] Once you've verified that, you apply a frex solder of flux and you placed a line of the chip onto the board. [16:14.580 --> 16:17.240] And the proper way of using a hot air reflow oven... [16:17.830 --> 16:20.960] I mean, hot air reflow tool is linked here. [16:20.960 --> 16:22.300] It's actually a Hackaday reference. [16:22.800 --> 16:24.040] It works really well. [16:24.200 --> 16:27.660] But the important thing to get from it is to heat up the board first. [16:28.060 --> 16:35.140] When you're using the tool, you hold the tool far away from the board until everything heats up at the same speed. [16:35.280 --> 16:39.740] And then you blast it with hot air to get the solder melted. [16:40.000 --> 16:43.210] And that will actually suck the chip onto the pads. [16:43.360 --> 16:45.380] And you can actually poke it and it will move around. [16:45.500 --> 16:46.860] It will still be stuck in one spot. [16:57.880 --> 16:58.480] Yeah. [17:00.180 --> 17:02.640] How many of you have done QFN soldering? [17:03.760 --> 17:04.940] With soldering irons? [17:06.160 --> 17:06.840] How's it worked out? [17:13.290 --> 17:13.890] Yeah. [17:17.090 --> 17:17.690] Yeah. [17:18.070 --> 17:18.570] I've tried. [17:18.730 --> 17:19.530] You're going to have to show me. [17:20.670 --> 17:21.350] But, yeah. [17:23.770 --> 17:27.130] This is actually the results of my first board. [17:27.130 --> 17:28.270] I have everything mounted. [17:28.570 --> 17:29.810] That's the PIC32 chip. [17:30.350 --> 17:32.950] The QFN part is here, the NRF transmitter. [17:33.470 --> 17:35.770] And if you'll notice, there's a large wire going across. [17:35.950 --> 17:39.850] It's because I wasn't paying attention close enough to the application notes of the PIC32. [17:40.030 --> 17:46.490] It turns out that one of the pins needs to be tied to ground when using an internal regulator, which was needed for the USB thing. [17:46.730 --> 17:48.590] But that was a mistake. [17:48.590 --> 17:59.530] The other thing accidentally when I had problems is when I plugged in the in-circuit serial programmer, the first thing that it showed up was, sorry, we can't actually find your chip. [17:59.870 --> 18:01.310] It was set to PIC32. [18:01.490 --> 18:03.330] And I was like, check this to make sure that the VCAP is set. [18:03.770 --> 18:06.070] So, I was like, wait, what's a VCAP? [18:07.730 --> 18:26.930] Eventually, I found out that VCAP is actually a 10 microfarad capacitor that needs to be tied between the VCAP pin somewhere over here to ground, which I was able to hack that together by bridging the connection between the VCAP pin, which luckily was right next to one of the analog pins. [18:27.310 --> 18:40.910] And further down, I tied the polygon to ground by scratching off a little bit of here and making a bridge out of solder and a 10 microfarad capacitor I was able to make using two 5 microfarad capacitors just soldered together next to each other in parallel, [18:41.150 --> 18:41.810] which works. [18:42.390 --> 18:45.610] And at that point, I was able to actually communicate with the PIC32. [18:45.830 --> 18:53.070] However, every single time I tried to program it, it kept giving me the error that, sorry, it couldn't program the boot sector or sorry, it couldn't program the configuration sector. [18:53.210 --> 18:54.590] I actually never solved that. [18:54.790 --> 19:01.530] And I've switched since then to using the PIC microcontroller that I've actually used before and has been comfortable for me. [19:01.730 --> 19:08.210] But once I found out that the microcontroller didn't work, I decided to test the NRF component. [19:08.210 --> 19:21.390] And this was done by scratching off some of the silkscreen here and soldering wires to the leads that are coming from NRF and making a prototype board to test that. [19:21.590 --> 19:22.550] That didn't work either. [19:22.770 --> 19:24.630] There was actually a problem with... [19:24.630 --> 19:26.510] Son of a... [19:28.200 --> 19:31.140] There was a problem with CMOS crystal. [19:31.260 --> 19:33.200] You can't use CMOS for an NRF chip. [19:33.320 --> 19:34.540] It just doesn't register it. [19:34.600 --> 19:38.900] You have to use a crystal and turn it into a resonator using capacitors. [19:39.680 --> 19:42.480] And a resistor across the pins. [19:44.540 --> 19:48.400] So the lessons I learned from this is don't bother using other packages. [19:48.760 --> 19:50.440] A lot of my components were from SparkFun. [19:50.680 --> 19:59.520] So it was much easier to download the SparkFun package and get the actual component layout for the 2 millimeter by 2.5 millimeter crystal that I used. [19:59.840 --> 20:01.600] That would have saved a lot of time. [20:02.400 --> 20:08.300] Another thing I used in the design of the actual printed circuit board was I used autoroute, which just wasted my time. [20:08.640 --> 20:13.820] I used autoroute, got 70% complete, moved a component, used it again, and it got me 50%. [20:13.820 --> 20:15.400] And it just wasn't really helping. [20:15.600 --> 20:20.660] And actually, I found it a lot quicker to place all the components yourself and route all the traces by yourself. [20:22.040 --> 20:25.720] But it actually turned out to be eagle. [20:25.940 --> 20:25.960] Yeah. [20:27.140 --> 20:27.560] Yeah. [20:28.400 --> 20:32.000] But another thing I decided on is not having traces running all over the place. [20:32.080 --> 20:38.040] If you noticed, I had different angled traces running across the place. [20:38.160 --> 20:39.540] And it just didn't work very well. [20:39.740 --> 20:46.300] And you have to triple check everything, make sure that any kind of mistakes like overlooking something in the application notes doesn't happen. [20:46.980 --> 20:49.420] Most importantly, follow KISS, which is keep it simple. [20:50.240 --> 20:50.420] Stupid. [20:52.380 --> 20:59.700] For my second design, I decided to implement the SparkFun package, and I followed all the application notes carefully so that I wouldn't make any simple mistakes like that. [21:00.080 --> 21:05.140] I decided to add lithium ion power, which is, in my opinion, still keeping it stupid, keeping it simple. [21:05.360 --> 21:13.060] Because I used the SparkFun example that they created for a Max 555 charger. [21:13.060 --> 21:17.420] I was able to implement that into my board, and I have it working right now. [21:18.500 --> 21:26.100] I used the PIC 18F4550 because that's actually a microcontroller that I've used before and have gotten it to work. [21:26.200 --> 21:28.700] Also, I had the DIP version of it so I could prototype with it. [21:29.620 --> 21:38.860] For the prototype, I actually bought a SparkFun breakout boards for the NRF, which allowed me to do code testing in the meantime while I was waiting for the board to be manufactured. [21:40.020 --> 21:45.280] I got rid of all CMOS clocks and everything I did with just a crystal and turning it into a resonator. [21:45.620 --> 21:49.760] And I added expansion ports so that I noticed that a lot of the pins weren't being used. [21:49.940 --> 21:56.700] And even on the 18F4550, which has less pins than the 32, you could still use those pins in other designs. [21:56.820 --> 22:01.320] So I just put a bunch of expansion little solder points where you could add stuff to. [22:02.600 --> 22:17.460] 2.4 gigahertz chip, while the chip antenna was implemented, since I didn't want to just bother using the wire to test things out, you could just buy for a dollar the chip antenna that's in one package and all you have to do is just solder it and put two points. [22:17.720 --> 22:19.140] And that works actually very well. [22:19.780 --> 22:25.800] LEDs I put in since I kind of forgot them in the previous design just for basic testing and having everything work. [22:25.800 --> 22:37.620] And lastly, I just put mounting holes along the edges of the board because my original intent was to have the board on some sort of like piece of fabric and I wanted to have it sewn in. [22:37.780 --> 22:42.880] So I added like a bunch of drill holes along the edges so you could put needle and thread through. [22:43.380 --> 22:45.600] The board was actually also designed... [22:46.100 --> 22:49.160] I'll talk about the board later, but this is the schematic of the device. [22:49.440 --> 22:55.180] On the bottom it talks about 2NRF because the circuitry for the NRF thing is the exact same as before. [22:55.460 --> 23:01.900] The only thing I changed was the instead of a CMOS clock I used crystal which solved that problem. [23:02.160 --> 23:05.360] But this is actually a basic crystal resonator. [23:06.680 --> 23:13.440] On top over here you've got the USB port and the power supply circuitry which is over here. [23:14.320 --> 23:17.260] For the NRF you have to use 3.3 volts. [23:17.260 --> 23:26.800] So even with a lithium ion battery, the lithium ion battery's power is 3.7 and that would burn out the chip since 3.3 is the maximum input voltage. [23:27.100 --> 23:37.800] So I used a LM117 I believe which is the same pin out as the 317 to create my own voltage regulator to bring it down from 3.7 to 3.3. [23:38.580 --> 23:48.200] Over here is the in-circuit serial provider along with the USB port which was implemented in the 4550 as it also has a built-in USB port. [23:48.800 --> 23:57.600] On this side you have the breakout for the analog inputs as well as various other breakout points for expansions. [23:59.160 --> 24:03.740] This board is actually considerably bigger than my first one with added circuitry. [24:03.740 --> 24:10.460] I tried to keep all the components on one side since the board is actually the same size as the lithium ion battery. [24:10.740 --> 24:16.760] I wanted it to lay flush with it and you'd be able to sew the strings around it. [24:17.560 --> 24:20.040] Since it needs to be the same size, it turned out to be a lot bigger. [24:20.260 --> 24:25.880] But on this side you have the lithium ion input thing which actually turned out to be a problem. [24:26.760 --> 24:31.440] According to the package that SparkFun supplies, one side is positive and the other side is negative. [24:31.440 --> 24:35.160] This is actually correct but the batteries that I got from SparkFun had the wires backwards. [24:35.480 --> 24:38.300] So the first time I plugged it in, my charger blew. [24:38.540 --> 24:39.720] And I had to get new ones. [24:41.060 --> 24:51.240] I do know for a fact that the batteries were backwards because at some point I was fixing my brother's PlayStation 3 controller and it happened to have the exact same battery with the proper wiring for the wires. [24:51.420 --> 24:52.440] Actually, I have it here. [24:52.660 --> 24:57.000] And I'm going to be demonstrating it downstairs at the Hackerspace Village if you're interested in checking it out. [24:57.000 --> 25:03.500] But on this side, yeah, you've got the analog input ports, expansion port, another expansion port up here. [25:03.800 --> 25:04.480] It's simple. [25:04.900 --> 25:05.420] But... [25:06.120 --> 25:06.640] Yeah. [25:08.940 --> 25:12.160] I also realized that not everyone can solder a QFN thing. [25:12.300 --> 25:16.300] And the only time you can actually do it reasonably is with a hot air reflow tool. [25:16.300 --> 25:20.920] So I created an alternate version that doesn't use any of the QFN parts. [25:21.100 --> 25:28.420] And instead you can buy a prototype shield from SparkFun and just plug it directly into this bottom port. [25:28.620 --> 25:29.780] And this lines up. [25:30.200 --> 25:35.420] One thing I didn't do but wasn't really a problem is I didn't take out any of the voltage regulation. [25:35.420 --> 25:36.340] It's not needed. [25:36.500 --> 25:41.360] If you use the prototype board, it actually has a regulator from 5 volts to 3.3. [25:41.360 --> 25:42.360] But I decided... [25:43.160 --> 25:51.340] But I left it in which actually didn't cause any problems because I just shorted all the wires and just created an output directly from 3.7 to the rest of the circuit. [25:53.080 --> 25:55.360] This is my prototype for the design. [25:55.620 --> 25:59.920] It's just a standard dip thing with the prototype from SparkFun available. [26:00.440 --> 26:00.920] All you gotta... [26:00.920 --> 26:02.260] Like it's very simple connection. [26:02.380 --> 26:06.280] All you gotta do is just connect all the wires directly and it works. [26:07.600 --> 26:14.020] For the prototype, I was actually testing it with an open beacon USB, which is a device that was meant for the open beacon tags. [26:14.200 --> 26:19.320] But since they're using the same things, I just modified the channel and took out any of the encryption. [26:19.500 --> 26:22.320] And I was able to receive signals from the prototype. [26:22.760 --> 26:25.980] This is actually my built board, which I could be showing. [26:26.300 --> 26:26.580] It's... [26:26.580 --> 26:29.360] Everything's laid out in the same fashion as the printed circuit board. [26:29.640 --> 26:31.520] On the bottom, I have the chip antenna. [26:31.760 --> 26:36.860] And the polygon was cut off so that it wouldn't restrict any of the transmissions on any side. [26:37.120 --> 26:42.720] Since in this board, unlike the previous first design, I actually have the top polygon tied to ground. [26:44.800 --> 26:46.200] This is the alternate version. [26:47.900 --> 26:48.380] Anyway. [26:48.680 --> 26:51.960] So, my successes and failures with this design were I was able to create a working pick. [26:52.160 --> 26:58.760] So, I'm actually able to get transmission back and forth from the pick and from the other versions since I have two working ones. [26:59.680 --> 27:01.300] Lithium ion power does work. [27:01.300 --> 27:07.760] I haven't been able to get it to charge from USB as I don't have any software that runs USB right now. [27:07.940 --> 27:12.540] So, the computer is only outputting 100 milliamps to supply power to the device. [27:12.700 --> 27:14.560] However, to charge properly, it uses 500. [27:15.060 --> 27:20.500] And, as such, it doesn't charge properly unless you have one of those wall outlets to 5-volt adapters. [27:21.980 --> 27:25.220] The things that didn't work very well is the lithium ion backwards. [27:25.580 --> 27:26.600] The battery was backwards. [27:26.880 --> 27:28.240] So, it kind of burnt out one of my designs. [27:29.140 --> 27:30.500] I still have, like... [27:31.240 --> 27:40.360] At one point, like, during the design of the version with the QFN, I put it together and I had the fuse bridged so that I could actually have power to the entire device. [27:40.640 --> 27:44.920] However, I noticed that there was a short between the positive and the voltage of the... [27:44.920 --> 27:47.120] the positive and the negative of the ICSP. [27:47.400 --> 27:49.820] And that turned out to be a glitch that Eagle had. [27:50.340 --> 27:57.600] There was actually a stray trace in my design that was connecting the positive directly to the ground, which caused that short. [27:57.880 --> 27:59.280] And that could have... [27:59.280 --> 28:02.040] That was easily fixed by using an X-Acto knife to scratch it off. [28:02.220 --> 28:07.060] But until then, I actually had no idea what was going on and I was shorting out of components. [28:07.260 --> 28:08.480] However, luckily nothing blew. [28:09.600 --> 28:13.640] The USB hasn't been tested since I haven't tried any firmware for it. [28:13.640 --> 28:19.820] And some of the mounting holes is when you're working with Eagle, everything looks a lot bigger than it actually is. [28:20.320 --> 28:22.520] So when you get it manufactured, it's small and you're like, wait a second. [28:22.640 --> 28:23.940] I didn't expect it to be this small. [28:24.120 --> 28:28.340] So I have a couple of small holes that, like, you can see light through, but they're little pinpricks. [28:28.480 --> 28:31.100] You can't actually get any thread through them and they're useless. [28:33.260 --> 28:39.620] Anyway, so introduction to my code is I based it around the OpenBeacon software designed by Milush Mariak. [28:40.600 --> 28:49.460] I implemented the config files and the command scheme, which was used to send commands to the NRF and to get it to do things that you wanted it to. [28:50.340 --> 28:55.700] I modified the PIC16F tag code that was used and I added analog to digital conversion. [28:55.920 --> 29:06.500] I had ADC read function into the PIC, so it's able to receive analog voltages from the external sources and convert it into digital value that the microcontroller could work with. [29:07.500 --> 29:17.160] Or, and rather, in my particular design, I had the microcontroller analyze the analog to digital pulses and put it into the packets that the OpenBeacon sends out. [29:17.280 --> 29:23.800] There's actually two reserved bytes and those two I just filled with whatever I read in from analog, the first analog port. [29:25.660 --> 29:32.360] Then I just designed my own code for receiving signals with the 184550, because that hasn't been done on the PIC processor. [29:33.080 --> 29:48.520] The receiver I have been using until I had two working boards, I've been using the OpenBeacon USB, and that was programmed with GCC in the ARM development, because it's an ARM9-based board, which is actually very confusing, because I don't know much about that. [29:51.520 --> 29:53.220] These are the modifications that I've done. [29:53.420 --> 29:56.780] I also changed the channel to 42, so it wouldn't interfere with any future hopes. [29:58.020 --> 30:04.680] I don't know what particular channel this one is working on, but if it is 42, then I'll be changing that, too. [30:06.080 --> 30:21.400] On the left-hand side, on the bottom, you see my code for reading in analog voltages from the PIC, and from there I tie it in with the OID so that when the device transmits the OpenBeacon packet, it transmits the OID as the analog voltage read in. [30:23.760 --> 30:27.900] For amplification, there's two main sources that I used for figuring out how to do this. [30:28.040 --> 30:29.480] It was an EKG source. [30:30.260 --> 30:35.720] The important thing is that EKG is really just monitoring the electric potential of the heart. [30:35.940 --> 30:42.660] So it's really just a type of EMG signal, and you could use the same sort of amplification signals for EKG as you do an EMG. [30:43.260 --> 30:56.500] I tried multiple designs that I found in the EKG, and some sort of worked, but eventually I found a resource to a lab that was talking about how to design, how to build a simple EMG circuit. [30:56.700 --> 31:03.180] And I was able to refer to an old textbook that I had for creating a differential amplifier, which will be shown soon. [31:03.180 --> 31:09.260] But the important thing is to have a high input impedance since there's no... like your body is not actually a battery. [31:09.420 --> 31:11.560] It can't provide signals at a high current. [31:12.040 --> 31:17.600] It's important to not draw a lot of current so that you don't want to distort the signals coming in from the actual muscles. [31:18.620 --> 31:23.100] Differential amplifier is used so that you're rejecting any other sort of signals that are inside your body. [31:23.240 --> 31:30.360] So you don't want to be picking up any antenna signals, and just the voltages across the two electrodes that are placed on your body are being amplified. [31:30.360 --> 31:38.540] You want approximately 200 gain, which, since EMG signals are in the five microvolt range, could be easily converted into volts. [31:39.100 --> 31:47.300] And a grounding electrode is extremely important, which, in my case, I just had a watch on the same hand, and I just tied that to ground, which worked really well. [31:47.900 --> 32:03.260] For the grounding electrode, it's important to place the grounding electrode on top of a bone, which... or an area that has very little muscle, because that way any muscles in that area won't be producing stray signals to ruin your differential amplification. [32:04.040 --> 32:06.500] This is actually a schematic of the differential amplifier. [32:06.640 --> 32:09.180] I got this from Sedra and Smith microelectronics circuits. [32:10.680 --> 32:15.760] If you notice, there's actually a resistor between the negative inputs of the op amp. [32:16.160 --> 32:20.240] That resistor ensures that you're amplifying just the difference between the two. [32:20.240 --> 32:27.780] Normally, you'd have a resistor tied to ground, but by getting rid of the ground, you... [32:27.780 --> 32:35.920] The voltage coming in from the two positive sides is equal to the voltage at the negative, and therefore you're only amplifying the differences between the two. [32:37.140 --> 32:39.660] Yeah, the second part is just a simple amplifier. [32:42.080 --> 32:45.140] In terms of actually testing this, I use the microphone input. [32:45.140 --> 32:50.900] I have a prototype board set up for it to be working inside of this Altoids case. [32:51.620 --> 33:05.160] I use two 9-volt batteries to supply power to it, and I use the microphone input from my computer to read the signals into Audacity, and from there I was able to actually observe EMG signals whenever I would contract my muscles. [33:05.700 --> 33:07.420] I could be showing that downstairs, too. [33:08.480 --> 33:08.920] Yeah. [33:10.020 --> 33:11.200] And these are my acknowledgments. [33:11.320 --> 33:12.560] That's basically what I've done so far. [33:12.560 --> 33:15.440] And in future work, I'll be designing... [33:16.000 --> 33:20.580] I'll be reading those signals into the microcontroller and using that to control things. [33:21.260 --> 33:22.040] Any questions? [33:28.790 --> 33:30.190] Five microfarad capacitors. [33:35.230 --> 33:42.530] Once I soldered the two microfarad capacitors together, I just measured it, and it showed to me that it was exactly 10 microfarads. [33:43.210 --> 33:43.370] So... [33:43.370 --> 33:43.910] Really? [33:48.380 --> 33:48.900] Yeah. [33:52.200 --> 33:53.720] I don't have it downstairs, but I could bring it down. [33:53.720 --> 33:54.140] I could bring it tomorrow. [33:55.880 --> 33:56.440] Okay. [33:57.300 --> 33:57.840] Yeah. [33:58.120 --> 34:03.340] What would you choose pick and RFID type chip, for example? [34:08.230 --> 34:12.230] I've always been using pick, so I've just been used to it, and some... [34:12.230 --> 34:18.970] What made me choose pick and the RFID type chip instead of Arduino and... [34:18.970 --> 34:20.810] What type of transmitter we're talking about? [34:20.950 --> 34:21.750] XP radios. [34:21.910 --> 34:22.610] XP radios. [34:23.010 --> 34:26.530] The NRF, I found a lot of support for available online. [34:26.770 --> 34:31.110] It's 2.4 GHz, meaning it could be used internationally, and it doesn't impose with any restrictions. [34:32.930 --> 34:35.890] And I thought it was like a relatively clean system. [34:36.610 --> 34:40.950] For the pick, I've just been using it for a long time, so I've grown accustomed to it. [34:41.690 --> 34:42.210] So... [34:43.030 --> 34:43.550] Yes? [34:54.040 --> 34:54.980] What I've... [34:54.980 --> 35:07.000] The research I've done showed... told me, like, that they... the moment you contract your muscles, or the moment your muscles are activated, there's a pulse, but it's still... like, it maintains it while they're being used. [35:07.080 --> 35:18.200] However, the results I've seen showed that, like, the moment you contract it, it's... there's a large pulse, and afterwards, even if you maintain your muscle flexed, nothing really appears. [35:18.200 --> 35:20.300] So there's no constant level on top of it? [35:20.340 --> 35:21.100] It doesn't seem to be. [35:21.160 --> 35:22.840] It seems to be, like, a DC source. [35:23.560 --> 35:23.660] Yes? [36:04.980 --> 36:09.160] I've been focusing on the forearm, so I've only measured it with that. [36:09.260 --> 36:16.180] I've tried to use it as an EKG to monitor my heart, but I'm not sure if I figured out the proper placement for that, because I haven't been getting signals from that. [36:19.720 --> 36:20.500] Any other questions? [36:23.100 --> 36:23.600] All right. [36:23.760 --> 36:23.980] Thank you.