Can't get this RC car to work

Discussion in 'The Projects Forum' started by André Ferrato, May 7, 2015.

  1. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Hi guys, i am trying to build a remote controlled car, using a RF TX RX 315 Mhz Module, with HT12 decoder and encoder and a L293D Motor Driver, it's a pretty simple circuit, but i am facing some problems, i mounted the receiver circuit on a breadboard, there are pictures uploaded to imgur down below, then i mounted the transmitter circuit on a drilled pcb that i bought here in my town. The thing is when i press the button that controls the motor, it spins forever, it does not stop, and the led that indicates transmission between the RF modules, goes off, like something is transmitting to him to keep spinning, i measured the voltages at the controls pin at the L293D and it's low when it should be high, because i am not pressing the button, so it never stops spinning. Can anyone tell me, what the problem is ? I tried a lot of things, at the drilled PCB i checked for continuity at every single trail and there is no trail touching another trail, so there it's fine i believe. I tried to put a lot of 0.1uF ceramic capacitors to reduce some noise, but it changes nothing. I'm new to electronics, so i may be committing a mistake and i dont even know... if anyone could take a look. Also i am locked to these devices that i am using at the circuit. Another thing to put here, is that i am using a LM7805 to reduce the voltage to 5v at both the transmitter and the receiver. HELP!

    http://i.imgur.com/f4S0hvZ.jpg - TOP VIEW from the Breadboard with the receiver circuit.
    f4S0hvZ.jpg

    http://i.imgur.com/oQW4FHq.jpg - SIDE VIEW from the Breadboard with the receiver circuit.
    oQW4FHq.jpg

    http://i.imgur.com/Gmx4i56.jpg - Transmitter circuit.
    Gmx4i56.jpg

    http://i.imgur.com/jD1gTAn.jpg - Soldering on the drilled PCB.
    jD1gTAn.jpg

    http://i.imgur.com/91pd0ZB.jpg - Transmitter SCHEMATIC.
    91pd0ZB.jpg

    http://i.imgur.com/wqY8LPG.jpg - Receiver SCHEMATIC.
    wqY8LPG.jpg

    I think i didnt forgot anything.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,089
    3,027
    So, the transmitter seems to work, but the receiver "locks up" when it receives the motor control signal? Please elaborate more on the details of the problem. I had trouble understanding.

    My general advice is to divide and conquer. Check everything, take nothing for granted, assume the problem could be the stupidest possible mistake. Wrong pinout, opposite polarity, that sort of thing. It's so easy and we've all done it.
     
  3. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Yes the control pin on the L293D is locking at the low signal, so when i press the button, it locks on 0, so the upper pin is 0 and the lower is 1 , so the motor never stops spinning, this is never supposed to happen right? Really weird. Tomorrow i'll check everything again. And when i press the button, it locks and it doesnt matter if i press any other button to try to change the logic of another pin, it doesnt work, when it locks, the VT Led goes dark, like it's receiving something continuosly, but i took off the receiver of the board and it kept spinning. I am so confused, the led goes dark but even if a took the receiver away the control pin keeps locked on 0.
     
  4. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Reading through the data sheet on the decoder, it says the outputs are latching, so once it receives a signal to drive an output low (turning on the motor,) it won't change states until it receives a new message to reset that pin.

    Based on that, I'm not surprised that with the VT LED dark (indicating that no new valid messages have been received) the motor keeps running.

    Sounds to me like you need to figure out why the change in button position isn't bring transmitted. I suspect that the receiver and decoder are probably working fine, and that the problem is on the encoder/transmitter side.

    I have a guess (emphasis on guess) as to what might be going on. All of the examples in the encoder data sheet show a momentary switch on the transmit enable pin, not a permanent connection to ground. I'm wondering if it only checks the state of the pins when transmit is first enabled and then ignores changes. Maybe if you disconnect transmit enable and then reconnect it after changing button states it will transmit the new button state.
     
  5. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    You need to put 3 capacitors on your motor, as it's the most likely culprit - as long as it doesn't run, the receiver works fine, but when the motor is on, the (electrical) noise it makes, deafen the receiver.

    Use ceramic caps of 100nF each. Place one directly over the motor terminals and one end of the other two caps at each terminal as well - connect the remaining ends directly to the metal cage of the motor with a wire to ground thrown in - if you still have problems, it can be further quietened, but this will likely be enough.

    And just to emphasize further, do not substitute the ceramic types for any other type!
     
  6. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Ebeowulf, i dont think this is happening because the tutorials i saw all use the TE grounded and they have no problem. I'll try to put the capacitors on the motor
     
  7. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Cool, I'm kind of glad I was wrong about that, cause I didn't see any really elegant solutions to the problem if I had been right!

    Definitely keep us posted on how the caps work, along with any other improvements you find. I'm intrigued by this problem and would love to learn from your experience.
     
  8. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    I'll solder the caps on the motor and see how it goes... i'll remount the receiver circuit on another breadboard. I'll make also a video and upload to vimeo so you guys can ser whats happening. A friend of mine is coming to my house also with other motors and an arduino to make some advanced tests. Also by the circuits i sent, this should not happen right?
     
  9. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    The circuits cannot really be blamed for what a motor does!

    Not all motors are the same, so it's a very good idea to check out a number of different ones. That will give you an idea of noise amounts versus build quality (while it's not a hardwired rule, these things have a tendency to go hand in hand).

    To get a good comparison, use roughly similar motor sizes and test both with and without the caps (same value/type of caps for all motors for a true comparison)

    You can get 100 pcs for $1 on eBay, so you won't need to move them - just test them all without caps and then mount the caps on all of them and repeat the test.

    A 'scope is the best way to see the noise, but a de-tuned AM radio can be used to hear the difference of the good, the bad and the ugly.
     
  10. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    It's definitely the motor noise that is inducing that pin to remain locked on the low position, i managed to fix the problem, not the entire problem with some 100 uF electrolytic on the HT12E and L293D main Vcc power pin, it reduced the voltage spike and now the pin is managing to reset itself when i release the button, but sometimes it still locks, to further fix the problem, i added 0.1uF electrolytic capacitors to every single Vcc pin and now it seems to be working fine with just one motor connected. Also i managed to solder the caps and it helped a bit, but not a lot, the electrolytics are facing head on the problem. Tomorrow i'll go to the store and buy some 220 uF and higher electrolytic caps to do some tests, and also some 1uF. I didnt knew a motor could hit the circuit like that, can someone explain this to me ? Also i have an old radio here, is there a way i can use it to see the noise by myself ? The only device i have is a multimeter :(
     
  11. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Try 10..100nF ceramic caps there as well.


    Ceramic capacitors are much better due to their low ESR.


    Grab a load of 100nF ceramics - I can't stress that enough!

    The reason that a DC motor makes noise is the brushes moving from one pole to the next and the load is inductive, so the noise can be surprisingly high amplitude and transmits via both wires and air.
    Always kill noise at the source!

    I already told you about using an AM radio, but you'll listen, rather than look ;)
    Run the motor and find a spot on the dial where the noise is heard (might be anywhere on the dial if the motor is really noisy and it's close to the radio).
    Then you can experiment and see what gets the noise down.

    Please post a photo of the motor terminals and the caps you mounted.
     
  12. ScottWang

    Moderator

    Aug 23, 2012
    4,851
    767
    Please don't forget to upload the files to the forum next time.
     
  13. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Uh oh, just saw your photos #1 and particular #2 from the top in your original post :eek:
    Replace that ghastly forest of antennas with real jumpers lying flat down and your problem will likely vanish completely, or at least be radically diminished.

    Whenever you're using HF of any kind, keep all wires as short as possible, especially with UHF

    You'll still need the 3 ceramic caps on the motor terminals though ;)
    If the caps on the motor terminals ain't helping, you must have mounted them wrong - Please post a photo of that general area!
     
  14. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    First, sorry for the delay to answer here, i got troubled with a project at work. Okay, so tonight i'll shorten the wires, to make really small connections and i bought the copper solid wire to make the antennas, this will also help the receiver and the transmitter to keep in touch i believe. The photos of the solded caps on the motors are uploaded:

    Another thing, i would like to thank you for your interest at helping me and the problem is definitely the motor deafening the transmission and the reception. I'll se this fixed to make sure is that. I think the caps are correctly mounted, they are close to each other because some friend of mine use hot glue to mount them at the platform and this made soldering a lot harder :(, and finally about the radio, i'll try this tonight also, after i correct the forest of wires.

    http://imgur.com/EePcO9b - #1 motor
    http://imgur.com/QLSvjLy - #2 motor

    IMG_20150510_122023709_HDR-s.jpg

    IMG_20150510_122005365_HDR-s.jpg
     
  15. ScottWang

    Moderator

    Aug 23, 2012
    4,851
    767
    Your photos were too big that they will affecting the browsing speed and waste the space of forum for nothing, the files size from about 3Mb to 74Kb and 48Kb, that will be about 40 and 62 times.

    I already compressed the files.
    Please compress the file to a appropriate size before you upload them next time, thanks.
     
  16. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Sorry about that, next time i'll correct it
     
  17. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    The caps seems to be correctly placed :)
    Placing those caps a distance from the terminals won't be as effective in dampening the noise, as what you've done.

    One more thing you could do, is to solder a wire (20AWG or thicker, stranded) to the motor housing (between the caps) and take the other end directly to the ground terminal of your battery.

    Keep that and other wires going to your motor as far from the sensitive wires around the receiver and if you have to cross them, do so at right angles for minimum pick-up.

    Looking forward to hear your results with the trimmed wires :)
     
  18. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Okay, i inserted the wires as you suggested and got nice results without the caps from a really close distance, then i inserted the 17cm antennas and got a little better, but for this to work i had to insert some 1000uF caps( Receiver ), some 470uF ( L293D), some 220 and 330, also some 100nF ceramic caps in parallel. I got nice results, now its working with the two motors and its answering my commands very well, but not everything is perfect:

    1) When the car hits something like a wall and keeps spinning in that direction, i lose control of it just like before, to regain control i need to go very close with the antenna to make it stop. Anyone know why ?
    2) About the antenna i made a long strip of copper wire, there is an ideal size ? My RF modules work at a 315 MHz ? Or there is a better geometric form to the copper wire ?
    3) The max distance i can go before lose control is like 10-15 meters, isn't that a little short ?
    4) I was really amazed by the size of the caps i needed to use to fix the problem, can someone show me the calcs or guide me to do it so i can see that in the paper ?
    5) Is there a way to optimize the receiving distance ? I thought about givin' 12v to the transmitter, now it's running on 5v.

    The front wheels are being a problem for me now, they are messing with me direction control because they jam when forced to change directions, tomorrow i'm gonna buy something differet to replace them, maybe just one in the middle. Also i intend to cut the platform to like half the size that is now and style a little bit.

    EDIT: I bought the "Practical Electronics for Inventors" book, is that a good pick ? I intend to read in the next two months, i have a nice knowledge in this area, but only theoretical, like kirchnoff, eletromag is everything really easy for me. I blame this on the education that is provided in my country, Brazil, here we learn A LOT of theoretical things WITH ZERO practical applications, so we may know SO MUCH and don't even know how to use it :(


    IMG_20150512_161223894.jpg IMG_20150512_161232839_HDR.jpg IMG_20150512_161243333.jpg IMG_20150512_161257743.jpg
     
  19. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi André

    Great... Perfection is boring and leaves no option for learning ;)


    When the motors work harder, more noise is generated.


    Yes, a quarter of a wavelength (~23.8cm) with a reduction of 5% for a whip in free air, so 226.2mm (22.6cm) for a quarter wave whip, or twice that for a half wave.
    If you need it shorter, either go with 1/8 wavelength of better, take a quarter- or half wave and wind it on an isolating rod/tube (plastic/glass fibre etc.) of say 11.3cm to make a helical antenna.
    The shorter the antenna (both electrical and physical), the less sensitivity.


    Perhaps, perhaps the opposite, but most probably a reasonable range, given the random antenna length, the sensitivity vs output power of the modules, the remaining noise from the motors etc... Not knowing your TX/RX modules and the motors and not having seen any 'scope traces or field measurements (EMF) on the setup, how would I be able to tell, what would be a reasonable range.

    You can probably get an approximate range where you bought the modules, but that will be without a single distortion factor (and pperhaps a bit optimistic, given that the ISM bands are brimful of noise from the intended target group - Industrial, Scientific and Medical applications).

    Did you take a (fat and short) wire directly from the motor housings to the ground/0V of the battery?
    You can still shorten the motor wires considerably.

    Further possibilities:
    • Common mode transformers in the motor leads close to the motors with a cap on each side.
    • Shield around the motor wires, grounded at the battery (think soft copper tube for best effect).
    • Shield under (or even around) the logic - again grounded at the battery.
    • Antenna and receiver as far away from motors and motor leads as possible.


    I'm pretty amazed of that too - I've never had to use anything even remotely close to those values (but then I'd never use a solder-less breadboard in such an application (no shielding, all the contacts acts as noise antennas and driving it around is bound to loosen the components sooner or even sooner)).

    Without the data, there's nothing to calculate at all - perhaps check if you can get access to an oscilloscope, either on a local school oor in an electronics club.


    If the transmitter is spec'd for 12V (many are), driving it by 5V will severely limit the range (perhaps to a fourth or lower of the 12V range, depending on how it's internals work).


    The shorter distance from the driving wheels the better for caster wheels. Speed Cream/Super Lube/whatever PTFE oil or grease you have/can get will help the casters swing as well. A single non-caster hard nylon wheel may do, depending on the surface it will drive on.
    A single wheel will be easier to turn, but do make sure that there's a suitable percentage of the mass on the casters - experiment... Battery placement and whatever heavy stuff can be relocated - but keep the battery close to the motors.

    It's amusing that you think I have every book written on the subject ;)
    Whether any given book is a good pick depends on your previous convictions and how you best assimilate knowledge - what's good for one may be incomprehensible for the next guy - it's as personal as toothbrushes. I think that the book may be a bit over your head in some parts, but start with what you do get, now that you have it.

    Any book will be on the theoretical side and the title you bought does get around a lot of corners, but I think you should consider it as something where you can read about particular stuff that you are working with, rather than a read-from-end-to-end in one go - skim it now and then, to know what can be found where when you need it.
    For practical learning, make some of the simpler stuff (no radio circuits) and make sure you understand how each works and gradually you'll build knowledge :)
     
  20. André Ferrato

    Thread Starter Member

    Apr 5, 2015
    206
    1
    Soeren, your answer is just perfect, you really put some effort in there, i can't thank you enough for helping me. But i have bad news, the RF module suddenly stopped working, i was shocked, because i didn't change anything. Now i dismounted the controller i made before, i intend to mount it on another protoboard to test if it really has a problem, if positive, i'll only be able to get another a few weeks from now, so my project will stop, i pray that this will not happen. That let me really down, i ran into so much problem, mechanically and electronically speaking, and this only contributed to make me even more "down" :( . Nonetheless, i'll not stop with this. My intentions are to finish this and to make it good.

    Indeed i did took a 22AWG wire and solded into the case of the motor and then connected to the ground of the battery, by fat and short i think you mean a wire with a bigger diameter, right ? WOAH, i forgot to mention, i changed the battery of the transmitter to 9v and improved considerably the signal, it took away a lot of capacitors from the receiver, and i got a result that was so nice, when i pressed the button the motor instantly answered my call, and instantly stopped when i released the button, the system stopped working before i could try with the correct wire length, i was using 15cm. Also the shield you meant, it goes around the motor wires and then connected to the ground ? Can you link me an image so i could see that in action ? Another thing, i was thinking of putting some case around the motors to minimize the noise that is deafening the receiver, is that viable ?

    My next goals in this are:

    - Change the transmitter bat to 12v, for max signal strength.
    - Check if the RF modules are working, and what went wrong.
    - If they are, mount everything up again.
    - Shorten the wires.

    I forgot to mention that i reduced the platform, now its smaller and its lighter. And i have only one front wheel and it's made from silicon, that problem of messing with the direction no longer exists. If the maker stands by my side, the project will run smooth now.

    EDIT: I dismounted the controller and took the transmitter off. Then i tested it on two protoboards with a LED being the load i'm trying to change the state, and it WORKED, i really don't know what happened before, but it's all good, back to testing. I am awaiting your answers about the shielding thing.
     
    Last edited: May 15, 2015
Loading...