Thursday, January 9, 2014

PCB etching with vinegar... (part 3)

Ok, quick post while at lunch. This is a recap of my progress...

1st attempt:
Thermal transfer was pretty good, but did not let it etch long enough so that it's a big short everywhere.

2nd attempt:
Thermal transfer was also pretty good, etching was good, but some traces shorted and some open. Might be usable.

3rd attempt:
On that attempt I changed the artwork to have a ground surface. I figured that it would speed up the etching. Also did some trace in-between the pads smaller so as to avoid short.
Unfortunately my paper moved while ironing... So useless to go through the etching part.

This is turning out to be a bit harder that I had anticipated, but I am making progress and learning from my errors.

Stay tuned.

Wednesday, January 8, 2014

PCB etching with vinegar... (part 2)

Ok, so this is part 2 on etching a PCB with vinegar.

This time it's for real. I printed my design on a glossy grocery add I just received. I used the most glossy and cheapest paper quality I found.


Using a paper that feels cheap is apparently good because it will soak up the water and will become pulp more easily when time to be removed.

I cleaned up the copper board with one of those synthetic ScotchBrite type of washing sponge so that it was all shinny. You don't want finger grease on the copper. I also cut the copper board to the same size as my PCB artwork.



Next I heated my wife iron (don't tell her) at the 'wool' setting. Once ready the first thing to do is warm up the copper board. Leave the iron on it for about 30s. Then flip your printed artwork on the copper surface. This will somewhat glue the paper to the board so that it does not move when you start moving the iron on it.

I then put the iron on the paper and moved it a bit around trying to apply heat everywhere. Don't leave it too long or the laser 'ink' will melt and start to somewhat leak from it's original printed layout.


While the board is cooling down prepare a recipient with lukewarm water. Once the board is cold to the touch, simply put it in the water.


This will make the paper go to a pulp state after a few minutes. When you see that the paper is starting to show air bubble, it's time to start peeling it away. Go gently at first, but I found that the laser 'ink' did adhere very well to the copper. With your finger and the help of the water remove any little piece of paper pulp.


The result is pretty amazing. You can see areas where I did not apply enough heat and some other that I did too much, but the traces looked good. So off to the Vinegar/H2O2/NaCl solution we go:


It tool a while, and I added salt a few times, but after about 4h30 it looked pretty much done. So I pulled it out, cleaned it under tap water and used nail polish remover to remove the ink. The result looked very good:


Until I tested with my multi-meter... Short everywhere, even the etched parts were short... I did not leave it long enough in the solution... And now that I cleaned the ink, it's scrap...

So note to myself, do a basic continuity check BEFORE cleaning the ink...

So I will restart over again tonight with a new piece of copper board and will use this scrap to practice drilling the holes...







Tuesday, January 7, 2014

PCB etching with vinegar... (part 1)

Ok, we all know that we can use FeCl or a mix of muriatic acid and hydrogen peroxide to etch PCB, but those are nasty chemicals that I don't really want to mess with. Reading on the net I found people using white vinegar, hydrogen peroxide and salt, all stuff you can buy at your local grocery store!

This will be a multi-part post where I will show my experimentations on this. Note that I have never etched my own PCB so you will get the full newbi experience.

My first test is just to see if this mixture can really remove some copper. So I just cut a small half inch square and give it a try.


The mixture according to what I read is 60% vinegar and 40% hydrogen peroxide and some salt... So I measured that and put that in an old plastic cup and dropped my small copper piece in.


Apparently this thing is supposed to be bubbling... So I added a bit of salt directly on the copper piece.


As you can see this had an effect and a reaction is occurring. I let it doing it's thing for 15 minutes:


It is doing something to the copper ! There was no more bubbling so added a bit more salt to start the reaction again:


Not much more etching after 30 minutes:


One thing... My hydrogen peroxide is expired... since 2010 (don't ask me why we still had that in our house) It may not help... 

After about 1h maybe I could see that the copper was thinning. So I added 1 part of vinegar and about 1 tablespoon of salt and put the container in a bath of hot water.


After about 1.5h it was pretty much done. I think the added acidity and hot bath really helped.


So myth confirmed, etching copper board with vinegar, hydrogen peroxide and salt is possible !

While this was going on I tried the PCB art work heat transfer method. This involves printing your artwork on a glossy paper and using a hot iron to transfer the laser printer ink (which is actually a plastic based compound) to the copper board. Well, that did not work out so good:


I used a 8.5x11 label backing paper as my glossy paper, may this was the problem. Thinking about it I did not wait for the copper board and paper to cool down before trying to peel it off. Dooh ! Also the glossy moves while I pressed the iron. Maybe I should secure it with tape or something.

So stay tune as I will be trying that again and writing a blog post as I go along.







Sunday, January 5, 2014

TP-LINK TL-WN725N on a RaspberryPi

Ok, got a TP-LINK TL-WN725N from MasterVox Electronique yesterday (http://www.master-vox.com/) for 15$ with the intend to use in on my RaspberryPi. The key was a v2 of the TL-WN725N.

Off course it did not work out of the box. After a bit Googling and failed attempt I finally stumbled on this post:

http://www.raspberrypi.org/phpBB3/viewtopic.php?p=462982#p462982

Which was the key to success. The trick is really to get the right module for your kernel.

Friday, January 3, 2014

Arduino and RaspberryPi low temperature tests

For the past few months I have been working on a project that required a RaspberryPi and Arduino (and some other components) to survive Quebec temperature.

For those who don't know our temperature, winter can easilly reach bellow -30C (-22F) and summer we sometimes hit around 30C (86F). This past few days have been quite cold reaching in the -26C with a wind chill effect of -35C so it was the best time to perform a cold powered-on test.

The setup was simple. A RaspberryPi running Raspbian with a DS18B20 temperature sensor, a Startech 4 port USB hub where an Arduino Uno is attached. Every 15s a script would record the temperature and every minute an other script would look (using lsusb) to see if the USB hub and Arduino were still alive. The setup looked like this:


The plastic container was scealed with tape, put in a 'ziplock' bag and left overnight on the rooftop of my car.



The power was provided by a small 75W APC DC-AC power inverter sitting in the car and connected to the car battery:


Well, according to the DS18B20 temperature sensor it got to about -22C last night and the resulting temperature graph looks like this:


Best of all no disconnection of the USB hub or Arduino were detected and the RaspberryPi did not reboot or lockup.

Thursday, July 25, 2013

CVS: Changing from extssh to ext

Linux:
find . -name Root -exec sed -i 's/extssh/ext/' {} \;

OSX:
find . -name 'Root' | xargs perl -pi -e 's/extssh/ext/g'

Reverse SSH - Poor man site-to-site communication

Taken from http://toic.org/blog/2009/01/18/reverse-ssh-port-forwarding/

Real life example
I will assume that home PC is connected via dynamically assigned IP address. First thing you will need to make sure you have ssh server installed on your home PC and it should be accessible from Internet. If you have some NAT routers, be sure to forward port 22 to your home PC. Secondly you will need to setup a dyndns account so you can connect to your home PC regardless of IP address changes. Now the goal will be to connect to ssh server on our office PC. so the port in question will be 22 if you wish to forward another port change it in your configuration accordingly. For the purpose of this example i will name my home PC: bhome.dyndns.com office computer name will be bwork.office.com bwork computer uses private IP range of 192.168.0.0/24 with address 192.168.0.100 So if the firewall is preventing outside connections to our bwork computer we must initiate connection from it. We can do this with simple ssh command:

ssh -R 2210:localhost:22 bhome.dyndns.com

So what just happened here? We are initiating ssh connection "ssh" with reverse port forwarding option "-R" which will then open listening port "2210:" who is going to be forwarded back to localhost's port ":22" and all this will happen on remote computer "bhome.dyndns.com". This connection represents the green line in the diagram above, and it's a legit connection as far as corporate firewall is concerned. So if we now open up a terminal on bhome computer, and type in:

ssh -p 2210 localhost

we will try to connect to localhost (bhome.dyndns.com) on port 2210. Since that port is setuped by remote ssh connection it will tunnel the request back via that link to the bwork.office.com computer. This is the red line on the diagram above. Looking from firewall's perspective it's a legit traffic, since it is responding traffic on already initiated link from bwork computer. 


Some more fun with reverse tunnels.
But i have a printer behind that corporate firewall. How can i connect to it? Easy... remember the first example? the command ssh -R is taking 5 arguments of which 4 are mandatory

ssh -R [bind_address:]port:host:hostport

bind_address is the network address on which port will be listening, and forwarded to host (connected to network from which reverse tunnel originated) on hostport. so if we issue the command like this on our bwork pc:

ssh -R 89.xxx.xx.4:2211:192.168.0.10:631 bserver.outside.com

we will get something like this: reverese-ssh4so again we have previously established reverse ssh tunnel listening on port 2210 to channel the ssh connection towards office PC. Now with this new command we established the reverse ssh tunnel (yellow line) towards bserver which will listen for incoming connections on port 2211. When the home pc makes a data connection to port 2211 on bserver (brown line) it is then forwarded to office PC (black line) which is then redirected towards office printer at address 192.168.0.10 on port 631 (violet line). Remember, all this traffic is passing trough corporate firewall as legit traffic, even if the illustration perhaps shows otherwise.

Automating the task
So by now we should have covered the basics on how to bypass corporate firewall in order to get to your office computer and network equipment. Now ssh -R isn't really practical, it consumes one terminal, and as soon as it shuts down there is no tunnel and no outside connectivity for that matter. The easiest thing to do is putting a cron job that will connect to remote server if the connection fails, office computer reboots etc. First of all generate ssh keys, and add them to ssh-agent so that script won't ask you for remote server's password all the time. Next we will add two extra parameters to our command -N and -f so that the connection goes into the background. the command will look like:

ssh -N -f -R [bind_address:]port:host:hostport 

next we need a shell script that will be triggered by the cron. For this example we will use the Real life example 2.

#!/bin/sh
COMMAND="ssh -N -f -R 89.xxx.xx.4:2210:localhost:22 bserver.outside.com"
pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND


now edit this code so it suits your needs, and save it in your home dir as reverse_ssh_tunnel.sh Now we need to add a crontab entry which will trigger this script every 5 minutes.

crontab -e

and add:

/5 * /bin/sh /home/username/reverse_ssh_tunnel.sh

If you are connecting to different user name on remote server you can edit your commands so they look like: ssh -R [bind_address]:port:host:host_port username@remote_host