Mar 11, 2016

Tubeless Tire Pressure Calculator

Cake Form Yupiii! I went tubeless! But now a new problem arises and needs to be solved:
Because I'm so lazy that I want neither to recalculate each time time a gain or loose a pound, nor to struggle to remembering where I have put the file I used to auto calculate, I have created the following form based on the formula proposed by Stan's No Tubes.

It calculates the tire pressure for a tubeless wheel based on the rider's weight.
My plan is to use it each time I would inflate the wheels, at least for a while, until will find the ideal tire pressure for me. Then I would have to figure how to write it down so I would never forget the values. :))

Calculate Tire Pressure kilograms pounds



If you feel you would have the same problem as I do, you are invited to use my Pressure Calculator. I hope you would like it. Enjoy!

[Update:] Running at 1.88 bar on my rear Nobby Nic 2.25 tire seems to be to less for my current 80 Kg. I need to consider rising to 2.1 bars or loosing some weight. I guess I would choose the 1st option :))

Nov 20, 2013

Building the world's cheapest baby monitor

It's time for my little baby daughter to sleep in her own bedroom. 
However, we would like to monitor her from our bedroom in case she wakes up crying. We have a baby phone from First Years, but somehow it seems I cannot get along with it. It might be because our baby is mostly whimpering and rarely crying. And let's not forget my reluctance to use wireless technology, especially near my baby.

So I decided I should build a baby phone monitoring system.
I had a pair of old PC speakers, I guess everybody has such somewhere around and I told to myself why not connecting a microphone directly to the speakers? They are active speakers, meaning they have their own power supply, so it should work. 


Well, googleing a little bit I found out it won't work, due to the difference between the voltage microphone outputs and the voltage expected as input by the speakers. The microphone's output voltage is about millivolts, while the speakers expects input signal of a few volts as depicted in the image below.


So, I had to use a preamplifier in order to amplify the electric signal generated by the microphone to ~ 0.7 volts. The one I used is produced by a Romanian company, I found it in a local shop for around 5$.






It also contains an embedded microphone which I decided to use.
Since the active speakers are powered at 12v, I used a 4 wires cable so, besides transporting the voice signal, I could be able to power the amplifier as well.

I opened the powered speaker's case, drill a small hole in the rear, plugged the 4 wires cable trough it and finally soldered two wires to transformer's +12v and ground. The result should look like this:


On the other end, I soldered the +12 volts (red in the picture below) wire to the preamplifier's power pin, the ground (thick white) to the preamplifier's ground pin and a third one (green) to the preamplifier's mic output.


Eventually, on the speaker's end I have cut and opened cable's isolating shield so I could access the wires.  I soldered a 3.5 mm audio socket, connecting the mic output to both stereo left and stereo right pins.
In the end I connected the speakers' audio plug to the audio socket.

So here it is, as i promised the world's cheapest baby monitor!

Project cost:
Old speakers: free
Old mic - not needed eventually: free
Preamplifier: 5$
3.5 mm audio socket: 1$
7 meter of 4 wires cable: 1$
Total cost: 7$

If you plan to build a similar project, I have listed two similar preamplifiers which could be easily acquired from eBay:
If you like, you could look for others. Anyhow, I strongly suggest to use a preamplifier powered by the with the same voltage as the speakers, in order to use the latter as a power source and save an additional unit for powering the preamplifier. 
An additional advantage for doing that would be switching the preamplifier on and off from the same switch used to power on /off the speakers.   


If you liked my project feel free to leave a comment.  

Nov 19, 2013

My first diagram of a circuit board

Last night I have drawn my first diagram of a circuit board.

The era of  electronic devices home repair has long gone. How ever it was extremely fun to practice drawing diagrams and tying to pin point the faulty component, a thing my father used to do frequently during my childhood, spending countless hours to fix  TV sets for friends or relatives.

The board is quite simple, the product is a night light which suddenly stooped working after about two months. That annoyed a lot so I decided to have a look inside.


I found out that the diode D3 on the schematic above was faulty. It's about a zener diode 1N473A which I have replaced with an equivalent bought with 0.1 euro from a local shop.

Even if it was  working somehow after I have removed the faulty diode, it's now working beyond the doubt when replacing it with a new one.
Feeling proud.

Many thanks to my father for the electronic lessons I didn't pay attention during my youth and for patiently reminding me now things I have once learned and soon forgotten.  

Nov 11, 2013

How to control Android device over USB connection

The following article describes my actions related to my particular environment and the particular set which is working for me. No warranty or respectability for any damage or side effect is taken.
However, I will do my best to answer questions posted on the blog in order to help other to configure the same.
The article assumes one has the phone drivers and  adb  already installed.


Since I use to spend countless hours in front of my PC and since most of the time a have my Android mobile connected to the USB charger, I considered some options to control the phone via browser.

Wouldn't it be convenient to read or write SMS from your PC, using a full size keyboard? Wouldn't it be great to access contacts, or systems settings trough the browser? Oh boy, I know I'd loved that!

Looking to the Market (to be noted I prefer the old Android Market naming in stead of new Play) I found a few nice Apps. like AirDroid, Remote Desktop, 3CX DroidDesktop etc. Out of all, the later - 3CX DroidDesktop, previously known as LazyDroid - is the only one which runs over an USB connections, so the one tho choose.

So far so good, until I realized there are a lot of options to perform prior to benefiting out of this marvelous set up: one needs to first connect the Android device to the computer using the USB cable, run the connection.bat script, start a browser and point it to the local address using the right port. To much for my taste... no wonder I preferred the App. known as LazyDroid.

So I started to look for ways to automate things.

Plug In Launcher. It gives you the possibility to run an application when connecting an usb cable, headsets etc...and it does it for free! :)
So I have downloaded and installed Plug in launcher on my phone and configured it to run 3CX DroidDesktop whenever it detects an USB cable connection towards a PC.

Using the instructions provided on the following link http://www.mobiledevicemanager.com/3cxdroiddesktop/manual/usb-screenshots-windows/, I have developed the following script:

@ECHO OFF
ECHO Running the connect.bat script content from C:\Program Files (x86)\Android\adb_win
:begin
set Pathname="C:\Program Files (x86)\Android\android-sdk\platform-tools"
cd /d %Pathname%
adb forward tcp:8999 tcp:8999
adb forward tcp:5901 tcp:5901
adb forward tcp:2221 tcp:2221
adb forward tcp:21000 tcp:21000
echo Now shoud be lounching http://localhost:%port%/ in browser
start chrome "http://localhost:8999/"


The script uses adb commands and part of the script connect.bat in order to configure the port forwarding. For simplicity I have decided to use the default port 8999.
Not to forger, one has to enable USB debugging in order this to work.


Further on, I needed to find a way to run the above script (called AndroRemote.bat) automatically on my PC when connecting the Android phone, the same way as I did above with the Plug In Launcher. Think is that I wouldn't like to use any additional application, but use the embedded Task Scheduler in stead.

To do that, I had to find out an event related to connecting the mobile phone to the PC's USB port. I have managed to find it in the Event Viewer, under Applications and Servvices >> Microsoft >> Windows >> DriverFrameWorks - User Mode >> Operational.


The event number in my case is 2101, as can be seen in the picture below. Further on, right click on the event would allow the possibility to attached it to the Task Scheduler and trigger an action.


The next images will illustrate how I have configured the Task Scheduler.





Apr 25, 2013

Enhanced script to modify the Windows default route

[ for the complete story check the post Modify Windows default route with a script when connecting to wifi ]


@ECHO OFF
ECHO This script will change the wireless connection routing.
set /p runScript=Do you really want to run the script now [y/n]?:

:UINTERACTION
IF "%runScript%"=="y" GOTO ROUTEMAN
IF "%runScript%"=="n" GOTO End
set /p runScript=You need to answer with "y" or "n":
GOTO UINTERACTION


:ROUTEMAN
route delete 0.0.0.0 MASK 0.0.0.0 192.168.1.1

ping -a myipaddress.dyndns.org -n 1 > testresult.tmp
for /f "tokens=2  delims=[" %%G IN (testresult.tmp) DO echo %%G > testresult.tmp
for /f "tokens=1  delims=]" %%G IN (testresult.tmp) DO ( echo address for myipaddress.dyndns.org is: %%G

del testresult.tmp


REM add route for myipaddress.dyndns.org
echo address for myipaddress.dyndns.org is: %remoteIP%
route add %%G mask 255.255.255.255 192.168.1.1 )
tracert -h 2 myipaddress.dyndns.org
GOTO End

:END

Jan 30, 2013

Configuring SSH tunneling with DD-WRT and Putty

I was looking for a free VPN solution in order to remotely connect to my home network. The answer seems straight forward: OpenVPN. With Optware the installation is just another piece of cake, however the pain begins afterwards: should I deploy a NAT or a bridged network configuration?  I should use another  Linux Machine to generate the certificates and copy them do my DD-WRT router. I should install a OpenVPN client on each computer I would like to use to access my network and deploy a certificate for it. Configure networking on the client etc... And on top of it I should have another process running on my router facing already its imitations with his 32 MB RAM memory.

So I say, there should be a better way! And that's SSH tunneling.

In order to configure that I have opened the SSH port on my router, so due to the lovely free Dyndns service I should be able to establish a ssh connection from everywhere in the World.  It's a good practice to use a different port than 22, in order to mask the service listening behind. I have chosen mine above 1024, out of the well known port range.

Further on, from DD-WRT GUI, on the Services >> Services tab I have enabled SSH TCP Forwarding as shown below:

Now on the remote PC, the one which I will use from remote in order to access my LAN, I have to set up a Putty connection:

After saving, for the above defined session I went to SSH >> tunnels. The image below shows how to configure the tunneling for http protocol in order to be able to access the GUI from remote. 


Be aware that I  have the remote GUI administration turned off, and the only port being opened in the firewall is the one used for SSH.

Further on I will use Mozilla Firefox for configuring a proxy, since Mozilla turned out to be the most versatile browser when it comes to proxy configuration. So I configured a Socks v5 local proxy listening on port 8080. 



Having this configured, all I need to do is to start a SSH connection to my DD-WRT router and once connected to use Mozilla browser in order to access my router's GUI, as being inside the LAN.




In the same manner, one can configure RDP, in order to access the windows machines inside the LAN 

but more about this probably on a future episode.



Jan 21, 2013

Modify Windows default route with a script when connecting to wifi

My corporate network proxy blocks any outgoing ssh connection, therefore in order to access my home network I would need to use the "clean" wireless connection provided by the company for special projects, test or backup scenarios.

Even if my corporate network policy does not specifically prohibit using the corporate network together with a free wireless network, the practice demonstrated that doing so would sooner or later end up with a local network outage. Since I don't have a clue why that might happen I will just take it for granted, or maybe leave you, the networking guys reading my post to provide an answer.

But how to use both corporate network and unfiltered WiFi without causing a local outage affecting around 100 hundred persons?

The answer would be deleting the default route Windows adds when connecting to the wireless network and replacing it with a specific route pointing to my IP address.
I would have loved to be able to do all this from a script which would also enable the wireless connection, but since I was not able to find an easy way to do it, I have developed another plan:

A script will be triggered whenever I use the physical switch on my laptop in order to turn wireless on and automatically connect to the predefined wireless network.

This is pretty easy to achieve in Windows 7: right click on My computer >> select Manage from the drop down list >> go to Task Scheduler  >> and select Create Task.
On the General tab, I gave the name of the task :RunWhenWirelessNetworkOn.

On the Triggers tab, select the trigger "On an Event" and choose form the Log dropdown list "Micrhosoft-Windows-NetworlProfile/Operational".


On the actions tab, select the action "Start a program" and provide the path to my script "D:\UserData\***\My Documents\bin\RouteMan.bat". I will list the content of the script a little later.


Last but not least, I don't want the script to run when I connect to each wireless network in this world, but only when I connect to the specific network whose SSID I have selected under tab Condition, from the dropdown list "Start only of the following network connection is available".


Finally hit OK to save the current settings.

Now, let's discuss the script, which should look like this:

@ECHO OFF
ECHO This script will change the wireless connection routing.
set /p runScript=Do you really want to run the script now [y/n]?:

:UINTERACTION
IF "%runScript%"=="y" GOTO ROUTEMAN
IF "%runScript%"=="n" GOTO End
set /p runScript=You need to answer with "y" or "n":
GOTO UINTERACTION


:ROUTEMAN
route delete 0.0.0.0 MASK 0.0.0.0 192.168.1.1


nslookup myaddress.dyndns.org
set /P remoteIP=Please enter remote computer address:

REM add route for myaddress.dyndns.org
route add %remoteIP% mask 255.255.255.255 192.168.1.1
tracert myaddress.dyndns.org
GOTO End


later edit for the enhanced version of the script, check the post: Enhanced script to modify the Windows default route ]