I'm pretty new to electronics, but have been successfully working with a Spark Core (www.spark.io) and some simple drivers/circuits for now. That said, I've run into a problem.
I have a Spark Core powered from a 9V power source, via a 5V regulator (LM7805) with the necessary caps between supply and out lines and ground (as per the LM7805 datasheet). The same 9V powers a motor (LEGO PowerFunctions) via a SN754410 dual H-bridge (getting its VCC from the 5V line). The Spark Core controls the SN754410 via 2 PWM signal lines, each with a 10kOhm resistor. This all works fine (meaning I can make a motor turn forward/backward, and control rotation speed using PWM).
I also have a mini RFID reader (this one: http://www.seeedstudio.com/depot/Mini-125Khz-RFID-Module-PreSoldered-Antenna-35mm-Reading-Distance-p-1722.html?cPath=19_24) connected to the 5V line, as well as to the TX and RX pins on the Spark Core. This works fine in isolation as well - it detects tags at 3-5cm distance (1-2cm if powered from the 3.3V off of the Spark Core), and nicely reports tag ids.
All circuits share the same ground, coming from the 9V power source.
The problem starts when I have AND a motor running (via PWM) AND try to use the RFID tags - the motor will run but the RFID reader does not see any tags. As soon as I bring my PWM signal down to <10 (out of 255), the RFID reader starts picking up tags again.
Here's what I tried: - I have tried putting an aluminum foil cone around the RFID reader's antenna, to no avail. - I have tested at PWM signals 200, 150, 100, 50, 10, 5 and 0. Only at 5 and 0 do I get RFID tags read. - If I disconnect the motor, but still set my PWM signals, the RFID reader works fine.
This all leads me to assume I have some interference in my circuit, caused by the motor. I'm thinking I should probably put some resistors or caps in some of my wiring, but I'm not sure. I need some guidance. Here is a rough schematic of my setup:
simulate this circuit – Schematic created using CircuitLab
upon request, here are a few pictures of the mess that constitutes the circuit in question :) :
BTW, the two blue (-) bars on my breadboard (GND) are connected together via a white colored wire. One red bar (+) carries the 9V supply, the other red bar carries the regulated 5V.
How do I go about eliminating the interference that prevents my RFID tags from being read when the motor runs?
Thanks!