Category Archives: Engineering Course

Nexys 2 FPGA CALCULATOR

Team Members: Nicholas Bilcheck, Sam Greenberg, and Hang Ha

Project Title: Nexys2 Calculator

Project Objectives:

The goal of this project is to develop a broader understanding of Verilog and the Nexys2 board to develop a functional and useful product.  The product for this project will be a calculator whose functionality is limited only by time constraints. In order to develop a calculator, knowledge on components that can be used with the Nexys2 board to make a more practical device will need to be obtained.  These additional components include but are not limited to a keypad for inputs and a LCD display for outputs. In order to power the LCD display, knowledge on how to use an arduino to supply 5 V will also be required. In addition, further knowledge of Verilog will be required to input values from separate components, use those inputs to perform calculations, and then output those results to various screens.  This knowledge will likely be obtained initially from instruction sets and other guides made by the developers of the Nexys2 board, the keypad, and the LCD. Using these guides will allow for an understanding of how integration between the modules and physical components will work. Furthermore, our goal for this project is to implement and master the modules necessary for storing and managing our data on the calculator and implementing the add, subtract, multiply and divide modules.  A significantly challenging task for this project will be displaying the values on the LCD in our calculator. In addition, attempting to take further advantage of the LCD to display operators and previous entries will be later goals that will hopefully be achieved. A successful final project will have lead our group to obtain and understand the knowledge necessary to develop a calculator for the Nexys2 board involving all the functionality previously discussed, while adding further functionality as the project progresses and always being open to improving the final project. 

Hang is in charge of the inputs. This includes the keypad and buttons on the Nexys2 board. Hang will need to implement modules to correctly receive input from the user and interpreting that information as a 4-bit number. She will then have to convert that into its decoded meanings – numbers and operations. In addition, she will have to figure out how the keypad works in terms of how to wire the keypad to the board and how to supply and read voltages to understand the outputs from the device. When she has finished that she will be assisting Nicholas with his section of the project.  Along the way, she will work on integrating the various project components together.

Sam is in charge of the computational aspect of the project. He will have to implement the different computational algorithms which include addition, subtraction, multiplication and division. Implementing these modules may be as simple as just using the operators or may involve writing individual modules to perform the operation.  At later stages of the project Sam will also need to implement these operations, possibly with possibly negative numbers and order of operations. Sam will then need to pass the stored values to Nicholas for his phase of the project.

Nicholas will be using the information sent to him from Sam’s phase of the project to display on the LCD display the information stored in the calculator. This will include the previous number, the operation, and the result. Nicholas may eventually, if time permits, need to learn how to display “scrolling” information to allow the user to read text longer than the LCD display will allow.

There are three big portions in the block diagram: The keypadToHex decoder, the processor, and the output. 

The keypadToHex decoder: this block will receive an input from a 4×4 keypad, and figure out which button was pressed using the keypadScan module.  The keypadScan module will be made up of a multiplexer and an FSM . There is also a debouncer inside this block so that inputs from the keypad function properly. The output will be a hexadecimal value that indicates which value is pressed of the inputs whether it is a decimal value, a clear function, or an operator. This block is of difficult complexity and Hang works on this module.

A delay module is used to delay the key-pressed signal so the keypad scanner and the computational module can work together.

The computing module: this block receives the hexadecimal input from the keypadToHex module. The code involves a case/if statement to navigate through different arithmetic modules and produce the result of the equation as the output. This task is very difficult and Sam works on this module.

The result from the computational module is connected to a binary to decimal converter, which divide the result into hundreds digit, tens digit, and one digits so that it can be easily displayed on either 7 segment display or LCD.

The hexToAscii module converts hex value to corresponse string value.

The storeEq module store the equation string until the equal button is pressed. At that point, the result of the equation is assigned to the equation string.  

The LCD module: this block receives inputs from the memory block to display equations and results on the LCD display. This task is very difficult as well. Hang and Nick work on this module. 

How the module will be tested: The methods of testing will mostly involve having the Nexys2 board run the module. For the keypadToHex decoder, there will be the 7-segment-display on the board show the value of the button pressed. For the arithmetic module simulations will be run as well as physically using the Nexys2 board.  For the LCD display, the only method of testing that will be used is attempting to display and change outputs on the LCD display properly.

[Research] Analysis on Smart Residential Microgrid Testbed

I, powerParser.py

This program will parse all the important data in all the log file that in place in the same folder with this program into 1 single csv log file. This only parse the power data with the unit of kW. There are 3 mode: 1 (5 min data), 3 (15 min data), and 12 (hourly data).

Some of the label of the output log file is explained below:

  • Utility: The total power of the system
  • P_ab: Power from panel a and b (similar to Utility)
  • PV: Power generated from PV system
  • Demand: Power used by load in the house
  • P_unmetered: Power of loads that are not metered by the AccuRev

When run the program, it will ask for the path of the folder. Put in the full path of the log folder. Don’t use any extra character. Then when it ask for output file name don’t put in “.csv”.

II, parser.py

Similar to powerParser in term of parsing data, this program is suitable for parsing a single or small amount of log files. Put in the “files” list all the name of log files you want to parse in the form of Python string and run the program.

III, PV_analysis.m

From ENGR 100 lab. Basically it will parse the PJMLMP, PJM Load data and PV data and generate graphs.

IV, datalog_analysis.m

This MATLAB program will plot all the power data from all channel and also generate another plot with only load power data. Besides, another output is the txt file with has maximum, minimum, mean, median of each channel.

Put all the data file in one folder to do analysis.

[ENGR251]Final Project – One Dollar Glasses Bending Tool

For final project, we focused on eye care for third world countries. A German company started an initiative known as onedollarglasses.org to provide inexpensive glasses for those in impoverished areas. On-site production of these glasses is enabled by the company’s creation kit, a small bending machine that forms spring steel into a basic, round glasses frame. However, the purported price of the box is over $2500 USD, which severely limits distribution to only significantly invested or incredibly motivated entrepreneurs. 
To eliminate this significant barrier to entry, the goal of our project is to produce a more economical design for the bending machine that can recreate or emulate the style and structure of the glasses frames built by the One Dollar Glasses organization, making efficient designs and material choices to reduce the total cost of the optician’s kit and make the fabrication process more intuitive.
csm_OneDollarGlasses_boy_l_d7f3640a10

Figure 1: A child wearing the one dollar glasses

eindollarbrille1

Figure 2: The one dollar glasses

The_Glasses_04.18b7a49c660fc14a6bc8ba46f27709da46

Figure 3: The first bending tool

Slideshow_06.d407e388cf17160919aeea7b81e300cd3

Figure 4: The second bending tool

To determine the efficiency of the bending box, a model of the bending machine was reverse-engineered from specifications from the training manuals on the One Dollar Glasses website.
bending3
bending1

Figure 5: The reverse engineered bending machine

With the knowledge and experience from the reverse-engineered model, some fundamental concepts for design were established for creating a more intuitive and inexpensive system.
bending2

Figure 6: Concept sketch of one of our ideas

d1a6972621f189df78c321cf2b5e98dc

Figure 7: Dubro EZ Wire Bender

Commercially available at $24.95, the DU-BRO E-Z Wire Bender provided the most effective design for making precise 90o bends. Because the wire is placed between two ridges in the casted die, the bend is not only secured on both sides, but is also guaranteed to bend to exactly 90o due to the angle of the ridges accounting for springback of the wire. This repeatable system of making 90o bends without guesswork or slipping makes this product the most efficient system for making wireframe glasses, reducing the occurrence of irreparable mistakes in the frame fabrication process. In line with the fundamental concepts of design for the project, the final design for the bending machine was based off of this design, with minor adjustments made for the dimensions of the ridges to match the notch lengths of the wireframe design.
bending4

Figure 8: SolidWorks design of final prototype (Dubro EZ Wire Bender)

In the end, for this project, we dis a lot of analysis and try to find out the best possible solution for this. It is unexpected that there is an existing commercialize product that perfectly solve our problem, and we glad we found it.

[CSCI 204] “Iron Mario” Game

“Iron Mario” is my biggest project for CSCI 204. It is originally a Mar Rover game but in the final phrase I re-skin the game into a “Mario” game to make it more coherent and interesting. The making of this game applied some fundamental tool and concept in computer science: object oriented programming, linked list, stack, queue…

ironmario1

The above screen is the openning screen of the game. The rule is that player use arrow button to move Mario around the map, collect items to inventory and use those item to perform tasks.When Mario step on a pipe, he is teleported to a new map with more items.

ironmario2
When got lost player can click “show the way back” button. The portal that Mario last entered will change color and player can use that to come back to main map.
ironmario3
When player collect enough item for a task, he/she can hover Mario above the part needed to fix and click “Perform Task”, the robot part will turn into Iron Man part. The picture above show the finished game with the whole Iron Man suit appeared.

The code of Iron Mario can be found at my GitHub: csci204_ironMario