Project Journal for Owen Yin-
=============== Week 15: =================
Entry 4: -----------------------------------------------------------------
Date: April 23rdStart Time: 2:00?pm
Duration: 21? hours
Today we had the sprint to finish the entire board and get everything ready for the final demo. When I first came in I spent a long time connecting up all the hardware on the board one by one; first we plugged the power system in and ensured it was outputting the expected 5V, then we connected that to the raspberry pi and made sure that worked, in addition to connecting the display to power and the pi. Next was the microcontroller, where we used the serial port to ensure the micro was running as expected. We plugged the button and RFID sensor into the micro board and those functioned as expected, and then finally we spent a long time wiring up the IR boards. Once everything was plugged in Michael ran a bunch of software tests for the IR sensors, and then Michael and Luke spent a deccent chunk of time trying to map the IR sensors' signals coming in to the microcontroller to their respective locations in the matrix. With most of the hardware work complete, Michael started going through the different game states one by one and testing the code he had written then adjusting it so that it actually functioned; I didn't really do much when he was working on this, besides occasionally throwing an idea in and standing by by the board to help with testing. We had the full project ready by around 9 or 10, although there were still some bugs happening with the IR sensor placement. Regardless, we were able to get all 5 PSDR checkoffs, as well as a very generous bonus PSDR checkoff for animation because the cards rotated.
Entry 3: -----------------------------------------------------------------
Date: April 22ndStart Time: 1:00pm
Duration: 4 hours
Finished soldering the splitter. We also finally got our top board; we had to drill a hole for the button ourselves, since we told the machine shop to cut the middle hole and then just get the board to us, basically. For that we were able to find a hole cutting bit in the lab that was just the right size, and so we were able to cut the hole and fit the button in fairly easily. We tested the placement of the IR boards and stuff again, and also tested a few different heights of standoffs before choosing one and starting to superglue the standoffs to the IR boards and then those assemblies to the top board. After the IR boards were attached, we looked at where to mount the main boards; the power board has to go on the side so we can easily attach the power cord through a hole in the side walls. The IR splitter board and the main microcontroller board have to be in a somewhat central location so that all the IR pcbs' cables can reach; we eventually glued on a board under the area where the screen is to attach the boards to, and this will also hopefully serve to support the screen. We attached the IR splitter and micro boards here, and also screwed some standoffs onto the raspberry pi then glued the standoffs next to the splitter and micro boards, to make the power connections between the power PCB and pi, and the pi and micro board easier.
Entry 2: -----------------------------------------------------------------
Date: April 21stStart Time: 1:00pm
Duration: 4 hours
Soldered some more of the splitter board while Luke soldered the SMD resistors onto the microcontroller PCB. I checked over the soldered connections and Luke grabbed the top board from the machine shop for a bit so we could test placement. The cables I bought fit the spacing of the top board and everything fits. We tested half the IR sensor boards with just the splitter and it worked quite well, so we just need to integrate it together with the microcontroller board and we should be ready for another checkoff; hopefully we can get that done next session.
Entry 1: -----------------------------------------------------------------
Date: April 19thStart Time: 3:00pm
Duration: 2 hours
Came in on the weekend and soldered another part of the splitter board.

=============== Week 14: =================
Entry 5: -----------------------------------------------------------------
Date: April 18thStart Time: 1:00pm
Duration: 5 hours
Cables arrived yesterday, so I brought them in today and started sizing them correctly(the cables came as a 40 pin long ribbon, and I had to pull off 7 pin sections for the IR boards). As I was doing this we talked more about the IR sensor problem, and Luke tried to get the level shifter working. Luke wasn't able to get it working, and another option the TAs recommended(using a zener diode as a choke) also didn't work. We discussed it amongst ourselves for a bit, and I thought we might have to just do an op amp comparator into a voltage divider, but Luke suggested just using a voltage divider first. If the maximum voltage coming out of the IR sensor is 5V, then a 5V to 3.3V voltage divider should provide a signal with a maximum voltage of 3.3V. This worked pretty well when we tested it, so we took a look at how we could implement this into our system with minimum modifications. We determined that we could take advantage of the SMD resistors already on the PCB going from the signal to ground, and use that as half of our voltage divider; for the other half, we could use a splitter board that would sit between the IR sensors and the row inputs on the PCB; this board would serve the dual purposes of combining the rows from the IR boards into 8 input lines, and also provide a location where I could solder a resistor in line to the signal that would serve as the other half of the voltage divider. I started soldering the splitter board; Next session, hopefully I can finish the splitter board and we can test with IR sensors.

Entry 4: -----------------------------------------------------------------
Date: April 17thStart Time: 1:00pm
Duration: 4 hours
This session we were working on the IR sensors; I made some more cables, and while Luke was testing the IR sensors to try and get a good resistor value for the microcontroller to read over we discovered that we weren't able to step down the voltage enough for the microcontroller to read. The voltage going through the phototransistors was around 5V and we need to step it down to around 3.3V to protect the microcontroller. We discussed this for a bit, then went to ask a TA; they recommended using a level shifter, and gave us one to test with. Next session we have to fix this problem, and after that we should be able to test with the IR sensors.

Entry 3: -----------------------------------------------------------------
Date: April 16thStart Time: 12:00pm
Duration: 4 hours
We spent a decent chunk of lab talking about the state machine for the software, and how it should be implemented. We came up with a general model for the state machine of the card placement phase, shown below;

After entering the placement phase, the system enters a RFID wait state where it checks for button presses and packets coming in. A button press moves to the next phase. On receiving any packets, the system moves to a processing state to process the packet to determine what type of packet it is and what should be done with it. If it is an RFID packet, the RFID tag is stored and matched to a card entry, and the system moves to another wait state for the IR data. Otherwise, it throws out the data and returns to the wait state. In the IR wait state, it repeats the same process as the RFID wait and process states, except this time it looks for IR packets instead. On confirming an IR packet, it takes the stored card entry from earlier and associates it with the location the IR packet detected; it determines this location by looking at changes in IR sensor data between this packet and the previous packet. Then, it returns to the RFID wait state. We talked about some other aspects of the software design in less detail. Next session, I plan on working on the IRs more.
Entry 2: -----------------------------------------------------------------
Date: April 15thStart Time: 1:00pm
Duration: 3.5 hours
Luke printed out the card designs he had been working on, so we worked on assembling the cards with their RFID tags and then testing the cards, as well as properly associating the cards with their tag IDs in software. We then did some testing with the software and the cards, and were eventually able to get the cards scanning in properly. This was enough to get another PSDR checkoff.

I grabbed some dupont connector cables and made sure they were the right width(7 pins) for our IR boards; the lab doesn't have enough for our purposes and doesn't have long enough cables, so I figured I'd try making some mysself. I grabbed some Dupont connectors, a crimper, and some wire, and started to try and make my own, but it was really difficult and didn't come out very well.

I also figured based on how long it took me to cut a few wires that it would take too long, so I just ordered some on Amazon. Next class I'm hoping I can get some work done on the IRs or have the packaging ready for assembly.
Entry 1: -----------------------------------------------------------------
Date: April 14thStart Time: 1:00pm
Duration: 3.5 hours
Today we aimed to get another PSDR checkoff. Luke and Zach had prepared another microcontroller board and checked that the micro was soldered correctly, so I finished soldering the necessarycomponents onto the board and adjusted some solder on PCBs I had previously soldered. We then moved on to testing; we first fed 3.3V power and ground into the power pins, using this breadboard setup I created:

Then we plugged in the serial port and connected that to a computer, and checked that we were able to flash and monitor the micro via the port. We then plugged the RFID and button in, and checked that that functioned properly. The circuit looked like the following:

We had some slight software adjustments to make, but we were able to get PSDR 3 checked off. Next session I'm hoping we can get started on assembling and testing the full IR matrix.
=============== Week 13: =================
Entry 3: -----------------------------------------------------------------
Date: April 9thStart Time: 12:30pm
Duration: 3 hours
Today we went to the ECE shop to check the soldering of the microcontroller and learned that many of the solder joints and such weren't soldered properly; we had several bridged joints and some pads were completely unsoldered.

This is a bit of a problem because our power system was already working, and the microcontroller would require us to use a hot pad to desolder - this isn't ideal as the power system is already tested and functional, and we only have a single buck regulator chip because it costs 15 dollars per component. After reviewing schematics for a bit, we decided that as a solution we could solder another microcontroller to a second board, as we had multiple microcontroller chips, and we could wire the necessary power connections between the two boards. We also spent some time working on figuring out game logic. Next class hopefully we'll have the microcontroller board ready for me to solder, and we can continue work on software and integrating the hardware together.
Entry 2: -----------------------------------------------------------------
Date: April 8thStart Time: 5:30pm
Duration: 2.5 hours
I continued to try and desolder the 2 PCBs after lecture; this gave me a lot of trouble because of the pins connected to the ground plane on each IR sensor. Because of this connection, the heat from the soldering iron just didn't transfer properly and so wasn't able to fully heat up/melt all the solder. I eventually gave up on desoldering the IR sensors intact, and broke the plastic casings to be able to desolder the phototransistor and IR LED separately; this worked very well for one PCB and I was able to take out the remnants of the broken sensor and replace it with a working one, but I damaged the other PCB and had to assemble a new PCB.

Luckily, though the pins were bent out of shape and some of the stems were cut off to fit breadboards, we had some working sensors leftover from breadboarding and I had many blank IR PCBs left over as well, so I was able to assemble another functional replacement.
Entry 1: -----------------------------------------------------------------
Date: April 8thStart Time: 12:30pm
Duration: 4.5 hours
This session I soldered the remaining components for the power system onto the PCB that Luke and Zach had prepared on the hotplate, and tested with 12V from the bench power supply. The PCB had a 5V output from the regulator, as designed; I then soldered the barrel jack onto the PCB and tested again with the 12V 3A wall connector that we are planning to use, and again verified a 5V output coming out of the power system; this gave us our first preliminary PSDR checkoff. I assembled the 7 remaining IR PCBs using the IR sensors that we had ordered and that had been delivered, and tested all of them; during testing, I found that 2 of the IR sensors on 2 separate PCBs didn't work, so I spent a long time trying(and failing) to desolder them. After lecture I plan on coming in again to attempt to desolder them.

=============== Week 12: =================
Entry 2: -----------------------------------------------------------------
Date: April 3rdStart Time: 1:00pm
Duration: 4.5 hours
Today we continued working on our packaging design. Luke and Zach worked on the CAD model, and I helped grab measurements between finishing the drawing on the paper order form. We also got the main PCBs in today, so we can hopefully start soldering those soon.

Entry 1: -----------------------------------------------------------------
Date: April 2ndStart Time: 12:00pm
Duration: 5.5 hours
Today we were working on our packaging design. We went down to the machine shop to talk with the people there about our design, and got a rough idea of what we wanted our box to look like as well as what information we would have to submit to the shop for our order. Afterwards, I spent a lot of time measuring out the spacing and dimensions of different aspects of our design, specifically the spacing between the IR sensor holes, and the distances between the holes and the edges of the board. I got measurements for the size of the IR sensors and the button so we could get diameters to drill holes through the top board for those two components. I also measured out various dimensions of the display, and then spent a long time drawing all those dimensions out on the paper form as requested by the shop. Hopefully next session we can submit our order.
=============== Week 11: =================
Entry 2: -----------------------------------------------------------------
Date: March 28thStart Time: 1:00pm
Duration: 4.5 hours
Continued assembling IR PCBs. I assembled 3 PCBs this session, and then tested the circuits. For testing, what I did was I connected 5V and ground(originally we had a 5V and a ground connection, the ground being connected to the two ground planes, but because of the issue with the flipped pins on the IR sensors discovered last session we will have to flip the connections; from here on, 'power' refers to the old 'ground' connection, which is connected to the planes; and 'ground' refers to the old 'power' connection) to 5V and ground on the power supply, and then connected the column select to 5V as well. I created a small breadboard to assist in testing, which split the 5V from the supply into connectors I could connect to the power and the column select on the PCB, as well as had a wire connected to a resistor that went to ground, that I used to check the voltage levels on the row outputs from the IR PCB. Using this setup, and manually holding my hand over the IR sensors, I was able to confirm functionality of the first testing PCB(when column select is powered and an object is held in front of the IR sensor, a voltage of around 4.5-5V is detected on the drain of the transistor; otherwise, if there isn't an object there, the object is further than the detection distance, or the column isn't enabled, there is a lower voltage there). I confirmed that all 6 of the PCBs assembled so far functioned as intended.

We also talked about our packaging design. For our final package, we are thinking that we will basically create an open box, where the bottom is the play surface of Gridwars, putting the components in, and then flipping the box over - leaving the bottom open for ease of assembly and modification. We went down to the workshop to check how we could submit an order for them to build, and they gave us an order form.

Afterwards, I spent some time teaching Zach how to solder. I went over some of the basic tools and stuff, and then taught him the basic technique for soldering throughole components and SMD components. Next week we plan on finishing our packaging design and submitting an order to the shop. We need to figure out how to attach boards to the top surface without needing screws on the play surface, and the exact dimensions of everything.
Entry 1: -----------------------------------------------------------------
Date: March 26thStart Time: 1:00pm
Duration: 5.5 hours
This session we received the IR PCBs.

I did manual inspections on 6 of them, including visual inspections and continuity checks between all connected nets and between every pad and ground. All of the PCBs I checked were good. I then started soldering with one test board and the IR sensors, as well as the pins. I found that the ground connection tended to be a bit difficult to solder as it was difficult to heat up(likely due to its connection to the ground plane, even with thermal reliefs). I tested the electrical connections and the solder connections seemed to function properly even though the solder on the ground pin looked a bit funky.
I then soldered an 0806 onto the test PCB and did some testing with it; I found that the IR photodiodes were not seeing current through them as expected, and while checking the datasheet for the IR sensor and the schematics realized that for some reason the footprint on the IR sensor had been backwards; connections 3 and 4, the two ends of the photodiode, had been flipped on the footprint somehow. This initially caused me to panic a bit, and I thought we might have to reorder the PCBs, but after reviewing the design with my teammates and the TAs I found that the IR photodiodes were the only connections to power and ground, so we could just flip the connection and it would work perfectly. I tested this arrangement by connecting the ground pin to 5V and power pin to ground, and found the expected level of current running through the photodiodes, and after confirming with my teammates and the TAs I soldered 2 more PCBs and decided to call it a day. Next session I will test the phototransistor functionality(that is, the full functionality of the IR PCB board) and assemble more IR PCBs.

=============== Week 10: =================
---------------------------------------------------BREAK---------------------------------------------------
=============== Week 9: =================
(my bad, I thought I did these and it went through to the website but I guess I must have forgotten to save or was not connected to the VPN or something while working on them)Entry 2: -----------------------------------------------------------------
Date: March 15thStart Time: 1:00pm
Duration: 5 hours
This session I generated the gerber files and checked that everything was in order, then got it checked by TAs and then submitted the PCB design files. First I submitted to PCBWay, because that was the vendor we had originally planned on using, and got it checked off by their team; then the TAs informed us that JLCPCB would likely be cheaper(it was way cheaper) and so we switched to them. We waited a while for them to check our gerbers and files; I had to resubmit once because I submitted the gerbers from the wrong version of the IR PCB, and then they took a while to recheck that. We then submitted the order with the assistance of the TAs. Hopefully next session the IR PCBs will all be delivered and I can start on assembly.

Entry 1: -----------------------------------------------------------------
Date: March 12thStart Time: 12:00pm
Duration: 4 hours
Implemented feedback given last week for IR pcb design. Added third mounting hole and moved them around to prevent flex, increased size of vias and width of traces, added exclusion zones around mounting holes to prevent ground plane from filling those areas. Also slightly adjusted dimensions and routing a few times. Next session I plan on submitting the purchase order and making any necessary final adjustments.

=============== Week 8: =================
(my bad, I thought I did these and it went through to the website but I guess I must have forgotten to save or was not connected to the VPN or something while working on them)Entry 4: -----------------------------------------------------------------
Date: March 6thStart Time: 11:30am
Duration: 2.5 hours
Slipped into lab for a short period to do PCB verification for the IR sensor PCB(used the old design without the 0806 resistor bc I was more concerned with checking the IR sensor footprints), did some final touches to the PCB designs. Worked on finishing touches for the project presentation, including creating a new slide for the packaging design illustrating the PCB connections. Practiced presentation a couple of times before the presentation itself.

Entry 3: -----------------------------------------------------------------
Date: March 5thStart Time: 8:00pm
Duration: 2 hours
Worked on the project presentation; finished the IR sensor PCB layout and schematic design slides, finished block diagram in Draw.io and put them on the slides.

Entry 2: -----------------------------------------------------------------
Date: March 5thStart Time: 12:00pm
Duration: 3 hours
Worked on the project presentation in Powerpoint; laid out basic format of presentation, started on block diagrams.
Entry 1: -----------------------------------------------------------------
Date: March 1stStart Time: 1:00pm
Duration: 2 hours
Worked on the IR PCB design; rerouted some of the traces, added mounting holes for the same type of screw as the main PCB, and spent some time making sure the rule checks all passed(had an issue with the mounting holes on the IR sensor footprints where solder masks were being clipped by one of the holes, but figured that wouldn't be a problem in the end). Also added ground plane fills to both layers, and switched resistor from a random throughhole footprint to an 0806 SMD. Added silkscreening for sizing and team information.


=============== Week 7: =================
Entry 6: -----------------------------------------------------------------
Date: February 28thStart Time: 10:00pm
Duration: 2 hours
During this session I worked on the IR matrix's PCB layout in Kicad. I followed parts of this tutorial to convert the schematic into a PCB layout, then added the constraints from PCBway into the file. I then added the traces, and spent some time trying to figure out a better way to route them. I plan on spending some time on the weekend adding things like test pads and routing the traces more efficiently so I can make the PCB smaller.

Entry 5: -----------------------------------------------------------------
Date: February 28thStart Time: 5:30pm
Duration: 0.5 hours
Checked in really quickly with everyone else; talked with Michael about testing a IR sensing matrix demo alongside the RFID sensor and the raspberry pi connected to the microcontroller via USB. We also talked briefly about the materials we would be using for the enclosure; we need to test whether the IR sensor functions if not fully inserted through the top surface, and if it does that has a large impact on our final design and the type of material we can use. Once I get home I plan on working further on the IR PCB design.
Entry 4: -----------------------------------------------------------------
Date: February 28thStart Time: 12:30pm
Duration: 3 hours
Talked about PCB design with Luke, confirmed the amount of connectors and such; started work on the IR sensing matrix's PCB design from the schematics Luke made, but stopped after loading the components into the PCB designer because I would prefer to do this with two screens at home.

Afterwards, me and Zach got into a discussion about the actual top surface of the board and how we would be mounting it, and so we went down to take a look around the machine shop. We took a look at the machines and then grabbed a piece of scrapwood to start messing around with. First Zach marked out the dimensions of the slots and the positions of the IR sensors on the wood, then we drilled a test hole for the IR sensor. We figured from that that we potentially dont need to insert the sensors through the surface like we had originally. That means we can also consider other materials for our surface, like acrylic or plasticard. Later, I plan on working on the PCB layout.
Entry 3: -----------------------------------------------------------------
Date: February 27thStart Time: 2:00pm
Duration: 2 hours
This session I started by working on the IR PCB design. I first made some plans on the whiteboard about where the connectors would go; I did some calculations and figured that the IR sensors for one card slot should be 1.5 inches from each other(assuming that one IR sensor is in the middle and will be covered by a card at all times, that the card itself is centered on the IR sensor, and that the other IR sensor needs to be covered when the card is sideways but uncovered when the card is upright; when the card is upright its width is 2.5 inches, so from the center it sticks out 1.25 inches; when it's tapped the card is 3.5 inches so it sticks out 1.75 inches; I figured that 1.5 was a good position between the two, as it allows a bit of leeway for if the card isn't centered in the card slot). So as an initial estimate the PCB will be ~6.5 inches long and ~0.5 inches tall.

Entry 2: -----------------------------------------------------------------
Date: February 26thStart Time: 12:00pm
Duration: 2 hours
During this session we talked about our PCB design and had some discussion about the physical design of the box. Luke was seeing a lot of rule check errors on the main PCB due to ground/power pins seemingly being misconfigured(grounds as power outputs and power pins as power inputs when it should be the other way around), and so we spent some time checking the documentation of the ESP32 and the buck regulator. During the meeting we asked and were told that this was an issue we could basically ignore, as it was likely just an incorrect model from TI. We also talked about ESD protection and other aspects of our PCB, and learned that we don't really need that much ESD protection because almost none of our components were really in contact with the user. This means our PCB design can be simpler, and informs what we need to put on our PCB. Next session I plan on working on the PCB design in kicad.
Entry 1: -----------------------------------------------------------------
Date: February 22thStart Time: 7:00pm
Duration: 1.5 hours
This session I worked on the software formalization report. I spent a lot of time reviewing our software and the previous reports in order to come up with a testing plan for some of the software components, and to create a basic software component diagram as well as a call structure diagram for our main function. In the next sessions, I plan on working on PCB-related tasks.

=============== Week 6: =================
Entry 4: -----------------------------------------------------------------
Date: February 20thStart Time: 1:00pm
Duration: 2 hours
Worked on updating journals, and on the Software Formalization report; did research into the software that we're using, including the RFID sensor's provided micropython library and Pygame, the library we're using to make the game on the Raspberry Pi.
Entry 3: -----------------------------------------------------------------
Date: February 20thStart Time: 1:00pm
Duration: 3 hours
We discussed the new IR grid sensing method a bit, before moving on to talking about the microcontroller diagrams that I had found yesterday. We confirmed with a TA that for the USB to UART input we could use an off the shelf breakout board, simplifying our design tasks further. Now, the only thing we need to do ourselves is hook up the breakout board to our microcontroller and program the UART connection. I did another cost comparison between the different PCB layout options for the IR matrix, and confirmed that using 2x2 card slot PCBs would be within our budget. The rest of this session I worked on the Software Formalization report, reviewing our software and the third party elements we were using.
Entry 2: -----------------------------------------------------------------
Date: February 19thStart Time: 12:00pm
Duration: 4 hours
Discussed the arrangement of the IR sensing matrix with Luke while he was starting the KiCad schematic. Explained the different options for PCB arrangements that I had come up with, shown below:

We talked about the different PCB size options, including why I had selected the 2x1 card slot design, to balance cost with the amount of wiring/soldering we would have to do. During the meeting we discussed this, and were advised that all of our options were more than in our budget, and that we should also pay attention to the amount of soldering and cables we would have to manage. Later, we decided that because of that, we would instead move to the 2x2 card slot design, which has 8 IR sensors and 4 card slots on it. We also realized while discussing that we don't need to do actual 'rows' and 'columns' in our sensor matrix, for scanning/reading; the only requirement is that we activate the sensors in groups, and read in one group at a time.

This new way of scanning the IR matrix offers a few advantages; Whereas before we would have to scan an entire 'column' of the sensors at a time(and so we had to scan both players every single cycle), scanning by groups like this means we only have to scan a player's cards on their turn. This means less data to manage at any given point in time; in addition, because we kept the design where we read in 8 sensors at a time, we can scan 3 times a 'cycle' instead of 6. We can also potentially decrease the power requirements this way, by selectively enabling and disabling the portion of the sensor matrix not in use.
During the meeting we also had a short discussion about power, specifically the power draw of the IR matrix(which had 48 IR sensors in parallel, with each sensor's LED running a current of 60 mA), but after the meeting we determined that the power draw for the matrix wouldn't be a big problem, and we implemented some strategies to negate some of the power draw issues present in our previous design, including putting 4 LEDs in series to decrease the total power draw.
We were also told during the meeting that we can't use the microcontroller dev board that we were using, and that we needed to integrate the chip into our design. This kind of threw off our plans because we had to start designing the chip into our PCBs as well. I spent some time researching online and was able to find the circuit diagrams for the dev board we were using. From these circuit diagrams, we don't need the power circuit because our power is coming from the raspberry pi, which has its own regulator; we don't use batteries so the LiPo charging circuit is similarly unnecessary; so the only circuits we would need are the reset(which boils down to a single button) and the USB to UART circuit. This solves our problem with the microcontroller circuit, and next class I plan on looking further into the requirements of our microcontroller.
Entry 1: -----------------------------------------------------------------
Date: February 15thStart Time: 11:00pm
Duration: 1 hour
Finished watching the Kicad tutorial vidoes today; did some research into parts sizes and specifications to determine an approximate size for the PCB. Also threw some PCB size estimates into PCBway to get a price estimate.
=============== Week 5: =================
Entry 4: -----------------------------------------------------------------
Date: February 13thStart Time: 3:00pm
Duration: 2 hours
Today I started watching the Kicad PCB design videos that Luke had gone through. I also came up with some initial PCB combinations;
Option 1 is to do what we were planning to do, with a single PCB per card slot and 6 connections per PCB, for a total of 24 x 6 = 148 connections. These boards would be around 1 inch height by 2-3 inches width each, saving a great amount of area compared to other options
Option 2 is to combine 2 adjacent card slots in a row onto a PCB, halving the amount of PCBs to 12 and decreasing the connections to 8(GND, 5V, 2 SNS for the 2 rows, and 4 EN for the 4 columns), for a total of 12 x 8 = 96 connections. This does produce a large blank space between the card slots, and the PCBs are somewhere around 1 inch in height by 6-7 inches in width. While we could consider the same for columns, that produces a much larger PCB in area(around 4.5 inches in height by 2.25 inches in width) for the same amount of connections and PCBs as Option 2, so I decided to shelve this option.
Option 3 is to combine an entire camp(a 2x2 set of card slots) into one. This does use a very large PCB, due to the distance between card slots, but only requires 6 PCBs and 10 connections per PCB(GND, 5V, 4 SNS for the 4 rows, and 4 EN for the 4 columns) for a total of 60 connections. This board has the largest area of all these options, however, at around 4.5 inches by 6-7 inches, and a majority of the center would be empty.
For all of these options, we could look at making PCBs that are not completely filled, but the cost estimates online tend to give estimates for filled PCBs. I plan on finishing the playlist over the weekend, and creating initial designs for the IR sensing matrix portions as well as doing a cost analysis on the PCB options listed above in my next sessions.
Entry 3: -----------------------------------------------------------------
Date: February 12thStart Time: 12:00pm
Duration: 3 hours
At the beginning of class, I discussed the IR matrix with Luke; he had worked on a 2x3 matrix before class, and was almost done. He pointed out that only one transistor was needed per IR sensor; this simplifies the design greatly, as that means we don't need 48 transistors and instead only need 6, in an arrangement as shown below:

We managed to get the 2x3 matrix working very well using manual enable inputs and sense line outputs. During our meeting, we asked about the week 8 requirements, and realized we didn't actually need a demo, just a finalized PCB. Afterwards, we discussed the progress on our different sections, and talked about some of our PSDRs. We put together a list of all our components to put on the bill of materials, and did some research into a new Raspberry Pi, to try and get more ram/processor power for our game. Though the lab has raspberry pi 5's available, the issue with these is that they only take power through a USB C with USB Power Delivery, at 5V 5A. The raspberry pi 3 we are already using and the raspberry pi 4 can both take 5V power through a GPIO input, which enables our PSDR for 12V to 5V conversion. I also drew some basic plans for the IR sensor PCB on the whiteboard at the end, shown below; each PCB in this plan would handle a single card slot, meaning it has 2 IR sensors on it.

One big issue that I realized is that with the 2 IR sensor plan, we would have a great deal of wiring to do. Each sensor has 6 wires that need to be connected; while the 5V supply and GND lines per board could be combined in a way that fewer connections are needed on the main board, and the same could be done for each column's enables and each row's sense lines, that still means we have 148 ports that need to be connected somewhere. Next session I plan on starting a kicad tutorial and beginning the PCB design in kicad, and also looking closer at the problem of the PCB arrangements.
Entry 2: -----------------------------------------------------------------
Date: February 11thStart Time: 1:00pm
Duration: 2 hours
I spent today beginning work on the IR sensor grid and discussing it with Zach and Luke. First, I explained how my design functioned to them; Luke then suggested that instead of using a NMOS like the one I had used previously, we should instead use a PMOS because it made control a bit easier. With a PMOS, we could directly control the gate voltage. I grabbed a few PMOS transistors from the lab(the IRF9Z24N and IRF9530), and we discussed which one we should use; eventually, we decided on the IRF9Z24N because the shop had more of them, and besides that the specifications on both were more than adequate for our use case. I also realized that I had been testing with 5V on the enable lines, when the microcontroller is only outputting 3.3V; I began to test with a voltage divider lowering the voltage to 3.3v using a 1.1 kOhm and 2.2 kOhm resistor. I was very confused for a long time because this didn't seem to work, and spent a while trying to debug this circuit, before Luke pointed out to me that I had set the resistors in the voltage divider backwards(dumb mistake, lol). After this, the circuit was back to functioning.
We also discussed the ruleset and clarified some things for updating our functional description. We determined that each player would start the game with 5 cards, and that players would have 20 health. After the board is plugged in, it will have a 'start game' message, and if players press the next phase button the game will start. We kept the turn phases about the same as before, but removed the second placement phase, so the turn phases are (Start -> Placement -> Battle -> End). We also dropped declaring defenders in order to simplify targetting and battle calculation; the attacker will declare their attackers, which will attack down a lane, and on the defender's side all of their creatures in that lane will defend. The defenders will be dealt damage in an arbitrary order; first the front right card takes damage, then front left, then back right, then back left - this way, there is little targeting calculation or input that needs to be done. Once the game ends, a 'game end' screen will appear, and players can press the next phase button again to start a new game. During lab tomorrow, I want to use the functioning IR sensor as a show-me-a-thing, and I plan on working on the grid of sensors.
Entry 1: -----------------------------------------------------------------
Date: February 10thStart Time: 2:30pm
Duration: 1.5 hours
Today I worked on fully finishing the IR sensor matrix demo; first, I split the 62.5 ohm transistor into two 124 ohm resistors in parallel in order to alleviate overheating issue, and this did work. While testing this, I also hit some frustrating behavior that I hadn't realized during testing last week, where the transistor was not turning off when the gate voltage was disconnected. I did some research online and found that circuits for transistor switches utilizing N channel transistors typically had a resistor bridging the gate and source. After placing a resistor with an arbitrarily high resistance of 1.1 MOhms in, the circuit functioned as planned.

With this, we now have a working circuit for a single IR sensor. Connecting the rest of the IR sensors for the matrix should be as simple as wiring GPIOs to the enable and sense lines; the enables of the sensors in a column are all connected to the same GPIO output, while the senses of all the sensors in a row are connected to the same GPIO input. I then spent some time grabbing all the components necessary to construct a 5x5 demo on the breadboard; the transistor I had used for testing was the RFD3055L, but the store did not have those so I substituted in the IRFB7545 that they had instead(though the transistors they had labeled on the box as IRFB7545 were actually FU120N's). In the next few sessions, I plan on working on a completed demo for the week 8 check, starting next session by testing the IR sensors wired in a grid with the enables controlled manually using a 5V input and the sense lines read using the multimeter, then working on the microcontroller control code.
=============== Week 4: =================
Entry 4: -----------------------------------------------------------------
Date: February 7thStart Time: 5:30pm
Duration: 1.5 hours
I worked on the IR sensor matrix demo, roughly calculating the values I needed for resistors in the sensing matrix. Luke also pointed out some areas where we would need additional resistors to allow the matrix to function, displayed below:

For the resistors on the photodiode, I calculated a value of 62.5 ohms, and selected some 62 ohm resistors from the lab to test with. For the resistor before the GPIO input, I picked an arbitrarily high resistance of 1 million ohms, under Luke's advice. I assembled a test circuit with a single photodiode, transistor, and 1 each of the mentioned resistors on a breadboard, as shown below, and tested it with a voltage supply value of 5V and connecting the supply to the GPIO output enable(the gate on the transistor).

This proved to be relatively successful, as the circuit did function as desired; the phototransistor was essentially disabled when the enable was held low, and only read a signal when it was plugged into the 5V supply. In addition, the photodiode was able to detect a piece of cardboard in front of it, and the voltage on the output dropped accordingly. However, the 62.5 ohm resistor did get very hot(though it did not burn), which is an issue I plan to bring up in our next group meeting. Through this, I was able to refamiliarize myself with using the lab equipment, which will help in future prototyping on the breadboard. I was also able to demonstrate that our basic IR sensor design works, and I am going to move ahead with assembling the full demonstration matrix.
Entry 3: -----------------------------------------------------------------
Date: February 7thStart Time: 1:00pm
Duration: 2 hours
I discussed the IR sensor matrix with Luke, and we figured out some of the design specifics. Specifically, we had thought the IR sensor matrix would work in different ways; his design had the GPIO output toggling the power of the rows of LEDs, and would read one row at a time using a single GPIO input, while my idea used the GPIO output to selectively power a column of phototransistors, and read the entire column at once using multiple rows of GPIO inputs, as shown below:

We decided to go with powering the column, as it allows a complete scan in fewer discrete steps. With this, our final design for the matrix and its connections are mostly set, and we just need to calculate values and pick out the optimal transistor to control the enable signal from the GPIO outputs.
Entry 2: -----------------------------------------------------------------
Date: February 6thStart Time: 12:30pm
Duration: 4 hours
This session, we talked about adjusting some of the PSDRs; I also discussed with Luke about the power requirements; the display from the last session takes a 12V 1A input to power the backlight, so we decided to change the power the transformer was outputting to 12V, and then step that down as our PSDR; in addition, we figured out that the microcontroller can take 5V and step it down internally to 3.3V, so we don't actually need to do that ourselves. The sensor matrix and buttons can all function at 5V, so we ended up changing our design to only have the 12V(for the display) and then stepping down to 5V for the other components. Afterwards, I worked on the Component Analysis with Zach, and we laid out the core items we wanted to talk about in it and made some initial progress on a Google Doc. Through this, we mostly finalized the list of core components we need. Next session, I plan to work on the IR matrix demo.
Entry 1: -----------------------------------------------------------------
Date: February 5thStart Time: 12:30pm
Duration: 4 hours
This session, I mainly worked on component selection. I looked at different PCB layout options and display options, using online resources to check prices and find potential vendors/models. We ended up deciding on a method for laying out our PCB design, and we looked through many options for displays and ended up picking one that fit our requirements fairly well. I learned about some websites we could look to in the future to buy parts, and about some ways to connect multiple monitors to a Raspberry Pi, but also the limitations of doing so. Picking and buying these parts immediately is crucial to prototyping and to our final design's characteristics. Next, I plan to work on some of the demos for week 8, and in my own time try to learn PyGame to help program the software component on the Raspberry Pi, as well as finish some KiCad tutorials.
I started by spending some time figuring out how we wanted to handle the PCB layout; because we have the IR sensing matrix, we need a lot of components placed over a wide area, so we needed to choose a method to decrease the footprint of the final PCB we design and thus decrease the amount of our budget we would need to spend on the PCB design. We settled on two options; first, have one long PCB per row(or switch the axis and have one per column), and those PCBs would all have cables to run signals into a central PCB housing the RFID sensor, microcontroller, power circuits, etc. We also changed some of our design plans; instead of having an IR sensor in the "top" of the card slot(as depicted below) to detect card placement and another on the side to detect tapping, we could instead do one in the middle for card placement and one on the side for tapping.
This is what allowed us to consider singular long PCBs per row; our initial estimates of the size of each long PCB came out to around 1 inch in height by around 24 inches in length; the 1 inch to allow space for components to be placed and traces to be arranged around the components, and the 24 inches as a rough estimate of the length it would take to span from the first sensor in the row to the last sensor. This would allow us to do a minimal amount of wiring, with only 7 PCBs total, while cutting out a lot of empty space from the PCB. It would also allow us to have some of the logic components on each sub board, cutting down the elements we put on the main board.
The second option was to make one small PCB for each card slot, alongside the same central PCB for computing and other primary functions as described earlier. The card slots would still have the IR sensors in the middle/side arrangement as described in option 1, allowing for them to be a small rectangle; there would have to be 24 of these card slot PCBs, and initial estimates of the size for each of these was around 1 inch by 2 inches; 1 inch to, again, allow space for traces to be routed and components to be placed, and 2 inches to reach the positions of the 2 IR sensors in each card slot. The disadvantage of this method is that there would be much more wiring to do, with 24 different PCBs, and we would have to do a lot more of the logic on the main board.
I then used PCBWay to generate a quote to estimate the prices; I used default settings for most of the technical aspects, only putting in the sizes and quantities of each board. For the long boards, we would have to buy 10 at minimum, leaving 4 boards potentially unused, and the price quote comes out to $173.45 including shipping; for the small boards, we would have to buy 25 minimum, leaving only one board unused assuming they all work, and the price comes out to only $38.88 with shipping. Thus, we decided that the small sub boards would be the optimal way to go, considering the large difference in price.
We also looked at different displays for our project. Optimally, our display needs to be somewhere under 8 inches by 20 inches, or about 200mm by 500mm, so that we don't have to expand our design's dimensions further; and within those limits, we want that display to be as large as possible in order to allow players to see things clearly. Our display also needs to be compatible with the Raspberry Pi, and preferably has a touchscreen to allow us more options when making our software, instead of locking us in to a limited selection of hardware buttons. We viewed many options, and the following were some of the most promising combinations/options we considered:
First, there are many wide and short displays like these in varying sizes. For our board, we could arrange the displays to have one per player. Another option with multiple displays was to use many smaller displays, one for each lane or one for each lane for each player, but we discarded this option fairly quickly before looking at smaller monitors because of the amount of processing and IO that would require; looking into this option also made us discard the first option, as even setting up 2 displays on a Raspberry Pi is a challenge according to online forums and help board discussions we found. Our final option was to use a single display and just get one that fit our size requirements, but that was difficult because of the dimensions and aspect ratio of the area we were trying to fill. We eventually settled on this display, which is a decent size, has a touchscreen(which may come in handy later for our project), is compatible with the Raspberry Pi, and also fits almost perfectly into our dimension requirements, with the option that doesn't include a case. We were also able to find this item on Amazon,, which allows us to order and receive the display as soon as possible.
=============== Week 3: =================
Entry 4: -----------------------------------------------------------------
Date: January 30thStart Time: 12:00pm
Duration: 4.5 hours
This session, I researched the pin connections between the raspberry pi, our microcontroller, and the RFID sensor. The raspberry pi had the capability to do whatever connections we needed, our preference being SPI, so that had no issues. The microcontroller we are planning to use, the ESP32 Documentation
(ESP32 Pinout), had enough ports for all of the components we wanted to connect to it - namely, 14 GPIO ports for the sensing matrix, ~4 connections for SPI, and some GPIOs left over for buttons. One potential problem that came up, however, was that we couldn't find many resources for the RFID sensor board we were issued - online resources, like this one, had no details on specific pin arrangements for anything other than I2C communications. After talking to several of the TAs, we figured out what pins we would need to use for SPI, and confirmed that our microcontroller should be capable of interfacing with it. We also discovered this github which contains example microcontroller code in C++ for various modes of communication including SPI and I2C, that we plan on using to inform our own communications.
Entry : -----------------------------------------------------------------
Date: January 29thStart Time: 7:30pm
Duration: 30 minutes
This session, I updated some of the whiteboard drawings(pictures pending) and wrote out the game rules on the board.
Entry 2: -----------------------------------------------------------------
Date: January 29thStart Time: 12:30pm
Duration: 4 hour
This lab session, we discussed and decided on a final game framework, drawing on the board and discussing functionality. Each player will have a deck of cards, and we plan on implementing cards in the following order by decreasing level of priority: Creature cards Spells, attacking players or creatures Spells, healing players or creatures Spells, to buff creatures Additional types/modifiers for creatures (Stretch) Other types of spells(Stretch) Players will use mana to cast cards; each turn they gain an additional mana(So turn 1 they have 1 mana, then turn 2 they have 2, etc. etc.). At the beginning of the game, players will chose the lands they want per lane. Lands will interact with some creatures and spells, affecting some of their stats and effects. Creatures will have health, which does not regenerate each turn, and a power/attack stat; we are using the concept of summoning sickness from MtG, where creatures cannot attack on the turn they are placed. Turns are split into phases as follows; START OF TURN -> Player Draws Card -> Player Placement Phase(Can Place Cards) -> Player Attack Phase(If Player Has Creatures, Can Attack Other Player) -> Other Player Defense Phase(Opponent Declares Defending Creatures) -> Attack Resolved -> Player Placement Phase(Can Place Cards) -> End of Turn There will be a button to move on to the next turn phase. After lab hours ended, I spent the rest of the time practicing soldering and desoldering, and attempting to desolder one of the screens we checked out. The previous team had left solder and broken off wires in some of the throughhole connections, and to remove them I first heated each soldered connection, then pulled the wire piece out with some tweezers. Then I used a desoldering wick to remove most of the solder, and then a desoldering gun to suck up the remaining solder in the hole. One connection was behaving weirdly; it seemed to have some sort of additional substance in the hole, so the solder wasn't melting. Next session, I plan to look into the microcontroller and raspberry pi connections, as well as the firmware and programming languages we need.
Entry 1: -----------------------------------------------------------------
Date: January 28ndStart Time: 5:20pm
Duration: 1 hour
We met shortly after lab to discuss how we wanted to implement our game into software, and a general framework for our game. We picked out some ideas for preliminary turn order and core aspects of the game, and some basic guidelines for what the software would manage. Players each have 3 lanes, as depicted below. Players can place creatures into each of the three lanes. At the time we didn't make a final decision on how we would handle attacking; one option we were considering is that creatures would only attack/defend down their lane, so they cannot do anything to creatures outside their lane. Another idea is that, like in games like Magic: The Gathering, creatures in any lane attack the enemy player, and the enemy player then uses creatures from any lane to defend.

Software on the Raspberry Pi will track game state information, including player health, turn number, turn phase, and card position/data. The microcontroller will manage and interpret sensor inputs, including from the RFID sensor through SPI and from the IR sensor matrix through GPIO connections. The microcontroller and the Raspberry Pi will communicate via SPI. Next session, we will try to make a final decision on game rules as well as what the software will handle.
=============== Week 2: =================
Entry 3: -----------------------------------------------------------------
Date: January 22ndStart Time: 8:00pm
Duration: 1 hour
Filled out journal entries and summary, changed several website pages.
Entry 2: -----------------------------------------------------------------
Date: January 22ndStart Time: 12:00am
Duration: 4 hours
We spent this session further narrowing down our project requirements/PSDRs. First, we came to a consensus that we would use IR sensors instead of simple photoresistors, as it would make sensing the cards less finicky. We also decided that we would have the ability for cards to be "tapped", or turning them sideways to indicate some sort of game usage - we would implement this by enlarging the card slots, expanding the size of the board again. The tapping mechanic required a second IR sensor for each slot; to detect the tapping, we would have a sensor that sits at the top of the slot, and one that sits at the side, arranged so they only detected the card in that position. This doubled the amount of IR sensors we needed to connect, so we decided that we'd use a scanning matrix system to connect the sensors to the board - this would decrease the amount of GPIO connections from 48 to 14. Some planning pictures of the grid are attached below.


After figuring out the design for the IR sensor scanning matrix, we updated our PSDRs to be more detailed and reflect our new design specifics. We also figured out the other hardware specifics, including how the IR sensors worked, and picked prototyping components including a touchscreen LCD, Raspberry Pi, RFID scanner, and RFID tags. Afterwards, we spent some time working on A2.
Entry 1: -----------------------------------------------------------------
Date: January 22ndStart Time: 12:00am
Duration: 4 hours
Worked further on figuring out editing the website. We found out that the reason the edits to the header/footer/navbar seemingly weren't working was because our browsers were caching those parts of the pages, and that our edits were going through but we couldn't see them. To fix that, we started using incognito browsing in order to clear the cache each time we saw the website. We made some changes to the website, and spent most of the rest of the lab discussing the specifics of the game and working on A2. We changed some of the design elements from the original in week 1; we narrowed the game board from 4 to 3 lanes, and added a row of cards to each lane on each side, making for a total of 24 card slots(4 per player per lane). This also decreaseds the size of our board, but we decided that it was acceptable for now. We also met with the TAs at the end of lab time and discussed our project.
=============== Week 1: =================
Entry 3: -----------------------------------------------------------------
Date: January 17thStart Time: 12:00am
Duration: 2 hours
We spent this lab working on the final project proposal. First we discussed the specifics of the project, and tried to set some more concrete specifications for our design - we decided on an initial board layout so we could get a count of the amount of sensors we would need, and also picked the sensors we thought would be best to use for our project. Then we assigned team roles and homework assignments, and based on our earlier discussion of the project specifics wrote our initial PSDRs, and filled out the final project proposal.
Entry 2: -----------------------------------------------------------------
Date: January 16thStart Time: 3:30am
Duration: ~1 hour
We spent most of this session discussing the final project proposal and getting familiar with the website, since none of us had much HTML experience beforehand. I spent a decent amount of time trying to figure out how to edit the header and being unable to, and I changed the project name/description on the index page.
Entry 1: -----------------------------------------------------------------
Date: January 15thStart Time: 12:30am
Duration: 2 hours
First meeting; we discussed our project requirements, went on a tour of the lab, did the basic setup of the website on the group account, and spent most of the time setting up the network drives on our personal laptops because the network drives weren't connecting properly. We tried several things, including trying to sign in with multiple accounts; eventually I figured out that every time we tried to map and failed to connect, it would create a new profile/drive that didn't show, and I was able to map the drive to my laptop after removing the previous profiles. We also discussed the physical aspects of the board, including dimensions of the board top and what we wanted to make the board out of, and made several planning drawings like the one below. At the end, we decided on a preliminary design of 4 "lanes" for cards, each "lane" with 2 slots for cards, and a large screen in the middle separating the two players.

EXAMPLE ENTRIES BELOW
EXAMPLE ENTRIES BELOW
EXAMPLE ENTRIES BELOW
EXAMPLE ENTRIES BELOW
EXAMPLE ENTRIES BELOW
=============== Week 2: =================
Entry 3: -----------------------------------------------------------------
Date: January 21stStart Time: 10:50am
Duration: 2.25 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-
Entry 2: -----------------------------------------------------------------
Date: January 20thStart Time: 4:25pm
Duration: 2.5 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-
Entry 1: -----------------------------------------------------------------
Date: January 20thStart Time: 11:37am
Duration: 1.25 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-
=============== Week 1: =================
Entry 3: -----------------------------------------------------------------
Date: January 14thStart Time: 10:50am
Duration: 2.25 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-
Entry 2: -----------------------------------------------------------------
Date: January 13thStart Time: 4:25pm
Duration: 2.5 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-
Entry 1: -----------------------------------------------------------------
Date: January 13thStart Time: 11:37am
Duration: 1.25 hours
-Discuss your project meeting/work for this entry here. Make sure that this is from your individual perspective and include images, video, and other graphics (just like this, but change the image size to match the aspect ration of your image).
Follow the guidelines presented in the Individual Project Journal Policy that is posted on Brightspace. This is a template entry; simply copy/paste this entry and overwrite for each journal entry. Don't forget the weekly delimiter-