Arduino and H-Bridge ebay drivers

So I’m building a small 4WD robot, and bought two types of H-Bridge chips for controlling the DC motors. The robot has those standard yellow DC motors that are available at ebay, four of them total.

The H-Bridge drivers that I’ve bought are based on the L9110s/HG7881 chip, and the more potent L298N H-Bridge chip, both of the bought at eBay (one pair each).

To keep the post short, don’t waste your money on the L9110s/HG7881 chip for driving your robot motors. While the maximum current for the DC motors would be 200mA, a grand total of 400mA (two motors) for a 800mA per channel rated L9110s chip, the chip it just burned out under the load. Magic blue smoke indeed. While the L298n chip just went along, but it has a higher power rating also. The L9110s both burned the same channel, at different times, probably due to some variations of motor load.

The L9110s is probably fine for driving static motors, that bear no load, but for anything else I have my doubts.

Low cost Flex Sensor for Arduino, and others

One of the sensors that can be attached to an Arduino, or other platforms, is the flex sensor.

These sensors allow, for example, with the movement of hand fingers to control servos, and are, in many cases,  attached to glove fingers.

But these might be expensive, and there are several alternatives available on the internet to make our own flex sensors.

Well, this is my cheap alternative, and it works just fine.

The material needed to build this flex sensor is:

- An LED, 3mm preferably. Any colour will do.
– An LDR, or light dependent resistor. I’ve just picked the one that came with my Arduino ebay kit.
– Two resistors, one of 220 ohm for the LED and other, might be 10K, for the LDR.
– Some water gardening opaque tube (black), the thin ones used in automatic sprinkler systems, but for vases.

The idea is simple:

Cut the thin water gardening tube at length, for example of one finger.
At one end will be the LED, stuck inside the tube. Now the resistor can be soldered right at this point or at some other place, like a control board.

At the other end, the LDR is placed and taped out with some opaque adhesive tape.

So the schematic is the following:

flexsensor

Not shown is that the LED is at one end of the opaque tube, and the LDR is at the other end. Simpler and cheaper than this…

Now if we connect power, and a multimeter at Arduino A0 point and ground, by flexing the tube the light reaching the LDR varies, and so the tension value at this point also changes.

With a lot of flexing the voltages tends to 5V, in this case, and if the tube is completely straight the LED lights up the LDR more strongly and so the voltage at that point might end with a 2V.

By swapping the LDR with R2, then lower voltage is more flexing and more voltage is less flexing.

The 10K resistor might need to be adjusted in function of the LDR used. In my case it works fine.

And now it’s easy to use this cheap flex sensor. Just connect the “Arduino A0 port” point to one of the analogue inputs of your board, and normalize and use the values to control whatever you want.

For bonus points, the LED at the tip, is placed at tip of the fingers, and so it gives the glove a more “cyber-punk” look :)

Soldering station – Aoyue 9378

Being done with pencil type soldering irons (fixed temperature, no changing tips) that I use for my electronics projects, and unable to use my current (now old) solder iron, due to is larger tip, for precision work, I started to look for a replacement.

Everyone talks good about the Hakko 936, Hakko 888 and Wellers, but these in Europe/PT, without being Chinese counterfeit copies, are pretty expensive, (around 200€/250$ mark) and are only available in Ebay, or other online retail stores in China or HK.

At the end I’ve bought an Aoyue 9358 soldering station.

Why?

Overall I’ve seen that reviews available are positive (see Amazon, for example).

It uses Hakko tips, or compatible Hakko tips.

It is not expensive. Around 60€

Replacement parts are available, if any thing goes wrong.

So, the review:

Static analysis:

It come nicely packaged. The station is heavy due to it’s large transformer, and construction seems solid. It also came with a replacement ceramic heating element. Regarding the design, beauty is in the eye of the beholder, but I thinks is ok. Maybe the font for the Aoyue trademark, could be a bit more modern…

The soldering Iron is light, and, at least for me, ergonomic. a very nice improvement from my older soldering iron. The cable connecting from the iron to the station might be a bit short, but enough, at least for me.

It came also with a soldering iron stand and solder stand in aluminium, nicely made. The holder allows the soldering iron to seat nicely, and in my case it has space for those irons with fumes extraction.

The tip provided is a conic 1mm tip, not ten tips like US customers can get on their package.

When on, the digital panel glows red.

Dynamic analysis:

After powering up, it heats up fast. Around 10s/15s to reach the target temperature that can be set between 200ºC to 480ºC.

I’ve tested it with lead free solder (Iron temperature set at around 350ºC) and lead solder ( at around 280º/290º).

It seems to keep and maintain the temperature during heavy soldering. Had no trouble soldering out in sequence a lot of DIP packages and connectors.

The station also has a sleep feature that can be activated that puts the iron to sleep if not moved for a while. We can ear the sensor on the iron if shaking it.

So overall a nice station with a nice price.

Rising from the ashes: NSLU2

Despite having a Synology Diskstation DS212+ for storing my data (photos, videos and PC/laptop backups), I also backup that data to an external disk connected to my faithful Linksys NSLU2 bought in 2005 using rsync from the Diskstation.

The NSLU2 is flashed ith the openSlug 5.3Beta firmware since 2009 (when it came out), with the operating system installed in a crappy 2GB SD card.

But this weekend due to a power failure, the NSLU2 failed to boot up. It kept the amber led blinking signalling that it couldn’t forward from the initial stages of booting up.

Using my desktop computer, I’ve FSCK’ed the external disk filesystem, that had some inconsistencies, nothing serious (most of the time it is dormant), and FSCK’ed the SD card, and, well, most of the /etc and /var directory where gone.

Due to having a backup of the SD card (these things die…), I’ve recovered the /etc directory, but still the NSLU2 didn’t boot.

Booting up without SD card, the NSLU2 did finish booting up, but it wouldn’t ping, neither the original IP address (192.168.1.77) neither the configured IP address. All I had on my Linux machine was incomplete at the arp table…

nslu2 (191.168.1.32) at <incomplete> [ether] on enp4s0f2

Not good….

I’ve flashed it again with the openSlug firmare, but still I was unable to ssh to it so I could initialize. Because I was able to flash it again with the upslug2 tool, it mean that the ethernet port was ok, and probably everything was ok, except the NVRAM settings that define the ip address where pretty much corrupted… Let’s hope that.

So the solution was to boot into RedBoot and erase the NVRAM (http://www.nslu2-linux.org/wiki/HowTo/ResetSysConf) with the following command: fis erase -f 0x50040000 -l 0x20000  (Attention to this command!!!! Don’t get it wrong)

And then upgrade from the RedBoot interface. The original Linksys firmware was flashed and after rebooting this firmware initialized the NVRAM with default settings: IP address 192.168.1.77, and bingo, ping works, and I can access the original Linksys Web Interface. On the web interface I’ve configured the old IP address, DNS, host name, and so on, and rebooted.

After reseting the NVRAM from redboot you must install the original Linksys firmware, because the openSlug doesn’t initialize the NVRAM.

Everything was fine, and the NSLU2 was working on the new IP. From this point on I’ve just flashed again the openSlug firmware, and formatted the SD Card (turnup with the memstick otion), and configured everything again (crontab, ntpclient and rsync daemon).

In no time I had the Diskstation again backing up to the NSLU2 external disk.

So, welcome again NSLU2 :)

Good Morning: Step in to Arduino….

So I’ve bought one of those cheap Arduino kits off eBay… In fact I’ve bought the cheapest one that I could find from a European seller… Bought it on Chinese shop with an UK warehouse, but the kit came from Sweden… Talk about globalization… After waiting around 10 days, I’ve got my kit, and in 5 minutes a LED was blinking in pure RGB glory (just red…).

The kit came with a UNO R3 clone, identical to the original, and several other components.

It depends what you want to do with your Arduino, but just to have an idea what came with my Kit:

- Some LED’s, push buttons, resistors, 7 segment (single and 4 side by side) and led matrix.

- One shift register 74hc595.

While the leds and the single segment can be driven by Arduino pins, for the led Matrix e the 4 7-segment display the shift register allows to drive them and use a minimal number of pins.

- An Infra red receiver and small remote. This is great because it allows to have multiple inputs (the remote switches) only using a single input.

- A 16×2 LCD display. I never used it directly, and just also bought an I2C driver for it, so I only need 2 pins to drive it and 2 pins for powering it.

- One servo SG-9 motor, and one stepper motor with a ULN2003 driver.
This allows to do some basic learning with these type of motors, but I think to do something useful, more motors are needed.

- An expansion shield with a mini bread board. Not used yet.

- A larger breadboard and some dupont cables. These last item are only enough for some basic experiments but for more advanced stuff there is the need to buy more…

- A 9V battery clip for providing standalone power

- An USB cable.

- Some assorted stuff. (On pot, flame sensor, LDR, tilt switch, etc…)

So, it is worth it to buy this kind of kit?

The short answer, yes, but for intermediate levels or more advanced levels, some more items are needed to be added to the kit, namely cables, and to allow the use of the 16×2 lcd while having pins available, at least an I2C driver/shield for the lcd. This is cheap out of ebay, works fine, and allows introducing to the I2C protocol

JVM Peer Gone in WebLogic T3 connection

So I have this exception when connecting to a FileNet P8 API from my Linux Machine:

com.filenet.api.exception.EngineRuntimeException: FNRCE0040E: E_NOT_AUTHENTICATED: The user is not authenticated. Message was: java.net.ConnectException: t3://1.2.3.4:9210: Bootstrap to 1.2.3.4/1.2.3.4:9210 failed. It is likely that the remote side declared peer gone on this JVM  at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:121)
 at com.filenet.api.util.UserContext.createSubject(UserContext.java:288)

This happens when my application is connecting to FileNet P8 Content Engine deployed into a WebLogic Cluster and not into a single node (Well it might happen with a single node…). The connection point used by the application is a single node address.

The solution for this error message?

Just add to the host files of the client machine the name and ip address of each weblogic cluster physical machine.

SSH over HTTP Proxy

Using SSH to connecting to an host when an HTTP Proxy is between the client and the host, can not be done directly without some configuration.

On Linux based machines the solution is to install and run corkscrew, a program that can tunnel the SSH protocol through an HTTP Proxy.

So how to do the configuration?

1) First install the corkscrew program with your package manager. On Ubuntu family: apt-get install corkscrew

2) Then you need to configure SSH to use corkscrew when connecting to the host that has a http proxy between.

3) Goto to your home directory and change to the hidden directoy .ssh within a command shell window.

4) Create or edit a file named config. The name is just config. No extensions.

5) Add the following lines to the config file

Host <IP_of _remote_host>  
 ProxyCommand corkscrew <IP_of_HTTP_Proxy> <HTTP_Proxy_Port> %h %p <auth_file>

Where the <IP_of_remote_host> is the public ip address of the host where you wish to connect.

The <IP_of_HTTP_Proxy> and <HTTP_Proxy_Port>  are the IP address and Port of you local http proxy server that you wish to go through.

And finally, if your proxy server requires authentication, by username and password, just give a complete path to a file where Proxy credentials are stored, for example /home/primalcortex/.corkscrew_auth

This file content must be something like:

username:password

For example a complete config file example:

Host 78.0.1.3
    ProxyCommand 192.168.1.1 8080 %h %p /home/primalcortex/.corkscrew-auth

and the .corkscrew-auth file:

myproxyuser:rtwertjwe4

6) Just connect now:

ssh myremoteuser@78.0.1.3

or when not using the default ssh port:

ssh -p 12345 myremoteuser@78.0.1.3

7) Done!

So why we need this?

Well, first is of course, to access a remote machine, but ssh can forward local ports to remote ports, and this is important because, with this feature we can use Thunderbird to directly connect to a remote server by using the standard IMAP and SMTP protocols through an HTTP proxy.