Home » 2016 » February


I have been done a lot of research and reading the last few days to figure out how I can solve my problem.  Finally I ended up at the following page about DC Motors.  See DC-Motors.

There is a part about noise caused by the DC motors.  To isolate both circuits (Raspberry Pi linked/Battery holder linked (l298n->DC-motor))  I have to use an opto isolator (opto coupler).  I did some further investigation and yes, that’s the way I wanna go.  It explains the issue that I have.  So I immediately decided to buy a couple of those opto isolators(4n35 FSC Optocoupler) on EBAY.  I can’t wait to get to work but I’ll have to work delivery which will take a few weeks :-(.  The opto couplers are on their way from China.



Continue reading »

IR Receiver versus DC motor

Some more about my issue. I tried an alternative calling irw direcly in my java code

p = Runtime.getRuntime().exec("irw");

And the result was exactly the same. Once the motor starts turning, the IR receiver seems hanging. When the motor stops, the IR receiver works again. Some reading and searching on the internet learned me that a possible cause could be electric noise because of the running DC motor. I tried to put a capacitor around the DC motor but without result. In other words I am stuck for the moment and thus still looking for a solution. If any of you would have any suggestions, they would be very welcome. I have no electronic background what probably explains my lack of knowledge on that.
In the meanwhile I also posted my issue on a Raspberry Pi forum. See Forum post

I will keep you posted as soon as I get around this issue.


Continue reading »

Look for JLIRC Alternative

My first experiments with JLirc were promising but at some point I started getting issues. The idea was simple. Compile the code and put in in the classpath. That was working well but in the context of my Rasbperry Controlled Car I got weird issues. The JLirc library has a native implementation to read the infrared signals. The library has a nativeRead method to read data from the socket : /dev/lircd.
Without batteries attached to the car this is working well without any issues but with batteries inside, it hangs after the first button I click on the remote control. Weird, very weird. I have spend a lot of time trying to figure out what is the issue but I cannot find it. As I said, without batteries in the battery holder, it works, with batteries, it hangs. I can’t see nor understand the link with why it would hang.
In my search I have noticed that the JLirc library dates from 2001. And that is a little surprising. I don’t say the issue could be related to that but I prefer to have code that is more recent. I have learned out of experience at work that sometimes code running under an older JVM does not work fluently anymore under more recent versions.
I will have a look if I can read the socket via another way. When I have time I will also try to further figure out what is wrong.

Continue reading »


After having lirc working on the Raspberry Pi, I wanted a Java program that can talk with lirc and make it possible to intercept infrared signals from a remote control via java code.  That is were JLirc comes in.  JLirc is a java api for using lirc.  More information about can be found on JLirc

The installation instructions can be found on an install file which you can find in the sources zip.  You have to download the sources to your raspberry pi and extract the zip.  Than you need to do a build (Makefile).  Important note is that you have to use the option  -march=armv7-a instead of what was original in the Makefile.  It will not build if you don’t change it.Once built you have to first launch the lirc deamon :

sudo service lirc start

and than launch the test application which is in the sources :

java -cp . org.lirc.test.Irw

As a result when you hit a button on the remote control you should see something similar like this :

pi@raspberrypi ~/lirctest/build $ java -cp . org.lirc.test.Irw
0000000000fda857 00 KEY_5 /home/pi/lircd.conf.conf

Pretty simple isn’t it.

Continue reading »