(Shown above is a 4 channel relay set up but mine is an 8 channel version.)
I built an 8 outlet 110 V AC receptacle box with a relay board in it. Inside that box, I also added a 5 volt DC power source from a wall wort to power the relay board. This power source looks like it actually reads 7.75 to 8.25 as the program runs through a cycle. I test it with a program that simply flashes each light on and off, 1 trough 8 and then starts over again in about 3 and a half second cycle.
I wanted to have a cosmetically clean set up so I passed the 8 data lines through a computer cable, going from the Arduino to the AC receptacle box. Then I added a 2 wire cable from the wall wort back to the Arduino, to power that as well when the Arduino is not connected to the computer.
If the cable to the computer is hooked to to the relay board and then disconnected, everything works great but if I turn off the power to the wall wart and then back on again, the lights all flash at the same time or very fast, with a cycle frequency of about once per second. If I plug the Arduino back into the computer, everything goes back to normal and I can unplug the cable to the computer with no problem.
I think the problem is trying to run things off of 5V on the external jack. While current will pass through the 5V regulator, there will be some voltage drop which is probably causing a Brown Out reset. Plugging in the USB cable maybe gets the current flowing enough. Seems odd, but then microcontrollers do some odd things when the voltage gets a bit too low.
Take a voltage measurement at the 5V line while trying to power it this way.
Ideally, you need at least 1V higher than the regulator to work properly, so 6V minimum. The Arduino site says 7.5V
The way you describe the transformer output varying makes me think it is unregulated and perhaps also not smoothed very well. In that case even if the average voltage is well above the minimum 7V that the onboard regulator needs, it may be dipping below that at some points in the AC cycle. I suggest you look for a regulated power supply instead. These days switched mode power supplies are relatively inexpensive, and also very small.
If you don't like that idea, you could try adding some capacitance across the output to try to smooth it out. However, it really would be better to start with a regulated supply.
Thank you both. Do you think this would workhttps://www.adafruit.com/products/501(shown below)? If not, what would work that is inexpensive and easy to get a hold of?
Need a USB jack for charging or powering a project, but don't want to lug around a computer? This switching supply gives a clean regulated output at up to 1000mA! 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one up at any hardware store for a $1 or so.
This adapter was specifically designed to provide 5.25V not 5V, but we still call it a 5V USB adapter. We did this on purpose to solve a problem that occurs often with USB-powered gadgets: they draw so much current than the resistance of the cable causes a voltage drop, so instead of 5V, the device sees 4.75V or so. To avoid this problem, we made the adapter 5.25V. This is because the USB power specification allows up to 5.25V, and its safe for all 5V electronics, and has the benefit of making up for any loss due to thin USB cables. Basically, you can use it where ever USB 5V power is needed, with no risk of damage, and it will happily work at the full current range, no matter what cable you use!
The adapter does not have a cable, instead there is a USB 'A' type port on the bottom, where you can plug any USB cable in. The data lines have resistors on them, to match what is inside of an 'Apple iPhone' type charger, and we tested this adapter successfully with an iPhone 4 so it ought to work with anything that can charge with an iPhone adapter.
This adapter is great for use with an Arduino, Raspberry Pi, teensy, NETduino, etc.! Also good with our Lithium-polymer battery chargers, so you can just carry a USB cable.
This particular adapter is very nice, with a red indicator LED to let you know its working
This adapter is great for use with an Arduino, Raspberry Pi, teensy, NETduino, etc.! Also good with our Lithium-polymer battery chargers, so you can just carry a USB cable.
This particular adapter is very nice, with a red indicator LED to let you know its working
That should do the job, if you connect it via a USB cable to your Arduino. I think you're powering the logic side of the relay board from that power supply too, which will be difficult if you're using a standard USB cable to connect to the Arduino. Do you know how much current the relay board needs? I wonder whether it would be possible to power it from the Arduino's 5V pin.
In some respects it would be safer to get a supply with a higher voltage rating in the region of 7-9V and connect it via the Vin connector rather than the USB; this would mean that it was easier to wire it to the relay board, and also mean that there was less risk of the relay board upsetting the Arduino by putting spikes on the 5V line. However, the ones I have got in the past for that sort of thing cost in the region of £10 each (1500mA with output selectable between 3-12V in 1.5V increments used to drive Arduino + motors) so you might want to try one of the cheaper USB supplies first.
SSR Output (each channel):
Load voltage range: 75 to 264VAC (50/60Hz).
Load current: 0.1 to 2 AMP.
Power supply:
5VDC / 160mA (all channel ON).
Input control signal voltage:
0V - 0.5V Low stage (SSR is OFF)
0.5V - 2.5V (unknown state).
2.5V - 20V High state (SSR is ON).
SSR Spec.:
Manufacturer: OMRON
Part number: G3MB-202P, 5V version.
Isolation: Phototriac.
Zero cross: Yes.
Rated output load: 2A at 100 to 240VAC.(50/60Hz).
Load type: General purpose.
This is what I have.
I was trying to avoid using the Vin from the Arduino because I wanted to have a cleaner look.
Could I use the wall wart that I am already using for the relay board and add a separate 5V 1A (1000mA) USB port power supply like I posted below? I thing that I could attach it to the same AC line that the other adapter uses. This would allow a clean look and I hope that it would also provide a clean current supply. Yes?
Assuming that your relay board runs from a 5V supply, then you can have a single 5V regulated power supply powering both it and the Arduino. However, you need to feed the +5V to the Arduino through the +5V pin, not the barrel jack.
Yes I am trying to stay away from the Vin pin (long store) and that is why I tried the barrel jack. Now I will go to radio shack and try to buy a power supply like in reply #3 with one or two outlets. A USB cable will look appropriate for my application. Since I already have the other wall wart hooked up, I will get rid of the barrel jack cable but leave it hooked to the relay board.
Thanks guys!