Project Planning- WiFi Radio

My upcoming project is a WiFi Radio.  I have a small atom board computer that I will use as the base.  I am going to load it with XUbuntu (a lighter version of Ubuntu) and make it a WiFi radio.  I bought a cheap antique-looking radio from a pawn shop for $20.  I plan on using it as my case.

I bought 3 RGB encoders with push buttons to replace the current pots in the radio.  I want to still use the knobs but drill a hole down the center to allow the RGB light to shine through.  I will probably have to use some clear fill to spread the light out like a lightpipe, not sure what I will use for that.  I also bought an LED ring graph, that will be my channel/category indicator as I can make multiple categories of stations.  That’s all I plan on using for the UI.

Light Modes:

Encoders-

Playing a song- random fading, all the same or all different

Stopped- pulsing a color

In use- turn the one being turned a solid color

Possible Beat Mode- flashing/fading to a song beat

 

LED Ring-

Changing Volume/channel/category- display the amount on the bar graph using both sides, when done (as indicated by no change for a period of time) flash the lights a few times and go back to whatever the ring was set at

VU Mode- Left and Right channel VU set up split top and bottom

Equalizer Mode- 4 frequencies shown going from each quadrant to the next quadrant (so 4 LED’s each freq)

Chase Mode- have lights go back and forth to give the idea of chasing lights

 

Knobs:

AM/FM Knob Turn- will be used for changing categories of stations

AM/FM Knob PB- Change light mode of the knobs

 

Tuning Knob Turn- will be used for changing station within a category

Tuning Knob PB- change light mode on the LED Graph

 

Volume Knob Turn- used to adjust volume of course

Volume Knob PB- Mute/Unmute

 

Other:

Speakers- I got some sony mini speakers on sale from Best Buy.  I believe they were $5, originally like $40 though.  They sound pretty good.  Not as loud as the original speaker but has its own internal amplifier/driver and it’s stereo.

 

Software- I plan on using a teensy++ as my hardware interface.  It will send encoder and push button information via serial.  A python program on the computer will be doing the stream control using Streamtuner.  Also hoping to put the equalizer and VU work on the computer.  It would be nice to have all the LED control on the computer so it can be done quicker and more efficiently with the teensy board acting only as a hardware i/o interface.

 

The hard part will be the Python-Streamtuner interface, I  have never programmed in python before.  I typically use C, Java, or VB, but have used lots of other languages from time to time.  Also, because I won’t have a screen, connecting to new wifi networks will be difficult, I’m hoping to write a script that if a usb drive with a certain file (wifi.txt) is inserted, it parses that text file into its wifi connections to be able to connect, then I will never need to use a monitor after I get it set up.

 

Draftsight appx drawing

Digital Cable Length Measurement

I bought an Olimex dev board on Sparkfun to help a friend on a car project.  I never ended up using it but saw an ad on Craigslist for some freelance engineering work so I made it into a encoder based wire counter.  The goal was to have a wire pulled off a reel and pinched on to a wheel so if someone pulled the wire or had some unwinder, the wheel would spin and an encoder would give feedback to a device that calculates the feet and inches.  Well after making the product things kinda fell through in a crappy way so I am posting build info up here.

 

The dev board has 6 buttons, several inputs, an LCD, buzzer, relay, and assorted other IO.  I ended up using the DALLAS input with an added cap from R8 on the micro side as a low pass filter to help with bouncing.  I used all the buttons, left/right changes the Pulses Per Inch (PPI), up/down changes the inches and feet offset, the center button resets to the setpoints, and the lower left button stores the values to EEPROM.  If you hit the center button upon power up, the EEPROM values are set to 0ft,0in,10ppi. I removed the Relay and Buzzer and tied into the relays terminal block for the encoder to plug into more conveniently.

 

You set PPI by finding your encoder Pulses per revolution, and then finding the circumference to find your inches per revolution, combine those (divide pulses by inches) to get pulses per inch.

Offset is used if you have to thread the wire so far before pulling, then you can keep track of that wire.

 

The code contains two interrupts, one for calculating adding and subtracting values for PPI and Offset adjustment.  If you hold the button long enough the speed of the change increases.  The second interrupt is INT0 as is connected to the encoder.  Every rising edge a pulse is added, inches are added based on PPI and feet are added at 12inches and inches are reset.  The main loop does all the button reading and lcd updating.  LCD updates when a button is pressed or when an onscreen value is changed.  I ended up using 99.2% of the flash and like 5% of the EEPROM.  I had to make my own printf function because I did not have enough space for the standard library.  Readbuttons is a routine that does all the I/O changes and matrix reading to do the button reading.

 

And that’s about it.  Here is a video of me showing it off with my raspy sick voice.  Not the greatest video, I  have a video camera but not a battery charger or stand so I used my phone.  Eventually I’ll get the better camera up and running.

I might put this thing in a box, I can tie in some better panel mount buttons, mount the screen, and maybe find a buyer.  If you have any questions about this build or want it, leave me a comment or email.

 

That’s it for now!

 

Click below for the compiled hex code as well as the C file.  I used some libraries available on codevision.

CounterCodeCompiled   CounterSmall-new

Update-January/February 2012

Well lots of great and not so great stuff happened over the past month!

 

First, I’ve been on a diet since beginning of December.  I cut out beer, all soda and caffeine, and red meat, and added a lot more fruits and veggies.  Also to see if its all diet based or partially medical based, my doctor put me on an appetite suppressant which contained a large stimulant.

Over two months I lost about 30ish lbs and was doing great.  I had a few days the previous week at 1800 calories and was unhappy with my low drop that week, so I went a whole week at 1000 calories a day, where my typical at that point was around 1200-1400.  I also had a huge project coming up that weekend, like once in lifetime type of project.  I was wrestling all that physical and emotional stress and then my dog ran away…

In my tired state I forgot to put his leash on him, I put his leash on another dog, we have 3 dogs and one of them had two leashes on him, so Sai ran away.  I chased him down in shorts, socks, and a tshirt with just a treat in my hand, but he of course thought it was a game.  I caught him when he went to play with a little girl 4 blocks away, he hopped up and down and laid down to play with her so I grabbed his collar and walked him home.  He was so happy, and I wasn’t upset, he’s a dog, dogs like to run, if you yell at them they are more likely not going to come back so easily next time.

Well my heart was racing, and 4 hours later it was still racing and I was still out of breath, I thought maybe low blood sugar so we got some dinner and I got a *gasp* shake *gasp* for the first time in 2 months.  This didn’t help and made it worse, I was light headed and my extremities were numb, so we went to urgent care, my wife wanted to go to the ER but I told her no.  We went to urgent care and they immediately sent me to the ER.  My heart was in afibrillation and was misbeating, the electrical signals were all messed up.  It was beating around 120-130bpm. They tried medicine to slow it, it made it worse, around 150-160bpm.  After 45 minutes of medicine (I had been at the hospital probably 2 hours at this point) they stopped it and prepared to shock me (with a defibrillator).  The doctor was out doing paper work and consulting with the on call cardiologist.  I asked to go to the bathroom first as I didn’t want any accidents when I was unconscious and shocked.  They helped me stand and left the room.  I started “going” and my heart rate dropped to 80 and then shot over 200 for a little bit setting the alarms off.  I thought it was just the sensors but it was my heart.

Anyways, the doctor came in with the paperwork to have me sign so they could start the drugs to put me out so they could shock me back into rhythm but my heard had gone back to normal 5 minutes before he came in with the form (about 45 minutes after medicine was stopped).  They watched me for another hour and then let me go but I had to see a cardiologist the next week.

Well I was forced to stop taking the appetite suppressant, and its been hard, but I’ve lost another 10lbs so I was on it enough for good habits.  My cardiologist said I cannot be on any decongestants, cold medicine, or any stimulants at all at this point, but I hope he lifts this because I had a bad cold last week and without being able to take anything, I was really rough.  I had to take days off of work, which I’ve never done with a cold, and I was sore, like the kind of sore I had after sinus surgery sore, basically took like 4 days to recover.  But I see him in a few days and hopefully he lifts my restrictions.

Also my wife got a layoff notice as her job is moving.  Its like 9 months away, but we might consider moving to Alabama for it, which sucks except for the alligators and snakes, I love reptiles, not sure how much my dogs will like them.

 

Anyways, that’s the bad, here’s the good.

I built a new computer, well 3 new computers:

-I built myself a new one, its a core I5 3.3Ghz, 16Gb of RAM, HD6950 2Gb Radeon Card, 2 60Gb Sata III SSD’s in Raid 0, and a decent motherboard.

-I put my old parts in my friends’ computer.  It was a QuadCore 6600 with 8Gbs of RAM and Radeon HD4850.  This helped fund my new pc.

-I used his old parts to upgrade my media center (some of his old parts were actually my old-old parts).

I cleaned out some of my project backlog, from pc fixes, to small electronics fixes, and now I’m going to start on my WiFi Radio!

I went to a few career fairs as a rep for my work, one of them being my alma mater UWPlatteville.  I always love to see my old professors and talk to students.

I got contacted to work on a super awesome once in a lifetime project.  I can’t say too much more at this point, I’ll say what I can in a few days and in a month more info will come.

 

That’s about it, crazy couple of months for me, but I wouldn’t trade them for anything.

 

One last thing, I had a contract awhile back to make an encoder for wire length measuring with shutoffs.  The deal kinda fell apart in a bad way leaving me holding the bag, but lesson learned and I will post my build here for others to do themselves!  And if anyone wants my build of it, I will offer it for sale in that post.

 

More to come!

 

Ben Heck Shop Visit

Recently I won a contest on Element14 where I was supposed to receive a hat from Ben Heck’s Ghost Squad episode (satire episode about ghost hunting).  If you don’t know Ben Heck, you should look up some of his videos

http://revision3.com/tbhs/episodes

 

Ben Heck is originally known in the hacking/modding community for his portable PS3 and Xbox360 Laptops and custom controllers for disabled players.  He has been contracted by Element14 (part electronic supply company Newark) to make many of these videos.  He is a graphic artist by trade and taught himself electronics.  He does amazing things like portable CNC machines, portable workbenches, portable consoles (portability probably a good theme for him), and other neat things.  He is kind of a hero in the modding/hacking world.

 

Anyways, I was contacted by Element14 about the contest and I asked if he was going to sign the hat, here is my email

Is Ben signing these at all?  It would be awesome if he did.  I’d even come to pick it up as I make frequent trips to Madison.  I’m an EE and love his work, I’d hang it in my basement lab to give me inspiration to use my powers for good and not as much for corporate greed, except when I need to pay the bills, typically 8-5 daily.

Either way, thanks!

Jesse

Hoping to appeal to Ben’s sarcastic fun nature.  Well it worked, I was contacted about going to his shop last Tuesday and told I could meet him.

 

I went to his shop where Ben and Alyson (his camera person/assistant) were finishing up a show.  I stood watching and looking around the lab (probably creepily) at all the awesome stuff there.  Just electronic components everywhere, projects here, projects there, giant CNC machine in the main room.  It was pretty awesome.  After they finished the episode, I got to talk to Ben about electronics and you can definitely tell he is passionate and knows his stuff.  He showed me some things in his shop including his 3D Printer, which I think he might turn into a laser engraver and his homemade pinball machine.  I talked about what I do for work, and he mentioned a future project he might talk to me about.

 

We talked for about 20 minutes before I had to go, but it was a really awesome experience and definitely motivates me to do more electronic projects on my own (I wasn’t kidding about the hat for motivation).  Here is a picture of it

 

 

For anyone interested in hacking/modding check out Hackerspaces.  These are local establishments that teach classes and have equipment to assist any hacking or modding project.

http://hackerspaces.org/wiki/United_States_of_America

There is a good one right in Madison

http://www.sector67.org/forum/

Footpedal Hardware Finished

Finished my gaming foot pedal I was working on

Added the pushbutton on the side for resetting so it can be programmed without opening, and also added a light for when a button is hit.  I tried to do Sugru strain reliefs, but I tried them thinking I could shape them, pull them out of the case, and then finish the case.  Well sugru is very sticky and it didn’t work out as well as planned.  It will still keep the cord from pulling out though as each cord has a plug of sugru inside the enclosure as well bigger than the hold.  I think it looks pretty good.

On the software side I will eventually make a program that lets you change what keys are pressed, but it will just modify the c file and recompile.  Then you can hit the side button and use the teensy programming program to update the firmware.

Gaming Footpedal

I’ve been wanting a gaming footpedal for awhile.  I’ve been playing Counterstrike for many years and recently I’ve been sick of my keyboard/mouse settings for my talk and walk buttons.  When I am steadily aiming at a wall, waiting for someone to round the corner for that headshot I don’t want to hit a button on my mouse to talk to the team and tense up my hand and possibly throw off my aim.  Also, if I am in the middle of a firefight I don’t want to have to hit a keyboard button to talk because it would mess up my moving/crouching/jumping etc.  This goes the same with the walk button, but less so.

 

Well recently we were cleaning out upstairs at work and I found an old controller with a footpedal.  It was getting thrown out so I got my hands on it and took it a part with the purpose of using it as my walk/talk buttons.

I took it a part and the cable had five wires.

 

Green wire was chassis ground on the pedal, Red was the NO connection for both pedals, Blue was the NC connection for both pedals, and Yellow and Black were signal wires for the pedals.  A friend from Sector67 turned me on to Teensy boards, which are USB Atmel AVR’s, they are small and can be programmed through USB.  These are often used for HID Keyboard hacks, here is the one I am using

http://www.pjrc.com/store/teensy.html

 

I stripped the foot pedal wires and connected them to the board.  I connected the NO connection to ground, and both signal wires to pins on PORTB.  PORTB is set up to internally pullup to VCC.  I then edited some sample Teensy code and tossed it on the board to press the 7 and 8 buttons on the numpad for each pedal.

www.colecago.com/files/FootpedalCode.zip

Works great, here is the semi finished product

 

Next steps are to add a status LED, secure the board in place, and to use Sugru to add good looking strain reliefs to the cables.

 

I’m also thinking of adding a pushbutton and making the controller configurable using a windows based program communicating over the USB port.  You could press the button, open up the program, and change what keys the pedals are bound to.

Sample :

78787877777777777777778888888777777777777777777788888

Wha? Updates?

Yeah its been forever since I’ve updated the site.  I’ve changed the layout a bit, and I’ve finished a few projects, one for contract, one for me, so I’ll be posting about that one shortly.  Hopefully I will be doing more projects so I’ll have more to post.

First!!

The dreaded First.  What everyone wishes they could be, but only one can be.  Anyways, as you can read about in my About section, this blog will mainly contain technology posts.  I will post updates on personal projects which can range from simple microprocessor projects, to Android applications.  My goal is to inform.  Current personal projects include:

Running my website and installing an image hosting application on one of my subdomains- ongoing process

Creating an RPM switch with an LCD display and a ‘boost’ circuit for my friends’ car-hopefully be done in a couple of weeks

Creating a free Bluetooth Terminal application to put up on the Android market for developers and robot enthusiasts to use-probably a month, I don’t know java very well but do have a working bluetooth section, just need to finish the terminal front end