Troubleshooting Circuit with Pulse Sensor (Edit: Now with fritzing diagram!)

Hello,
I'm working on a project where 2 heart pulse sensors trigger 2 solenoids (Sensor A triggers Solenoid A, Sensor B triggers Solenoid B) and is powered by one external power supply.

This is the pulse sensor I'm using.
This is the solenoid.

My friend drew up a schematic of what it should look like, but when I wired everything together it didn't work and now both of my pulse sensors don't seem to be working at all. :frowning:

Could you please review the schematic and see if you can spot some flaw? Idk if the problem is the schematic, my wiring up of the circuit, or the code itself. Attached is the schematic, the code I'm using with the Uno, and a video of what the piece did when it was wired up. Any insight would be much appreciated. I'm debating if it's worth it to buy new sensors.... :confused: What could cause the analog input numbers from the pulse sensor to steadily decrease? It clearly is no longer receptive to changes in light.

Link to video of what the circuit/code did do: https://drive.google.com/file/d/0B6GJZjLN3rhwNXVaY2JJUnBXbXM/view?usp=sharing

EDIT: scroll down in post for fritzing diagram of my bread board set up.

Cadence.ino (4.72 KB)

Your ground wiring is deeply flawed I'm afraid.

You are passing the 5.2A ground return from the solenoids through thin traces and directly
routing these to the sensor grounds.

  1. Ground and power traces need to be wide so they have low inductance, and also need to be
    wide for high current as here.

  2. Never use the same ground wiring for high current loads as sensors - run these separately
    except at one common point, the Arduino ground pins. There should be a thick set of traces from where
    the 12V + ground comes in to the solenoid loads. There should be separate traces for 5V and ground
    to the sensors, so that transients on the high current wiring doesn't affect the sensor. This is
    probably why they are dying.

  3. Keep the sources of interference well away from sensitive analog wiring. Using analog pins to drive
    out to the MOSFETs isn't a great move, you'll always get some crosstalk from traces that run side-by-side
    especially without a ground-plane.

  4. Ground planes are very useful, use them whenever possible. You ideally need two ground plane
    sections here, one for sensors, one for high current load side of circuit.

  5. You don't need 1200V freewheel diodes, 20V is plenty - they do have to take the 2.6A peak
    current of the solenoids though.

Thanks MarkT for the feedback! I'm afraid I'm a bit of a novice so I don't fully understand all your comments or know how to fix it...

  1. What do you mean by traces? Do you mean I need to be using a thicker gauge wire than standard jumper cables? What gauge do you recommend?

  2. So do you mean the grounds from the RFP12N10L's should connect to the arduino ground pin instead of the sensors?

2/3) What should the new parts layout look like with the changes of the ground and power traces?

  1. What is a ground plane?

Can someone please explain to me MarkT's comments? Thank you!

Okay, below is a fritzing diagram of my breadboard set up. Did I wire anything wrong?

Here is link to actual fritzing file: Dropbox - Cadence.fzz - Simplify your life

Well, generally we don't like Fritzing diagrams... So I can't say whether it is wired wrong. But if the Fritzing matches the schematic, I don't see any problems. (Keep in mind, just because the schematic or Fritzing is correct doesn't mean you wired it up that way.)

Those are some pretty big solenoids to run off of a breadboard, so you might want to find a different way. Maybe get some protoboard to solder the mosfets onto and use larger wire between mosfets/gnd/solenoids.

Your parts layout wouldn't change much with two ground planes and larger traces.

I made the fritzing diagram because I'm not sure if I read the schematic correctly. I don't totally understand them.

Sorry, I wasn't very clear, I'm not making my own PCB.... just using standard blank pcb ... so there aren't any ground planes I think.

MarkT:
Your ground wiring is deeply flawed I'm afraid.

You are passing the 5.2A ground return from the solenoids through thin traces and directly
routing these to the sensor grounds.

  1. Ground and power traces need to be wide so they have low inductance, and also need to be
    wide for high current as here.

  2. Never use the same ground wiring for high current loads as sensors - run these separately
    except at one common point, the Arduino ground pins. There should be a thick set of traces from where
    the 12V + ground comes in to the solenoid loads. There should be separate traces for 5V and ground
    to the sensors, so that transients on the high current wiring doesn't affect the sensor. This is
    probably why they are dying.

  3. Keep the sources of interference well away from sensitive analog wiring. Using analog pins to drive
    out to the MOSFETs isn't a great move, you'll always get some crosstalk from traces that run side-by-side
    especially without a ground-plane.

  4. Ground planes are very useful, use them whenever possible. You ideally need two ground plane
    sections here, one for sensors, one for high current load side of circuit.

  5. You don't need 1200V freewheel diodes, 20V is plenty - they do have to take the 2.6A peak
    current of the solenoids though.

So does the ground for the sensor need to be attached to just the regulator and arduino? Should it not connect to the Mosfet at all?