Is my wiring sound?

Hello,

It's been a long time since I have done anything with the Arduino, coding or any electronics so please go easy on me. Below is an image of my current project layout and was hoping someone could take a look and tell me is it all looks sound, nothing risky happening.

Just a little background; I currently have a carnivorous plant that is sat in a small pot of water as it likes swamp like conditions. The issue is that the water obviously gets drunk and evaporates and therefore needs topping up. The idea is that the float switch will activate when the water level drops below a certain level and this in turn will activate the water pump, topping up the water until the float switch is deactivated. The idea behind the RTC is that the setup is in my bedroom and I don't want it waking me in the night, therefore the pump will only activate between certain hours of the day.

My main concern regarding the wiring is having the Arduino and the motor being powered from the same 12v source as I only want one plug for the setup. Any advice would be appreciated, and thanks in advance!

Almost certainly the interference for the motor will cause the Arduino to reset. Try it and see. If you have trouble use the Pi circuit, the last on this page to provide some power supply decoupling.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Why are you powering the relay from 3V3? Best to connect it to 5V unless you have a 3V3 relay coil, which is unlikely.

Perfect, thanks very much for your reply. I will try and test this circuit out tomorrow and see if it causes any Arduino resets, if it does I am guessing that's because the motor suddenly draws power and causes a brown out affect?

When you say the last on the page, just to confirm that's the one with the choke or inductor image depicting a motor appose to the IC yes?

And finally, not going to lie, never really thought about the relays power supply, not sure if I have used it on the 3.3v before or not so thanks for pointing it out and will double check it has the correct voltage supply tomorrow! :slight_smile:

While brown out is a possibility it is the interference that a motor generates that will be the main problem.

Yes the one with the choke.

You are using 'INPUT_PULLUP' on pin 2 for the float switch input, I assume?
(Had to ask. :slight_smile: )

Hi,

Can you get way with a light sensor to tell when you have the lights out and to disable the pump rather than a RTC?

Tom.... :slight_smile:

While brown out is a possibility it is the interference that a motor generates that will be the main problem.

Yes the one with the choke.

Right OK, thanks for clarifying that. After doing some further research I begun to realise it was more of an interference issue rather than a sudden power loss issue. Sadly I have been called to work today so will have to try it out another time.

You are using 'INPUT_PULLUP' on pin 2 for the float switch input, I assume?
(Had to ask. :slight_smile: )

Haha indeed I am. pinMode(floatSwitch, INPUT_PULLUP); And I don't mind you asking, the more input from others the more knowledge and less troubleshooting for me.

Hi,

Can you get way with a light sensor to tell when you have the lights out and to disable the pump rather than a RTC?

Tom.... :slight_smile:

Hey Tom, well I guess it would be a possibility however I already own the RTC and have run some time check experiments on it which worked nicely. I think the RTC works better in my situation as I work until quite late at night and don't get up until later in the afternoon meaning the sun varies from day to day.

Hello again,

So whilst not being able to begin the wiring for this project, I have been using my little spare time to do some research into the components and this has raised a couple of new questions.

Almost certainly the interference for the motor will cause the Arduino to reset. Try it and see. If you have trouble use the Pi circuit, the last on this page to provide some power supply decoupling.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Q1: Upon researching into noise caused by motors, I have seen many people resolve this issue by simply placing a diode parallel with the motor, along side a 0.1uF ceramic capacitor in parallel with the motor also. If I do encounter any noise issues, would these components not suffice in removing the noise, or is there a reason you have chosen a more complicated set of components for my situation?

Q2: When creating the original diagram on Fritzing, I just chucked any old diode across the motor without really thinking about its specifications. Upon doing further research I have come to realise that it is kind of important to choose the correct diode for my situation and have come up with 2 possibility's. A 1N4001 Diode or a 1N5400 Diode, the main difference here being that the 1st option is rated at 1 amp and the second choice is rated at 3 amps. Any suggestions on which to choose out of these?

Thanks again!

Q1 - you don't know what interference the motor will create, you don't know how this will find its way into the Arduino - this is a very layout sensitive thing. So you don't know what will cure it until you try.

Q2 - it is normal to choose a diode rated the same as the running current of your motor. The pulses are only very short and so exceeding that rating is not so problematic.