Category: Hardware

Choose Your Destiny…

So, anyone who knows me, knows that I am an avid Star Wars fan. I mean, I am in love with it beyond reason. Stormtroopers and Clones for the win!

So, cruising through reddit on /r/StarWars, I noticed user MentalUtopia made some Lightsabers using clear PVC and led stripping. Now this was awesome, I was in love at first sight and set my self to making my own with a mate, but the big problem, what colour did I want? This is a big decision! The kind of stuff that will alter my life forever!

Hang on.

Why do I need to decide?

I don’t have to follow MentalUtopia’s instructions perfectly, I’m an Engineer! I have to make things better even if they don’t need it!

Why not use RGB leds? Simple PWM control circuit to vary the brightness of each led, any colour you want for a lightsaber! Tweasy!

So, let’s break this down into different modules, just to make it easier to understand and build.

  • RGB led stripping
  • PWM generation
  • Power
  • Blade
  • Handle

RGB led stripping. Turns out that stuff is rather expensive… Retail price is crazy, so let’s avoid retail pricing. Because I will be making 2 lightsabers, one for me and one for my mate, I was going to need a 5m reel of the stuff. If I was to go to Jaycar, that’d end up costing me around 150 bucks, and that’s crazy, so to eBay we go! 20 bucks later and we have 5m shipping in from Hong Kong. That takes care of that! On to the control circuit.

PWM generation. So, how was I going to do this? PWM with an Arduino is easy, with AVR, slightly harder but still very easy, but, where’s the fun in not challenging myself? For this project I decided to use three 555 timers to generate a PWM signal, using a trimpot to vary the duty cycle. And off we go!

This is the circuit I designed:

You can see here that I am not driving the led strip directly from the 555 timers. This is because the led stripping will end up drawing around 1.5 amps, depending on what leds are on and how bright, and the 555 timers can sink 200mA, so we use a set of MOSFETs to switch the ground line of the led stripping between floating and ground, driven by the output of the 555 timers. Take note: I used a 10K trimpot instead of a 100K trimpot and I used RFP30N06LE n-type MOSFETs. The 10K trimpots set the PWM frequency to a good speed and the MOSFETs where just what I could get.

In operation, the total control circuit draws about 6mA and oscillates at 2kHz.

Now I have a control circuit, how am I gonna power it?

Power. Now, this baby will draw a lot of juice. 2.5m of leds will do that to a circuit, so my battery will have to be pretty hefty, preferable rechargeable, so I remove the overhead of buying new batteries every 2 days. MentalUtopia used a 7.4v LiPo battery, so why not use that? On to, and we have batteries and chargers coming!

Now what’s left? All the electronics is planned, what about aesthetics?

Blade. For the blade we settled with 1.1m of clear acrylic tubing of 19.1mm diameter. Picked it up locally from Rooney G’s Plastics.

Handle. To hold all that circuitry, we are going to need a fairly long handle, unfortunately, so, we picked up some 25mm PVC piping and some fittings to make an emitter and base of the lightsaber handle.

So, that’s the planning stage out of the way, let’s get on with building it!

Once I had the parts from LittleBirdElectronics and eBay, I was able to put it together to test it a bit better!

During testing, I noticed that 7.4v wasn’t enough to power the blue leds on the led strip, they light up, but at full on, they where pretty weak. With all colours at max, instead of a white colour, we where getting a weak yellow colour. So it turns out the 7.4v batteries that I had, won’t work all that well… Oh well, order some 11.1v batteries and just use the 7.4v ones until they arrive.

Circuit works, let’s get it onto circuit boards!

Notice a modular design allowing for mounting in the handle easier and separating the MOSFETs from the 555 timers to remove interference and in case the MOSFETs get hot (which experimentally, they don’t, but that was in open air, not mounted inside a PVC pipe). The trimpots are mounted on a separate board so they can be pulled out of the base of the handles to easily change to colour of the lightsaber.

Let’s get it into the handle! I soldered on a Molex plug to connect the led strip to the control circuit to allow the blade to be remove from the handle so we can change handles or blades. The whole design was modular to allow broken parts to be replaced and new handles to be designed and built.

At the moment the handles are just undercoated, with a bit of the emitter painted chrome, it’s all aesthetics from here on in, some paint and handle work to come. Have some photos and a video!

The led strip is hooked over a piece of wire that is hot glued to the top of the blade, holding it in place. The led strip needs gluing together and twisting to get a better light distribution. As you can see, the leds are quite prominent, so some frosting and/or diffusing might be in order alter to get an even light distribution across the blade.

There is no space to mount the battery inside the handle, so at the moment it sits outside the handle. When the 11.1v batteries arrive, I’ll velcro and cable tie the battery to the side of the handle, poor design feature, but oh well.

So there you go! Any colour lightsabers! Some more work needs to be done tidying up the handle, but, the concept and electronics is there!

What destiny will you chose?

New photos!

The new battery arrived so now I have blue! Works a charm.

I’ve painted the handle up a bit, attached the battery with cable ties and velcro and diffused the blade by wet sanding the acrylic with 400 grit paper. Turned out a lot better if you ask me. I also trimmed the LED strip so there was no excess and glued it down better. 


I’m Batman…

Well, I have to do something with my holidays, and considering no one wanted me for summer vacation work experience  (Anyone out there?), I decided to play electronics geek. Don’t look so surprised.

I recently (for Christmas) came into possession of one of these.

A nice Arduino compatible LED Dot Matrix screen. Spent Boxing day wiring up and ATX to give me 5V and setting this baby going.

The concept of using and ATX PSU for a bench supply is in no way a new one. You can, in fact, get some really cool modifications to turn them into variable bench supplies. Considering the only reason I used an ATX is because I am at my parents house for Christmas and hence don’t have my work bench, I didn’t really need a fancy job, just a switch to turn it on and a plug to break out 5 and 12 volts from molex. I had better clarify at this point, the LED Matrix draws a nominal 5V from the Arduino to light up the LEDs, but for increased brightness, you can feed in 5V from another source. Guess what the max. Ampere it reckons it can draw from the extra 5V?

40 amps.


40 of em.

But it does look like a small sun when plugged in.

Back on track.

To turn on an ATX PSU with no Motherboard plugged in, you simply need to short the green wire with the black wire on the 20/24 pin plug. Many people use a paper clip, and that is a pretty good idea, but I seem to have a loathing of paper clips since Microsoft Word 97…


So I threw together a nice reusable plug and switch combo. Pretty no? I have become a convert to heat shrink, so much neater compared to electrical tape. Really all it does is short the green and black wires. A handy tool to keep none the less.To break the voltage out of the molex plug, I found in Dads draw, a molex voltage breaker-outer. So I didn’t even have to make one! It may or may not go back into the draw.To the LED Matrix!It simply plugs into pins 6-13 + GND + AREF of an Arduino, as you can see below. It uses the SPI interface to push data and commands to the screen. It all comes with libraries to easily get the Matrix working with minimal fuss. You simply need to get an extra library from the interwebs to ensure it works, the TimerOne library.

Run the sample code, viola!

Now, what else can I display on this baby?

How about a giant Facebook notification screen? How pointlessly awesome? Right, lets get onto that.


That is all I am going to say about Facebook’s API. So painful. After much research, I decided on using Java and RestFB to grab notification data from currently logged in user of the computer. After finally working out how to generate an Application key, Application secret key and an Auth token, I managed to finally grab notification data from Facebook, and parse the data form JSON form to a class form.

Java Source Code with Notification Class

To generate the app keys, you have to create an app in the Facebook developers site. You can get temp auth tokens from an auth token generator from the dev site as well. The Auth token generator is only really useful for debugging. You really need to set up a way to grab one properly for any deployed apps. Here, I’ll link it for you.

Data! How nice of it to finally work. Here I am only grabbing the Notification_ID from the JSON results, because all I want to do is display total count of unread notifications. If you want more data, modify the file to reflect what data you want to grab from the JSON. Next was pushing the data to the board. Here I hit a snag that I haven’t fixed yet. When the data was transmitted to the board, the Matrix would clear and would display nothing again. I checked the USART and SPI pins, they don’t clash. So must be code somewhere. Well, here was my Arduino sketch I threw together anyway. Keep in mind, it doesn’t work. The serial code for the Java, as you may have noticed, is commented out in the above Java source code.

Arduino Sketch

Well, I then decided to do something silly with the screen.

Batman Logo.

Most annoying bit was plotting the logo to a 16×32 image then translating that to a 2D array. I grabbed a logo image, scaled it down to 16×32 then wrote out by hand where each pixel was then manually entered it into an array. In hind sight, I could have gotten the 16×32 image, then written a nice C code to translate it into an array, but that would have probably taken just as long anyway. Might throw one together anyway for future use.

Well, the fruits of my labours!

And here’s the source codes. The Batman Logo array is in the batmanlogo.h file. Go nuts.

Main Sketch and Batman Logo.

Compressed, grouped files? Who do you think I am? Get them individually. Maybe when I port to a new file server I’ll do that.

Because I’m Batman.

F***en Magnets…


On Friday I bought an old oscilloscope from Uni on the cheap. That and a old Wishmaker, with a signal generator, variable voltage supplies, switches, buttons, multimeter and a breadboard. Getting all this home, I quickly realised that I didn’t actually have enough room on my desk for all this stuff. Sad Panda. So what do you do? Move into the spare room and use the desk sitting in there! (nearly) Instant workspace!

Need a computer for said workspace… For datasheets and coding and what not. I know! I’ll use the broken screen laptop curently on my desk and wire it up onto my workspace instead! But what about powering it on and applications? I’ll, shudder, need a windows boot, I use to use Wake on Lan to turn it on becuase it was just a hassle to open up the screen and press the power button, especially when the monitor was resting on it. Moving it to the spare room meant that I coudn’t run an ethernet cable to it, so Wireless had to be used. WoL doesn’t work on wireless. Well. Atleast not with this old Toshiba laptop. But. I got the bright idea to break out the power button to outside the laptop case. Simple enough really. Tack a new momentary button onto the power button board in the laptop. That was the easy part.

What was the hard part, was the power button wouldn’t work when the lid was closed. Some smart developer decided to disable to power button when the lid was closed. This kinda defeated the whole purpose of the new button, didn’t it? Yeah.
So several hours of hunting around the laptop trying to find the sensor got me REALLY frustrated. Other laptops I have pulled apart had simple switches in the hinge or a basic light sensor. This one, had none of these. No obvious sensors, no hidden switches, nothing.
After pulling, literally, everything apart and unplugging everything, I still couldn’t find the sensor. It had to be in the monitor somehow because nothing else placed over the laptop with the monitor removed would set the sensor off. But it couldnt be in the monitor because nothing was plugged into the monitor. Even after stripping the camera, LCD and mic out of the screen section, it still was sensing some how.
Genius here decides to look on the other side of the bezal that he just put back onto the screen. Low and behold. What was there?
A Frikken magnet. There was obviously a magnetic sensor on the board that detected when the magnet was near by and set laptop to sleep/disabled power button.

It’s kinda hard to see, but it’s the dark silvery bit clipped into the screen. Pop that out.

Bam, it works. That’s it. On the upside, I got rather intimate with a laptops guts, but I am never pulling this one apart again…

Dual boot! This was also far too painful. Because it already had Ubuntu installed on it, installing Windows will destroy the GRUB2 bootloader, rendering the Ubuntu partition useless. But that’s easliy fixed, right? Wrong.
Install Windows, that goes painlessly. Try to repair the GRUB2 bootloader using a live CD, same way I have done it many a time before.
Doesn’t like that.
Why? Because it reakoned that there was no GRUB installed to it in the first place, which is crazy talk. Crazy talk I tells ya!
After a few more hours of hunting and trial an error, I discover I need to chroot (kinda run the Ubuntu commandline within another linux install) into my Ubuntu install from the live CD and Re-install GRUB completly. Sigh.
Ultimatly it was fairly simple from there. Let me walk you through it.
First we needed to find which partition the linux build was on. Punch in:

sudo fdisk -l

Find the partition that says “Linux Partition” and that’s the one we’ll be using. From here on I’ll be using sda1, because that’s the one mine was.
Next, let’s make a folder to mount everything in.

sudo mkdir /mnt/root

Then lets mount our linux install files to allow us to chroot in:

sudo mount /dev/sda1 /mnt/root<br />
sudo mount -t proc none /mnt/root/proc<br />
sudo mount -o bind /dev /mnt/root/dev

Done. Now to chroot in!

sudo chroot /mnt/root /bin/bash

From here you should have a slightly different looking prompt on the terminal. Here, type:

sudo grub-install /dev/sda

Bam. That fixed it! After a little custom work with the grub loader from inside my Ubuntu build, like changing the time out and looking for my Window partition (sudo update-grub), we have a working GRUB2 loader!

Well, here’s the fruits of my labours. My new workspace!

Updates updates updates!
What have I been doing you ask?
Uni work. Far too much uni work for my liking. Well, it’s done now. For this year at least. So now it’s time for projects, SKYRIM! and work.

Let’s take a step back for a moment and I’ll explain one of my subjects that has kept me so busy. The subject known as ECTE350 Engineering Design and Management. Basically, at the start of the year we are put into teams of 8 and are given a theme. From this theme we must design a product, then build it. Following all regulations, much paperwork and what not. This years theme was “Aged and Disabilities care” and Team 8, also known as TSAM Tech designed and built the E-LINE. Pretty much, it’s an automated clothes line with various sensors to detected temperature, humidity, and light to detect when to draw the clothes line into the house through a window. It was also controlled by a wireless remote to move the line so it was easier for the disabled person to sit in their wheel chair and hang clothes with minimal movement.

Don’t listen to Jaqui. It’s her bra, not a swim top…

Here we can see the E-Line and TSAM Tech Team Members, minus Ru Qui, he missed the photo. We had to present our product at the annual Innovation Fair at UoW and the crowds vote on the products. This year we came third! So pretty much, this past semester at uni all my project mind set has been in this product.

Moving on.

What else. Tried to fix a mates monitor. That didn’t work. Backlights dead and I cannot find any visually dead capacitors. Bought a new Arduino Mini Pro on eBay. Just for shits and giggles. Noticed my TV has serial comms line for RS232 control. Winning! TV/XBMC remote all in one in the thought planning stages…

Yesterday, I started up on my Wireless glove gesture control mouse again. I have dubbed it the “RatGlove”. As it turns out, the learning curve between AVR micro controllers and TI micro controllers is quite steep. Not a huge fan of TIs Datasheets really. Too many references to other documents and poorly documented. I braved the datasheets and got my FR5739 board to work at the right clock speed and set up the USART interface properly so my serial LCD screen works with it all properly like. That took me 2 days alone. Oh well. Next is the accelerometer. I have a much better understanding of the ADC component of micro controllers now after my micro controller subject at uni. Hopefully I can decode the accelerometer stuff this time around.

See? Photographic evidence I am actually doing something other than Skyrim. Notice no super dodgy transistor array this time around, it’s a serial enabled 3.3V LCD available from LittleBirdElectronics. Quality aussie supplier. They get their stock from several other manufacturers, like SparkFun.

That’s pretty much it from me this time around. Just keep blowin’ shit up and taking names.

Remember last post I said I was going to play with the accelerometer on my TI board? Well, I didn’t lie too much…
I decided to wire a LCD screen up to the board so I could see the data from the accelerometer in real time. That was hard enough…As this post is detailing.

Two days.

That is how long it took me to realise 3.3V logic and 5V logic doesn’t play well together. Two of them.
Let’s take a few steps back and I’ll start from the start.

I wanted to play with the accelerometer on my TI board, but I like seeing what’s happening. The data in/out. What everything is doing. The awesome JFET debugger on the TI board helps a lot with that, but nothing beats a good old LCD screen showing what’s happening. So I thought, “I’ll just grab an LCD screen, hook it up and then play with the accelerometer”.
Good idea idiot.
Armed with my new 5V power supply (Which, turns out, did need the heat sink. That 7805 gets frikken hot) I set out to quickly hook up my LCD screen to my TI board.
For starters, it was a different LCD screen to the first one I had. So all the commands are different, the initialisation is different, the pins are different. After making a massive spaghetti mess of cables to connect the screen up I set out to write some code.
Enter first problem.
I don’t know how to code on TI microcontrollers. I don’t know the routines, the registers, the tips and tricks. Oh I know C syntax. I can code. But not on TI controllers. Just starting off and getting a simple code to compile and run was interesting enough. But I digress. After poking around in the example code that came with the board, I worked out how to set up the Data Direction Registers, well, the TI equivalent anyway.
I cracked out the code I used for the other LCD screen I used previously in my Bluetooth remote. The logic was useable. Had to play around with the pulsing of the enable logic for it to work on the TI compiler. Along with writing my own “delay_ms” and “delay_us” functions.
So. Technically, I have functions that should work. The wires are all connected together properly. Trust me. I had checked those wires about one hundred times.
Still nothing is working.
I couldn’t even get the LCD to initialise.

End day one.

I know!
I’ll hook the screen up to my ATmega8515 on my STK500 and see if I can get it working. Low and behold. It works. The screen initialises and prints text. (After much fiddling around and making an LCD header and source file, just for future use, I might post it up here once I have commented and cleaned it up a little.)
So what am I doing wrong on the TI board?
Move it back and try the new logic from the AVR program.
Still nothing. It’s not the contrast adjust. I play with that every time I try to get it work, tuning it to try and get some text to appear. So what the hell can it be?
Late at night after watching some Starwars, possibly episode 3, maybe 2, it dawns on me.

TI uses 3.3V logic.



That’s it?



End day 2.

This is damn “simple” project is now testing every part of my engineering mind, and it turns out to be a simple little thing like that? I am going to make this thing work if it kills me.
Right. Now I have established I need 5V logic for the LCD and my TI board outputs 3.3V logic, what can I use to bump it up?

A series of 7805’s? Pfft. No. That’s expensive and just silly. Also, The response time would be far too slow. Probably. I didn’t have any spare 7805’s to test it with anyway.

What I need is a way to use 3.3V to switch on 5V.

Hang on.
Isn’t that what transistors are for? Digital switches?(actually, they are current amplifying devices, but can be used as switches, and commonly are) Humm…. I remember playing around with this for a night. Where was that video I watched?

Right. There’s the kinda thing I need to do. How can I adapt that to work with logic? Think Phill! That’s all your mind ever does! Think!


Remember this post? It’s a switch! For logic! I’ll just replace the mechanical switch with the transistor! Genius!

A transistor array!

The actual transistors I am using are c1815. A small signal audio amplifier. Not really the most optimal for a transistor switch, but what I had with me anyway. Still works.

But hang on. This will invert the logic. This design makes the output active low with active high input. This had to be reflected in code, obviously. But if you do this hack method, remember to invert your output.

Right. Let’s get this baby working.

Look at that!

My pretty TI board and my transistor array are being nice together. After I realised I had to ground the R/W line on the LCD screen. Silly mistakes for everyone! I have enough spare!

So there you go.

After 3 and a bit days of fiddling around. I have a working 5V logic LCD screen interfacing with a 3.3V logic TI microcontroller.

Hope you enjoyed this epic post of silly mistakes. Proving, you can interface 3.3V logic with 5V logic.

EDIT: I had better point out, this is a one way logic converter. For output from the microcontroller only. You can’t read anything in from the screen using this method.

I still haven’t found my spring from my solder sucker. Curses!

Bench Power Supply

Well, I got off my arse and designed and built a little bench power supply. Just a quick little thing capable of outputting 5V @ 1A and 3.3V @ 1.5A (Assuming you have a wall pack capable of outputting that much current).
It has pretty much no over current protection or anything fancy like that. The only protection in it is what is built into the voltage regulators. As I said. It’s simple. Schematics!

As you can see, a simple LM 7805 and LM 317 configuration with smoothing capacitors. Pretty LEDs to show that its working, a couple of switches to turn each segment on and off as needed and input power from a wall pack. To calculate the resistance needed on the 317 to get your desired voltage, simple use one of the many online calculators. The input voltage can be anything above 7V if you want to use both voltages. If you just want to use the 3.3V line, 5V input will be sufficent.

Throwing it together.
Onto the breadboard I go! An electronics hobbyists best friend. Fairly simple to put together. Plug plug and plug, it’s all together!

Yay! The right voltages… After about half an hour playing around wondering why I was getting 0V all the way through. Turns out plugging in the 7805 the right way REALLY helps… That and grounding it… Man I am an idiot…

So, it’s all tested and working and whatnot. To the prototype board! Let’s make it a little more permanent. Again, fairly simple? Not when Phill’s been drinking!
For starters, the prototype board that I chose to use had the worst track layout I have ever seen. I spend almost an hour just planning how to get it onto the board! If I had been smart, I would have taken a photo of the tracks, but I didn’t think of that, so just imagine the worst layout of copper tracks you can.

So, everything has been placed. Time to solder! I am ashamed to say, this job was some of the worst soldering I have ever done… Shit was going everywhere… Doesn’t help that halfway through I lost the spring out of my solder sucker, So it became really hard to get rid of the excess solder everywhere. *facepalm* I still haven’t found it…It was on my desk, but then it wasn’t…
So I solder everything together. Plug in the power, and… Nothing. Again. Nothing. Tonight was just not my night.
Break out the old multimeter, trace the voltages through it…What do I find? 12V has sneakily joined up with the ground somewhere…
Keep looking. Where can 12 be getting through? Bloody hell. Half an hour later. I also find that I didn’t ground the 7805… again. Fix that up… Still nothing… Turns out I joined the wrong two tracks together underneath the 317. I connected the input and ground lines, instead of the ground and output line… I am on a ball tonight… Fix that. Viola! Working! Finally!

Now. What can I stick it in? The power supply you dirty minded fool. Look around for a suitable container. What do I see? A dead modem! Small, yet plenty of space for my little circuit. Get hacking with a drill and jigsaw blade. Cut some holes for the terminals and switches. Hot glue the circuit and LEDs in. Screw the terminals in. Pop in the switches. Easy!

Now, as you can see in one of the pictures, I have a heat sink to attach to the regulators, but as I am lacking thermal paste and little nuts and bolts to attach them to the heat sink, for now I’m just going to hope it doesn’t overheat. Shouldn’t unless I draw excessive current and have my input voltage rather high.

Also, you can see I made a little 9V battery adapter to make the whole power supply somewhat portable. You never know. Might come in handy one day.

Well. That’s that adventure over with. I now have a handy bench supply of 5V and 3.3V. Now I’m going to fiddle with the accelerometer on my TI MSP430 board from last post.

Keep it real.

Ahh. Holidays. What better time to fiddle with projects?
Not a lot to report on the project front today. More of a quick update on my analog meters, planned projects and new toys.

Remember last post I talked about making new covers for the meters?
Well! Here they are!

Purty no? On the upside, I learnt GIMP doesn’t like doing colour inversions, but paint does… Riddle me that internet, riddle me that…

That’s the only update I have for you on that project. I have kinda lost some inspiration on the SD card logging when I couldn’t get some example codes working. Just needs more time than I have had recently.

Moving right along!
New projects!
What are several things a electronics hobbyist needs?

  • Soldering Iron
  • Multimeter
  • Oscilloscope
  • Bench Power Supply

Yes? We are in agreement? Ok, maybe not the oscilloscope quite that much, but still. Would be pretty handy…

So I have a solderin iron. It’s old and the tip is burnt through, but it works pretty well. Multimeter? Check. A cheapo $20 one picked up from leading edge electronics when I was 12 I think… Once again. It works to everything I need it to, so far. Oscilloscope? I wish… I’m saving for one at the moment. A cathode ray would be awesome, but I just don’t have the space. So lately I have been thinking of and looking at the digital scopes. As of yet, I don’t know. Peoples thoughts?

Now. Bench power supply. That, I am missing. At the moment I just use the 5V line from my arduino. That’s not really the best way to do things due to the current limitation from that line. We don’t want to be burning out my arduino board now do we? That would just be inconvenient.

So. what to do? A variable bench supply is too expensive. I could mod an ATX powersupply to feed me the 5V and 12V lines from the molex plugs, but the only spare ATX supply I have is dying and they draw a bit of power even with no load attached.
What to do?
Enter brilliant idea.
Build a simple 5V and 3.3V power supply.

Using an LM7805 and a LM317 voltage regulators, feed 12V from an old wall power pack I found lying around into the regulators. Take the output from the LM7805 for 5V, output of LM317 as 3.3V, output direct from the wall pack as 12V. Throw some regulating capacitors and backwards current protector diodes in. Throw a heatsink on the regulators just in case. Simple! I can even build a little adapter to plug in a 9V battery instead of the wall pack. Some pretty LEDs in and switches to turn each segment of the supply on or off. Best idea ever. Best thing is, I have most of the components! Just not the important ones. Like the LM317 and the capacitors… Looks like I’m going back to Jaycar.

After a bit more research I will be ready to draw up a proper cicuit diagram.

Onto my new toy. 😀

Thanks to a post at Hack A Day, I managed to pick up a Texas Instruments experimenter board for half price. Only $13.66! That included shipping! An offer I could not refuse.

The board was a MSP-EXP430FR5739. This board was developed to show off a new(ish) system of memory called FRAM (Ferroelectric Random Access Memory). FRAM boasts a write endurance of 100,000,000,000,000 cycles. What the hell? Thats a huge number. Over 100 billion times more than FLASH memory. That thumb drive with all you back-ups isn’t looking all that safe anymore now is it?
FRAM also writes a hell of a lot faster than FLASH. like, 100 times faster.

You must be thinking, “If FRAM is so good, why do we still use FLASH memory?”
I’m glad you asked that.
While FRAM is more reliable, faster and uses less power, it also have several flaws.
As with all new stuff, It’s expensive! That is the main point in it not taking over FLASH. No one likes spending lots of money, especially big corporations who cut corners to save 1c per product…
Capacity. It just doesn’t, at the moment, have the same capacity for storage compared to FLASH.

That’s enough of me plugging the FRAM. On to plugging the experimenters board infront of me.
This little baby is a 16 bit RISC architecture MCU running at 8MHz. On the board there is a 3 axis accelerometer, a thermistor, 8 LEDs and 2 switches. Other TI boards can be connected to it via a couple of header plugs at the back of the board. All PC and USART conections go through a micro-usb plug at the top of the board. Power is also drawn from USB.

Wow that’s a piss poor photo. Man, I need a new camera…

3 axis accelerometer and a PC interface? I think a gesture control for my PC is on the cards…

Well enough from me today. This short post turned into quite a long one. I should probably go do the washing up now… Have fun!

Next project time!

This one is rather simple and easy, just to introduce me to the arduino and its capabilites. A couple of analog panel meters to show realtime cpu and ram usage, then have the data logged onto an SD card.

I’ve got the panel meters and have tested them. How they are gonna work is a simple PWM signal with the duty cycle adjusted to current load sent from the computer via serial port. The panel meters I have chosen are 0->1mA. So some calibration circuitry is needed so i can adjust the voltage and get a linear approximation of the data from the cpu. Now, this is rather simple.
What we want is 1mA of current being drawn when the PWM is driven to 100% duty cycle, and 0 mA when the PWM duty cycle is 0%. So, back to basics. Remember V=IR? I surely do. Bit of gypsy magic and we get R = V/I. Lets just assume the panel meter has no resistance, when it actually does, and calculate a “Perfect” resistance needed to get out 1mA.

R = 5v/1*10^-3
= 5kohms.

Tweasy. All we have to do is add a 5kOhm resistor in series between the PWM pin of the arduino and the panel meter. If you want to check that the response is linear as the voltage varies, compute I = V/R for several points and plot. You will notice it is a linear relationship*. Just what we want.

Plug it into the arduino, and you will find that it works! Fancy! Maths is again useful! <- Much to my dismay…

Nexzt, I’m gonna be working on the data logging to SD card. Now this would be MUCH more useful if I could find a particular library called uFat2 made by SirMorris. But alas, his code host no longer has it and I cannot find links to it anywhere else, So if any readers out there have it or can find it, let me know! Please!

Peace out.

*Technically, Ohms law is not a linear realtionship, as temperature varies, the line becomes less and less linear. For most applications though, we can ignore that…

Bluetooth Media Remote

It is finally finished. My Bluetooth Media Remote!

With each module* working as it should, I set out to build it onto my breadboard. Just to make sure that it works together.

*See previous posts for each module and how they work.

The final Micro-controller I decided to use on the final product was a ATMEGA8. In the first post I used an ATMEGA8515. For several reasons I decided not to use this one in the final product. Firstly, it’s a 40 pin package. I do not need that many I/O lines. It draws more power. And finally, I need that one for my studies at uni. So an ATMEGA8 was used.

Here, I noticed a slight problem…
The buttons double press sometimes. Thus sending the data twice. I think this is a limitation of the tactile switches I am using. I’m not quite sure. Later on I might write some code to only allow the data to transmit after a certain amount of time has passed using a timer interrupt on the ATMEGA8. This is for future work though.

From here, I built it on a set of prototype boards. Modular of course. In hind sight this wasn’t a very good idea, because I still hadn’t decided what I was going to enclose it in, but I was excited to build it. And build it I did.

Ahh. Its working on the prototype boards..

Now, the problem that faces every hacker, what to build it in? It’s gotta be classy, something on hand, and easy to put together.

Thanks to a brilliant idea from my mate, Damo, I thought “Why not in one of my broken Xbox controllers?”

After pulling it apart and trying to jiggle the circuits into it, I decided it just wasn’t feasible.

Back to square one.

Then, like a ray of sunshine, I remember I had a broken N64 controller as well. Thus the decision was made. It’s classy, it’s on hand. Easy of assembly went out the window when I realised how awesome it would be to use nostalgia to control my music.

After rebuilding the circuits onto new prototype boards (about the 5th time I had built the same circuit), I attacked the controller with a jigsaw blade and the file on my pocket knife. Not the best tools, but what I had on hand.
And so the N64 Media Remote was born…

And a video just to prove it works…

For those interested. The source code for the remote. The polling of the buttons is not quite neat, but it works.

I might implement an external interrupt to activate the polling, but at the moment, it’s not needed. Even the interrupt polling double transmits.

And thus the project is complete. Any questions, don’t hesitate to ask!

Later on I might get a full circuit diagram. If someone requests it I’ll make it a priority, but until then it’s on the back burner. Uni work has suffered enough…

Onto my next project! A set of analogue panel meters to monitor my CPU and RAM usage with data logged to an SD card. Stay tuned!

EDIT: Debounced the buttons. Thanks for the idea Matthew Wiebe and BohemianHacks! Here’s the updated source code

Well. Here is quite an important part, yes? What’s the point of having a remote that is powered by a wall socket? Not much, really. And, unless you haven’t noticed, there are no 5V batteries available, not on the cheap at any rate. Which really is quite annoying. So. Let’s use a voltage regulator. The following circuit is a 9V to 5V regulator using a 7805 regulator transistor.

This gives us a nice, regulated, smooth output. Very handy. And a pretty LED to boot!

This power supply can be used for any application needing 5V, so as a result, I will be using this circuit pretty much all the time, apart from prototyping on my dev boards.

Next up, the server code I re wrote in Python.