zondag 28 november 2010

Attempt at creating my own simple MIDI controller


I started on a new project, converting a cheap toy piano into a MIDI keyboard. The toy piano has 23 keys, which it reads using a 4x6 grid of scanlines. The resistors are already in place, and fortunately there are places for me to solder my wires to. The PIC16F690 should have enough pins (I only need 10, it has 20), and I already have MIDI code for my Beethoven playing box, that I described earlier. Hooking up a MIDI output is very easy as well: just connect +5V to pin 4 of a 5-pin female DIN plug with a 220 Ohm resistor, and hook up the TX pin of the PIC16F690 to pin 5. The step I forgot before is that pin 2 definitely needs to be grounded, so don't forget that. You can of course also use sketch one or sketch two, or any of the others found on the Internet.

I used the Pic kit 2 to try different voltages, and the MIDI works with my CASIO keyboard even at 2.5V. Since the piano has a 3V battery, I was glad to see this. Using 3V of course makes it not entirely MIDI compliant, but I'm sure most pianos will behave just fine with it.

maandag 4 oktober 2010

Heart rate monitoring 10

This is another walk from that same trip, this time steeply uphill and downhill, to the Bumpass hell from lassen volcanic national park. Heart rate bumpass hell walk

As you can see, the uphill part had a significantly higher heart rate than the downhill part, with a slight break in between, where I discovered I had cell phone reception and sent and received some text messages.

maandag 20 september 2010

Heart rate monitoring 9

It has been a while, but in August I went to Vancouver with my parents, and hiked in various national parks on the way. Here is the graph from the second hike, which was through a forest, on level ground. The forest was beautiful, but there wasn't much variation in heart rate.

Heart rate walking through forest.

maandag 12 juli 2010

Heart rate monitoring 8

This month the "An analytical approach to club dancing" classes started, and I decided to measure them as well. As you can expect, the analytical approach (green) is a lot lower than the beginning hip hop (red):

Beginning hip hop vs. the analytical approach to club dancing, heart rate.

vrijdag 25 juni 2010

Heart rate monitoring 7

Because of the heart rate monitoring, Anna Botelho asked me to check my heart rate during another class of hers called "Dancing around the world". It doesn't focus on the moves at all, and involves many different dance styles, most of which were quite confusing. Here is the graph comparing it with Shaira Bhan's class, of that same week:

Heart rate comparison between Dancing Around the World and Bollywood

The only clear difference is the start, which is partly due to me being on a treadmill (since Dancing around the World is at the gym) and partly because the Bollywood class (the red line) has a longer warming up (I think this is because people generally show up in the middle of the Dancing around the World class, which means warming up makes less sense). However, if you look at the details you can see that the activity level during the Dancing around the World class is higher (the green line is more often above the red line than the other way around). The software stated I burned 1323 kCal during the Dancing around the World class, but as I stated in my previous post, this should probably be 20% lower. It is still the highest of all activities so far.

For completeness, here is a comparison between "Beginning Hip Hop" and the "Dancing around the World" class:

heart rate of Beginning Hip Hop vs. Dancing around the World

It isn't difficult to guess that the Beginning Hip Hop is in red. I guess some would say that my heart rate peaking at 190 bpm is not a good thing, and an average of 171 bpm is not a good thing either. However, I feel fine. I'm in far more pain with certain flexibility requiring moves than I have with continuous jumping.

And finally, a more relaxing graph: me sleeping.

Heart rate while sleeping

The graph looks busy, but the scale is actually quite narrow. I like the part where my heart rate drops down to 51 bpm. I'm also impressed how quickly it can go from 60 to over 100 (this usually happens when I stand up, so I guess I got out of bed at that time).

donderdag 24 juni 2010

Heart rate monitoring 6

A day later, and now I can compare two Beginning Hip Hop classes from Anna Botelho with each other:

Heart rate of two beginning hip hop classes

You can clearly see each time she explains things, and each time we're practicing that particular move. The green graph is the latest class, which was a little bit more intense than the previous one.

The software calculated 677 kCal burned, however, I was told these numbers are a bit high, so I checked how they are calculated. It seems that without knowing my VO2/max it is impossible to get a proper number, however, the software clearly things my VO2/max is higher than it actually is. So it is likely you have to reduce the numbers by 20%. I'll see if I can establish my VO2/max value at some point.

woensdag 23 juni 2010

Heart rate monitoring 5

With another week came more dance classes. First there was another class with Shaira Bhan, which allows me to compare two weeks of classes in one graph:

Heart rate comparing two Bollywood dance classes of Shaira Bhan

Green is the most recent dance class. As you can see, this time we didn't get our rest period practicing jumping up in sequence. The knee jumping was present (and brought my heart rate up to 188 in the second part, where we had to move the hands in the opposite direction of usual) and the circle "boot camp" was more intense as well. The end result was a total of 1113 kCal burned, which is higher than last time.

dinsdag 22 juni 2010

The turret project

Just to let you know what I'm currently working on (apart from editing my book): getting the ISD4002 to play sound. I hooked it up to a PIC18F2450 (first time I'm using an 18F series microcontroller, but getting it to work was relatively easy). My first issue was that the ISD4002 uses 3V, but I used an LM 317 equivalent to create a separate 3V supply. 3V into the miceocontroller is no problem (2V is considered 'high'), but the output needed to be scaled down. There was a solution on the Internet using a resistor network with a 1.5k and 1k resistor, but I decided to just toggle the TRIS register and have a pull up resistor to 3V, making the output switch between 0V and 3V.

I thought I had everything coded correctly, but recently understood that the CLK can't have a frequency higher than 1,000 kHz (which some interpret as 1 kHz, but I think it means 1000 kHz). Since I'm clocking at 10 MHz, I might need to slow things down a bit, still. I'll try later with a shorter delay.

The biggest problem is that I can't test what fails: I have to first record something, and then play it back. So I never know whether the recording or the playing back goes wrong. I might have to look at the responses from the chip to see if that indicates something.

donderdag 17 juni 2010

Heart rate monitoring 4

Yesterday I went to the "Beginning Hip Hop" class again, with Anna Botelho. This is a fun class, and although there is some exercise involved, it certainly isn't the same as Shaira Bhan's class. And this is quite visible in the heart rate graph:

Heart rate while dancing, Bollywood vs. Beginning Hip Hop

Green is the Bollywood class, discussed previously, and red is the Beginning Hip Hop class, where we practiced turns. Focusing on proper execution of dance moves is clearly less intensive (although, in my opinion, far more difficult) than letting yourself go in Bollywood mayhem. The software that came with the watch agrees: I "only" used 677 kCal during this class.

woensdag 16 juni 2010

Heart rate 3

I wanted the heart rate monitor mostly to see what my heart does while I'm dancing, and I finally have a usable data set from my Bollywood class, with Shaira Bhan:

heart rate Bollywood dance class

As you can see, my heart gets a lot to do during this class. 185 might be considered too high for me, but I don't notice it and I'm having fun. The 185 peak was during the sequence of jumps where you lift your knees and move your elbows towards the knees. As you can see there is also a very odd dip, at about 21 minutes in, where my heart rate went down to 115. Here we practiced jumping up from a sitting position while keeping your head down and moving it up in a "cool" fashion. As you can see, we didn't do very well, as it took several minutes before we started dancing again. The software that came with the monitor calculated I burned 1076 kCal during the dance session (I assume it uses my weight and my heart rate to calculate this).

I also gathered more data of me cycling, so I updated the script to allow comparison of two graphs. It now requires additional parameters url2 and offset. Here are two days of cycling, I tried to match up the peaks (which are overpasses).

heart rate comparison cycling to work.

As you can see the second time (in red) I had to wait for the traffic light at the bottom of the US-101, which meant the peak isn't as high. Here is the same chart comparison for the way back:

heart rate comparison cycling back

Here there is a distinct difference in the beginning, which is easily explained. The red graph starts with me sitting in a chair at Google, working on my feature. The green graph starts with me leaving my Bollywood dancing class. This is also why the green graph is shorter: the dancing class is in a building that is closer to my house.

dinsdag 15 juni 2010

Heart rate monitoring 2

Here we have me resting:

heart rate resting

It looks as if a lot is happening, but if you look at the scale you can tell it is actually quite low. I tried measuring myself while sleeping, but the problem with that is that the watch keeps beeping (despite me having beeps off) which wakes me up. You'd imagine my heart rate while resting and while bathing are very similar, but this is not the case:

heart rate bathing

while bathing my heart rate is much higher, even though I feel quite relaxed. Maybe this is because the water is hot? Finally, here is an actual exercise session, including 10 minutes cycling, followed by lots of walking and running on a treadmill. The peak, where my heart rate is 182, is when I'm going 8 miles/hour on a slope of setting 1.

Heart rate exercising

vrijdag 11 juni 2010

Heart rate monitoring

I'm not sure if this should be posted as "Emerging Drake" or as "Occlusion Culling"... It fits in both categories. But since I might create more projects regarding heart rate monitoring, I decided to post it here.

My mother recently gave me a heart rate monitor, which has the option of uploading the data to a website. Fortunately there are various ways of retrieving the data yourself, and processing it. I wrote a little script, that, when provided with an url= parameter (try "cashimor.xml") plots the data from the file. I'm not sure if this is a generic file format, or whether it only applies to the Timex Ironman with data xchanger. Anyway, here is the first graph:

Heart rate graph cycling

It shows me having breakfast (it seems reading books causes my heart rate to drop below 65) and then, about 14 minutes after the start of the measurements, carrying the bike downstairs and cycling to work. At 27 minutes in you can see the bridge over the US-85, causing my heart rate to go up to 135, and then down to 100 as I glide down the other side and wait for the traffic light. At 34 minutes in you see the bridge over the US-101, which is longer, steeper, and more scary (I need to cross a lane of traffic). It goes down more gradually because the light was green. Near the end you see me climbing into the parking lot of Google. Here is the second graph:

heart rate graph sitting

It shows the part after the cycling, where I sit in my chair and code. There's a small peak when I went for tea (13 minutes in). And here is the third graph:

heart rate graph cycling back

Where I cycle back. Since the most resources claim my ideal heart rate for exercise is 127, this looks pretty good.

dinsdag 16 maart 2010

iDrake schematic, version 1


It seems most requests are for the iDrake with LCD display, so that is the first one I'll build. To make a PCB, I first need a comprehensive schematic. This isn't one, but it is the beginning of one. I'll work on it more tomorrow... Or the day after... Or whenever I'm not working on my novel.

vrijdag 29 januari 2010

iDrake™

Just in case Apple is going to move into the Drake space next, I present the iDrake™ in this blog post. The iDrake™ is now for sale for $49.99. You can Email me for more information. So far I have sold one. The specifications are very open, but should fall within the range of the other drakes presented here. There are optional add-ons (GPS, GSM, et cetera) that would make it more expensive. Feel free to discuss these things with me.