Week 4 Status Update

This is was our final week of work. Our goals for this week were to implement the EEG reading system, finish the RTC implementation, finish the alarm system including adding audio, and add a dimming feature to the screen. We were able to accomplish most of these goals and consider this week to be a very successful one.

Rich primarily worked on the RTC and alarm control system updates for this week. We were able to calibrate the RTC to a more accurate timing and further update the functionality of the clock, including setting the clock time with touch screen controls. This proved to be much more difficult than expected because of the strange format in which the the clock values are set in software–they are set in hexadecimal BCD format. We were able to do this most effectively by converting the value on the screen to a String value and then converting this string to an integer using base 16. We also encountered a lot of problems using the touch screen controls along the way, but we were able to find solutions to all of them. Rich also worked on implementing the alarm time control features using similar methods. In addition, we implemented the alarm signalling and were able turn on and off the alarm so that an audio signal was sent to the DAC whenever the real time matched the alarm time. The alarm can be turned off using touch screen controls.

Kyle primarily worked on the EEG reading aspect and was actually able to make some progress with it. The main problem he faced was the functionality of the FIFO buffer on the UART receive peripheral. The buffer was filling up and then rejecting values and we could not figure out how to clear the values from the buffer. We were able to find a way to do this and fully read and parse an EEG data packet sent out by the Mindflex headset. These data values can be printed on to the screen and were implemented as a control feature for the alarm. The alarm control checks a certain frequency band for intensity spikes once the real-time clock gets within a certain time range of the alarm-time, and if there are enough, this indicates a light sleep state. If a light sleep state is detected the alarm is triggered, waking the user up in an easy way.

Jae worked on the dimming the feature of the screen this week. He was able to get the feature worked and set 5 individual brightness levels on the screen. He worked on this aspect in parallel to the Real-time clock on a separate board. When we tried to integrate his feature with the main board we were working on, we had some issues getting the desired functionality. The screen will dim, but it will also blink with the high intensity. We are still working on a solution to this problem.

It is also important to mention that throughout this project, all members of this group helped each other with their respective tasks, other than just working on their own decided responsibility. E.G. Rich helped with the EEG headset, Kyle and Jae helped with the clock, and Kyle and Rich helped with the dimming features. Plans for the future include improving touch screen performance, improving clock accuracy, getting the dimming feature working in the fully integrated board and improving the EEG control system to better detect light sleep states.

Week 3 Status Update

Our primary goals for this week were to further implement the EEG reading systems, fully get the real-time clock and alarm clock controls implemented and also begin setting up the audio system of the alarm. We had difficulty accomplishing all these goals mostly due to being away for Thanksgiving break however we did managed to get some things accomplished.

Kyle primarily worked on the EEG portion of the system again. Since we were having difficulties implementing the EEG reading last week, we did a sanity check with the headset using the chipKit UNO 32 board. This source code we are using to base our code off of was originally meant for use on this type of board. We were able to the EEG reading fully working on this board. We also tested the reading using the computer Putty terminal. The text read by UART using this was unintelligible however it was being read once per second. Trying to again implement the UART reading on the PIC32 we were having issues reading the UART register. We are able to get 9 readings off of it and then the program freezes, however we do seem to be reading the correct integer values.

Rich primarily worked on the clock portion of the project again. We were able to get the set real-time clock functionality working and was able to implement the set alarm time functionality working. We were also able to get the alarm control system working and all that is needed now in that portion of the project is to add the audio to go off when the alarm is triggered. We are almost done on the actual digital alarm clock portion of the system. It should be easily accomplished.

The main challenge right now is the EEG readings. We will need to consult our lab instructor in order to figure out our issues with UART as we feel it is majorly blocking necessary progress.

Week 2 Status Update

This week our goal was primarily to implement the alarm clock control system. We wanted to get the alarm button working to see the alarm time, be able to change the alarm time, and be able to turn the alarm on and off. In addition to this, we wanted to be able to set the time of the normal clock. Second, we wanted to begin testing the capability of the EEG headset we were planning to use and begin trying to read data off of the headset. The goal for us was to get the data in a somewhat functional format.

To address our first goal of implementing the alarm clock control system, we did not fully implement the alarm system yet, however we did make a lot of progress implementing the Real-Time Clock (RTC). We have the external oscillator wired up and we are managing to use it to control our clock value. We are also able to set the clock value at anytime. We should pretty easily be able to fully implement the alarm system in the coming week with the RTC working and all of our touch screen buttons and time setting controls working perfectly. Rich primarily worked on this portion of the project.

week2Oscillator

We also managed to make a lot of progress with the EEG headset. Kyle primarily worked on this part of the project. We found that the headset was working as expected and we still believe that the headset will be useful in our system. This week we soldered some connections onto the chip in order to get packaged data off of the chip. We connected the data lines to the set RX pin on the PIC-32 and began trying to read the data from the headset using the UART functions in the PIC-32 peripheral library. We based the code to package the data in our system off of the Brain project to read data onto an Arduino board. Link to GitHub project: https://github.com/kitschpatrol/Brain

Unfortunately, we still have not been able to package the EEG data correctly. We believe this to be an error in the way we are using the UART functions. We plan to attempt to learn more about the UART functionality on the PIC32 this coming week.

Week 1 Status Update

This week our goals were to get the LCD display up, get the touch screen working and implement the Real-Time Clock (RTC) into the system. Our first goal of creating an LCD display was easily accomplished. We set up a cool display with some nice looking 3D buttons to control the time and the alarm as well. The display also include some digits to display the time and a portion to determine whether it was am or pm. Kyle spent most of his work time on this part of the system. The next portion was implementing the touch screen to control the buttons on the screen. Rich worked primarily on this portion of the system. We do not have the touch screen fully working, however we are very close.

week1LCDDisplay

Unfortunately, we were not able to implement the Real-Time Clock (RTC) at this point in time, although we did begin working on it and have the software aspect mostly figured out. The blocking factor on the RTC was not having the appropriate hardware. We need an external oscillator to implement the RTC, specifically so that it will not reset when power is removed. In addition to these goals, Jae worked this week on beginning research on EEG brainwaves and signals in relation to sleep. We will need these sources and information once we begin processing the EEG signals to determine sleep states. This coming week we will do a lot of experimenting with reading EEG signals off the MindFlex headset which just arrived this weekend.