About Me

currently on the way to become a mechanical engineer. here are the things that I do on the way.

Build and Hack Stuff

Blog

Workbench!

A lot has changed in the last few months.

I have my own garage space that I can use to explore and create things.

So what’s the first thing that’s needed? Workbenches!

 

starting off on the shop floor wasn't as easy as the article made it sound, but I eventually got it.

starting off on the shop floor wasn’t as easy as the article made it sound, but I eventually got it.

 

it's like building a really small house

it’s like building a really small house

 

had some problems with things being square and lining up properly, mostly because I trusted that my garage floor was even.

had some problems with things being square and lining up properly, mostly because I trusted that my garage floor was even.

 

IMAG0027

 

Didn't realize how big it was until this step

Didn’t realize how big it was until this step

 

MDF feels gooood

MDF feels gooood

 

IMAG0031

 

building the second bench was much easier, since I didn't have to do it on the floor

building the second bench was much easier, since I didn’t have to do it on the floor

 

IMAG0033

 

so much space and potential!

so much space and potential!

 

I found the plans while googling something one day, they can be found here (PDF)

[KR-3]: Crude Fume Extractor

This is another project that I did about a year ago. It goes a long with being a first project that will produce a tool that I would use in later projects. It’s kinda simple and silly now that I look at it, so here’s the write up anyways for archival purposes.

Fume Extractor

Soldering things produces fumes that always somehow manage to go directly to your face no matter which way you tilt your head away from the soldering. I wanted a way to extract the fumes from my workbench so I could breathe again.

Design

I had a whole bunch of fans but I wasn’t satisfied just plopping a fan on my bench. That’s completely lame. So I decided to cut out the duct system from an old Dell P4 system to create some more sophisticated air flow.

It would be designed so that it would suck air from my bench instead of blowing over it, this was so it wouldn’t interfere with what I was working on.

dell_case_dremel

Well, to be honest, this whole project may have been based on the fact that I just wanted to cut metal with my new Dremel I purchased a short time before. So whatever.

dell_air_duct_p4_1dell_air_duct_p4_2dell_air_duct_p4_3

 

 

 

The original fan that came in the case was pretty wimpy for my purposes, so I replaced it with a fan that someone gave me a while back with a warning “this fan made me bleed, be careful Mike” So It was perfect.

extractor_fan_parts1 extractor_fan_parts1 extractor_fan_parts1

 

 

 

I salvaged a power switch from an old DSL modem, and also it’s DC jack which perfectly fit the 12V wall wart I had laying around. I installed those appropriately onto my fan system. I wanted to make sure that nothing made its way into the fan’s blades and died, so that’s why I decided to cut out the back grille of the dell case and include it too.

That’s all there was to it. It was simple and kinda pointless but it was experience!

fume_extractor_finished1 fume_extractor_finished1 fume_extractor_finished1

 

 

 

 

One Year Later

Well, It was cool for a while and worked but I eventually stopped using it. It was kinda cumbersome and the wirring sound got annoying after some time. Actually, as of about 9 months ago, I got my Hakko FX-888 Iron and my soldering work hasn’t really produced much smoke! The fate of this device has yet to be determined. It sure hasn’t proven it’s use lately so when the time comes and I need parts for it, I probably won’t think to hard about it.

 

[KR-1]: Bench-top ATX Power Supply – 1.1

This was actually my very first real project in the world of electronics. It was completed over a year ago, I just never took any good pictures or finished the write up.

Now, since I have been using it and would like to revise the project, I figured it would be appropriate to talk about the first revision and have it documented before it’s changed forever. After all, it was my first :)

Bench-top ATX Power Supply

Proper bench power supplies are expensive, and foodling around with wall warts or USB power is just not very convenient. What is convenient however, is a standard ATX computer power supply. These units are very common, and they’re all very similar. All ATX supplies have +12v, +5v, +3.3v, and -12v with some pretty decent current capabilities. If you find a good one, it might have plenty of current for even more power hungry projects. Just about any standard supply will be fine for simple uses.

One step further, using a LM317 voltage regulator on one of the +12v rails will give you instant adjustable voltage to fill in the gaps between all the fixed voltages (like +6v and +9v).

This is by no means a revolutionary discovery in the electronics’ hobbyist world – there are many projects just like this all over the internet. I simply wanted one of my own, and of course the experience of putting a useful project together.

I picked this is as my first project because first of all it’s easy and simple. Second of all, this would be an invaluable tool to use for all future projects. There’s something awesome about building a tool and using it on a daily basis.

Design

First of all, this project was inspired by this article on TG’s Electronic Exploration Blog. Like I said above, many people have build this project before, but TG really added some extras and made it look super nice. The blue panel meters and clean aluminium made me want one. If you compare our projects, mine is similar, and I would say it’s the more beginner’s version. I don’t have the extra features like the Ammeter or the LDO regulator, just the voltmeter and the normal LM317. These features might be added in my next revision however.

Finding an enclosure was the first challenge. A lot of projects online simply use the original case for the power supply, and throw some circutry in there. Well, I like breathing room and I had so many of these freaking ATX supplies around my lab that why not just gut one and use it’s enclosure?

atx_supplies

So I grabbed most capable supply I had on hand, which (apparently) turned out to be a Dell 250W with about 14A on the +12v rail. I grabbed another supply that – may or may not have been functional – and gutted it for it’s steel case. Like I said, they weren’t in short supply around my place (no pun intended).

The second supply’s steel case was where I’d build my project in.

DSC_0284DSC_0305DSC_0311

 

 

 

I decided to use banana jacks for my leads, so I installed one banana jack for each separate voltage from the power supply along with ground and a variable output. Even a year later, I never got around to labeling all the outputs, and quite frankly I never even used anything besides the 12v or variable out. It was easier just to dial in 5V with the VAR than it was to relocate the lead to the 5v jack.

atx_supply_banana1 atx_supply_banana2 atx_supply_banana3

 

 

 

Next, was to route the wires from the real supply to the case so it looked clean, and hidden. I decided to stack the two cases, and the whole end project would just look like two power supplies stacked. I did this for simplicity, as I didn’t have the resources at the time to cut and modify steel. (at least cleanly).

atx_supply_reroute1 atx_supply_reroute2 atx_supply_reroute3

 

 

 

Each rail has numerous wires for connections to different devices within the computer, I really didn’t need 6 12V lines, so for each output, I cut most of the wires, and heat-shrunk them as close to the PCB as possible as to not get in the way. This was to also make sure they all fit through the hole that I’d drill between the two cases so the wires can “go upstairs”.

I made sure to bring out Purple, Gray and Green so that I can have control over these lines and not have to open the downstairs supply again.

  • Purple is +5VSB “standby” which i’m not using in this revision, but brought it up just in case.
  • Green is Power On. Of course, I wanted to be able to switch this on and off. I didn’t think this through, but the downstairs supply isn’t one that had a mains switch, but the upsairs one was. So what I needed to do was route the green from the bottom to the top and use the already present switch to turn the supply on. Easy. All you do is ground Green and power is on.
  • Gray is Power OK. This is used to tell the computer that everything is okay and to turn on. For now, I just decided to hook this up to an LED.

After getting everything routed to the right place, I used rivets to permanently attach the cases together. I did it in a way such that It was still possible to remove the lid from the bottom supply to service it if needed. I made a mistake here, as I didn’t record the specs for the ‘live’ supply before I affixed the case over it. I didn’t want to undo the rivets so I just went with it. Over a year later (at the time of writing this) I had the bright Idea of checking the photos that I took… and one high-res photo later, I had the specs.

A lot of other projects online have a power resistor somewhere in the project to put a load on the PSU to keep it on. I think I got lucky, and this PSU doesn’t need that nonsense, or maybe everyone else is just crazy. If you read this and have a good reason as to why I still need one, let me know in the comments – I’ve been using this for over a year and had no problems with it staying on.

Next is the Regulator Circuit. At the time, I was an extreme novice at this, so It took a few tries to get this basic circuit to work. I’m not going to go into detail on how this circuit is designed, as it’s pretty common. I think it’s even an example in the LM317′s datasheet so just google it. Here’s a good starting point that’s very similar to what I did on Ladyada’s Site.

My project compared to TG’s project – he uses a more complex Low Drop Out regulator which gives him the ability to vary his 12v line between about one volt to just barely almost 12v. My circuit can go to about 10.1v on the VAR line, and that’s good enough for me. If i need exactly 12V, I’ll switch to the 12V rail.

ATX_supply_lm317_2ATX_supply_lm317_3 ATX_supply_lm317_1

 

 

The heat sink is probably a bit overkill, but it was what I had on-hand. I pulled it from a very old AT motherboard.

One of the big things I try to do with my projects is to make them takeapartable. That is, to make them modular so that I can take them apart and change parts easily without a lot of soldering. I designed this project to use connectors that I found in computers so that I can remove parts in the future. You can see from the photos, there’s a 12v rail Molex, a CD Audio connector, a 3-pin fan connector (never actually got used, product of bad planning), and later you will see an old AT PSU connector linking the supply controls with the regulator board.

ATX_supply_lm317_4 ATX_supply_lm317_5 ATX_supply_lm317_6

 

 

 

Above is the regulator circuit installed in the ‘upstairs’ enclosure, along with all the connectors in place. The panel meter (see below), LEDs and potentiometer are also mounted and ready to go.

I cut out the standoffs from an old modem’s plastic case and used them to standoff the regulator board. It came out sloppy, but I’ll make up for it in the next revision.

atx_supply_panel_meter1

Like TG’s version of this, I used one of those awesome 3-digit blue digital panel voltmeters to display the output of the VAR line. I didn’t include an ammeter in this revision, but plan to in the future. These panel meters are best found on ebay from a store called “asia-engineer”. It takes a few days to get to you, but they’re about $10 each and work nice. The plus with these meters is that they can use the same supply they are reading so there’s no need for a shunt or any nonsense like that. It measures between 0v-20v.

DSC_1307

atx_supply_final3 atx_supply_final2atx_supply_final1

 

 

 

The red jacks in the middle are the +5V, +3.3V, +12V, and -12V outs. Green is the variable output.

For some reason, I decided to give the variable output it’s own switch. I think I just wanted to use the cool flippy switch or something because this is a pretty silly feature. I never used it.

Also, like mentioned above, I never used the 5V, 3.3V or -12V for anything but could be useful if you need to have two different voltages at the same time in the same project. I might keep these in the future revision.

The probes are from Radioshack, with alligator clips affixed to the ends.

What I learned

I don’t know what I was thinking when I picked out the potentiometer. It’s completely wrong. after it’s turned about 1/3rd the way, it sets the regulator to max voltage and the other 2/3rds of rotation is nothing. This makes it very difficult to dial in a specific voltage as it’s really touchy. Next time I’ll pay more attention to this.

All my holes I drilled are crooked. I’ll do this better next time.

Once again, planning is key. I wasted time soldering in a fan connector thinking that I would connect the case fan to this. Well, it turns out that since the board and fan are on the same part of the shell, there was no need to separate them. I simply wired the fan to the main harness.

Next time I’ll remember to record the specs for the supply before permanently covering it with up by riveting the other case over the label.

Future Revision [KR-1.2]

I found an awesome Aluminium case at Skycraft Orlando a couple weekends ago and It’s perfect for the future revision of this project. It has enough space were I can relocate the original power supply’s board into it, and also have room for the regulator board and possibly more panel meters (ammeter). I’m pretty excited, and I have started the planning process. I’ll update this section with a link in the future.

 

[KR-15]: Sales Counter – 15.1

So I’ve got a new job.

I work remotely as a Sales-Technician –  I take technical support calls for a private company and sell technical service to customers so that I can remotely access and fix their computers. My job’s current focus is taking sales calls and there are certain metrics that must be met to be in good standing. One of those metrics is the close rate, or percentage of sales made out of sales calls answered.

This is great, and I love it so far. One issue I came across was keeping track of my calls and sales for my own records. The supervisors keep track of the stats and issue reports a few times a week as needed, although I like to keep track of my stats in real time. The job is heavy on multitasking, and while having two customers chatting with you, remotely accessing their computer and supervisors asking you questions via chat, it’s easy to forget a tally mark on my spreadsheet on screen that’s minimized in the corner somewhere.

The Sales Counter

I’ll be honest – I just really wanted to build something using big clicky tactile classic arcade buttons like these, and then finally the sales counter idea came up. The idea was to build a fun device that I could mash big arcade buttons every time I answered a sales call, and/or made a sale. This device would display the number of calls vs. the number of sales and possibly also the actual close percentage. One further thought was to have it play some little beepy tune every time a sale was made but what I had thought up so far was already a challenge.

It sounded fun to use. For the first time in a while it was a project that was both challenging to me and actually had a purpose other than sitting on my shelf wasting space.

The Challenge

From the beginning, this project was more about the challenge of teaching myself how to use all of the different components and putting them all together in one functional system.

Things I knew how to do before the project:

  • Prototype something in Arduino and transfer it to an ATTiny chip
  • How to use buttons, switches, and other various basic electronic components
  • Fit a lot of things in a small space
  • Display a digit on a single 7-Segment LED Display (directly to Arduino, using all the pins)

Things I didn’t know how to do before the project:

  • Use a shift register
  • Program an Arduino to use a shift register as multiple digital outputs
  • Use a 4-digit, 7-segment display multiplexed
  • Program a microcontroller to use multiplexed 7-segment display
  • Arduino multitasking – (performing separate functions at the same time and not using the Arduino delay(); function.)

Most of the project was a mystery at the beginning, although I knew that the knowledge on how to use these components were readily available online.

The goal was to create a device which had a small footprint on my desktop. It would have two buttons, each used to increment the display/counter each time a call was answered or a sale was made. A large LED display would display (up to two digits each) the amount of calls and the amount of sales made. A third function would switch the display from the actual count to a percentage using a decimal and also be sturdy enough to withstand me mashing the buttons.

Preparation and Design

I ordered all the necessary parts for this project from Sparkfun Electronics. They were the easiest to order from and the selection was cut and dry, I knew also that their support community would help if I needed any, and the staff is friendly!

I already had all the other parts on hand like an Arduino with a proto-shield, a handful of ATTiny85 chips, and various passive components.

I had originally intended on having three separate LED displays (one 4-digit for percentage, and two other separate 2-digits for the calls/sales counters) but this was going to come out very wonky, complicated and taken more space.

A big part of this design was that It needed to be small. I didn’t want something large and in the way on my desk that would kill the fun. Also, I really don’t like installing an Ardunio into a semi-finished project/prototype. It’s just silly and large – so I opted to just prototype on the Arduino and port the program to an ATTiny85

Challenges

Research online showed that I could have 8, 16, 24, etc. digital outputs using the 74HC595 8-bit shift register and only use three pins on the Arduino. I knew that if this was possible on the Arduino using it’s IDE, then It had to be possible on an ATTiny85 which I have worked with on a previous project. I would program and prototype on the Arduino, and then port everything to the ATTiny while using the Arduino IDE that I was familiar with. I was cutting it close though, the ATTiny85 has (theoretically) 6 digital I/O pins, but one was the RESET pin. I found online that it was possible to set this pin as a digital I/O using the proper tools (high-voltage serial programmer) although I was only using an Arduino as an ISP.

Enclosure Challenge

I needed an enclosure. Where do you go when you need something cheap, and sometimes still works so that you can rip it apart? The local thrift store.

That’s where I found this:

spartus_1108_vintage_clock

 

A crappy old digital clock from the 80′s. (this is someone elses’ image, but it’s the exact same clock). I said hey, that’s got a 4-digit 7-segment display, and isn’t huge – so that will work.

Holy crap – I actually found datasheets for the chip inside it and the display. I don’t have the pictures at the moment, but you’re not missing much. The inside is a couple PCBs, one having a handful of passive components and a large DIP Texas Instruments general-purpose digital alarm clock chip.

Well, I wanted to use the display that came with the clock but for this being the beginning of the project, it was a bit overwhelming to figure it out without even really having a concrete understanding of how to even multiplex, or how this type of display works. When sticking it on a breadboard and poking it with some probes, It seemed to have a very strange type of multiplexing that only lit certain digits at certain times since this was meant to be a cheap clock. It also wouldn’t work with my project since this is a 12-hr format clock which means they were to cheap to include all the segments for the first digit. (i.e, the clock’s first digit will only display the number one and nothing higher)

But the enclosure was nice. It had plenty of space on top for my big buttons, the LED display I ordered from Sparkfun fit perfectly in the old display’s place, and the whole thing wasn’t giant.

Programming

The first thing I needed to do was learn how to use a shift-register. This was needed to be able to multi-plex the display and only use 3 digital I/O pins on my microcontroller. This was important since I didn’t plan on using the Ardunio in the final project, I needed to use the ATTiny85.

I did a lot of research and could hardly find anything that involved exactly what I had planned. Almost nothing online involved driving a 4-digit 7-segment display fully multiplexed. This display only has 12 pins.

I found an excellent resource for the basics of 8-bit registers on a bildr blog page: Can you move over? The 74HC595 8 bit shift register

Sparkfun has their own tutorial video by Nick Poole which demonstrates what a shift-register is: Sparkfun Shift Registers

These resources were extremely useful in learning the basics but the challenge was to translate the basics of a shift register to how it can be useful for controlling an LED display. I learned that here: Getting Started with Ardunio – Chapter tweleve – tronixstuff Mr. John Boxall starts off this post by talking about exactly what I’m doing. (everything minus the DS1307 Timer and the rotary encoder.). This image alone is what really got me started:

Credit: John Boxall, tronixstuff.wordpress.com

This shows how the 8 segments (decimal point) can all be individually controlled, by cycling through the common cathodes quickly. It’s Multiplexing!

From electronicsblog.net, I was able to find some useful code to help address the individual digits and mix this all in with the registers and multiplexing: Arduino 4 digits 7 segments LED countdown timer with buzzer. I didn’t need the buzzer part, but what I used was the functions related to controlling the individual digits during each cathode-cycle.

Here’s the code I strung together to display a bunch of zeros on the display: show_digits_zero.ino (it’s a txt file).

Put Things Together

Here we have the fully functional LED display + Arduino + shift registers displaying some test numbers.

sales_counter_proto1

 

sales_counter_proto2

 

Video:

 

KR-15_002_SCHEMATIC

 

 

errm, I apologize, this schematic is incorrect as there are supposed to be resistors between the registers and the LED display… see final schematic.

The three SPST buttons are the controls for the counter. Sales and Calls are the big arcade buttons that will be mashed to increment the amount of sales and calls. A third SPST will switch the counter between two modes: percent mode and regular mode. Percent mode does what it says, and turns on the decimal point, and shows the current close rate percentage. For this function, I decided to use the snooze button which was already present on the clock enclosure. So I’d be salvaging part of the clock’s PCB buttons.

Porting to ATTiny85

The challenges I came across are common that anyone doing this would encounter, I will detail this adventure later in another post in the future (this might turn into a link to that post one day).

The main issue I had with porting everything over was the fiasco with the RESET pin. While only using the Arduino as ISP, the RESET pin on the ATTiny is necessary to re-burn the chip. Many resources online indicated that it’s possible to program and re-program the chip without the RESET pin, but a high-voltage programmer was needed (not arduino as ISP). I could do it using only Arduino, but there was a risk. User Panici on this thread reveals a way to use the Arduino to re-burn the bootloader to use pin PB5 on the ATTiny as an I/O, but it would be a one-shot chance. Once the fuse is set, and the code is loaded, there’s no going back unless you have a HVSP (which DIY versions exist but this was easier).

Basically, I had to get my code working to test (minus the percent mode button, since that used the RESET pin) and once everything worked, I just had to hope the the percent button would work after porting over.

Well, the first attempt failed. And for obvious reasons. If you look in the thread linked above, I copied the exact command that was there without changing the reference for the hex file. So I pretty much burned a blank program to the chip and (for now) bricked it.

The next attempt worked, got the program over, and PB5 (reset) as the percent mode button worked! No turning back now, the chip is programmed and set. Anything else I wanted to change would need a new chip or a HVSP.

Here I have a second breadboard with just the ATtiny85, and it’s driving the registers and LEDs. If you look closely, the Arduino is present but disconnected. You can also see that it’s currently in percent mode displaying “60.00″ which would be 60.00%

sales_counter_with_attiny85

sales_counter_with_attiny85_2

 

Moving from Breadboard to Perfboard

Here’s the space I had to work with:

kr-15_sales_counter_enclosure1

 

kr-15_sales_counter_enclosure1

Now to solder everything to it’s final resting place, and add a LM7805 5v Regulator:

sales_counter_with_attiny85_board

 

 

Then shove it all in and add a 9v battery!

kr-15_sales_counter_enclosure3

 

Yeah, the numbers turned out red instead of blue – that’s because the window on the clock had a red tint to it. Really wanted blue, but I’ll have to settle until I can maybe make a new window from acrylic or something.

So here’s how it works

So with reference to the photo below, it shows “0602″. Which, I know they’re not really separated but it’s going to have to do. The two digits on the left “06″ represent the number of calls answered and the green button on the left increments this number. The two digits on the right “02″ represent the number of sales made and the green button on the right increments this number.

sales_counter_demo1

When pressing the “Snooze button” (the long button on the left side), the counter switches to ‘percent mode’ which displays the current close percentage. This is simiply the number of sales made divided by the number of calls taken then multiplied by 100. The result is “33.33″ or 33.33%

sales_counter_demo2

 

When the percentage is 100%, the decimal moves over to the right to display “100.0″ or 100%. I didn’t program this thing to display anything over 100% as it wasn’t needed and not likely that I’ll make more sales than amount of calls taken.

Final Schematic

KR-1510_schematic

 

On The Job Testing

After finalizing it, I used it for a few days on the job to see how it worked:

Battery Issues

Well, about half way through my first shift, my 9v battery died. I didn’t really put any thought into how much power this thing consumes with the super bright blue LED’s and the ATTiny85. Moving forward, I decided that no matter what numbers I came up with, even if it meant replacing a 9v every 1-2 months, I didn’t want to spend the money.

Further, I really didn’t need to have the device be super portable, so finding a stable power source sounded like an OK idea. I decided to replace the 9v battery pigtails with an old USB cable so that I can use the 5v from my computer. Works perfectly and no extra cost necessary.

Visibility

The window on the clock is tinted red. My super awesome bright LED display is blue. This combination makes it very difficult to see my display when other lights are on in the room. You can even see it from the pictures above how hard it is to see. If i turn my second desk lamp on then forget it. I was thinking the original red tinted window would be okay but it turns out that it’s not so I might have to change it out or find a way to make it less red.

Video coming soon