jbyle
Posts: 8
Joined: Sat Dec 13, 2014 8:14 pm

ir receiver in combination with dc motor

Thu Feb 18, 2016 12:04 pm

Hello,

I have this weird problem. I am busy implementing a raspberry Controlled Car. I am using the L298n to control the 2 DC motors. As a first interface I had created a JavaFx application running on my laptop. The JavaFX application communicated via RMI towards the car interface on the car. Yes I do everything in Java :-) I use the Pi4J library. So at some point I got a working pilot version where I could steer the car forward, backward and let it turn. That all via the JavaFX application and the java interface I developed on the Raspberry Pi. Although everything was working there was a slight delay between for example pushing the forward button on the application and than actually see the reaction on the car. Probably RMI was not an ideal choice. So I came up with an alternative. I wanted to replace the JavaFX application with a simple remote control.
I did a complete setup and configuration (first without car) to see if the ir sensor was working and it did. When I push a button on the remote control, my java application show in the terminal what button I pushed.
Next step was integrating this in the remote car. There I have this weird issue. The L298n has an external power source for the dc motor. When the batteries are inside and the wheels start spinning, the ir sensor is not reacting anymore. When without stopping my application, I pull out the batteries, the ir responds again. I have no clue what is going on.
Does anybody has any idea ? I tried to add a capacitor on the motors but without succes (although not sure I did this correct).
Any help would be welcome.

I am documenting my experiences on my blog. http://blog.byle.be

best regards,
Jan Byle

Return to “General discussion”