CC3000 and AC

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
markjames
 
Posts: 74
Joined: Tue Oct 01, 2013 1:28 pm

CC3000 and AC

Post by markjames »

Hi,

I just completed a project using a CC3000 breakout board. It's a really simple project - a Uno wired to a small board that has 3 relays driven by digital outputs on the Uno to transistors with pulldown resistors and diode protection. It's a controller for a traffic light - so all the Uno does is use digital outputs to open and close the relays. The relays switch 110v to the lights but are completely isolated from the arduino.

I use a CC3000 running as an echoserver to send it commands to run different sequences of lighting on the traffic signal.

The problem is with the CC3000.

If I just plug in the Uno with the CC3000 on it then it finds the wifi network, connects, and gets an IP via DHCP. It works perfectly. If, however, I have the AC plugged in at the same time then it will not complete the connection with the wifi access point. It will fail somewhere between initializing and DHCP retrieval.

There's something about the AC being present that's keeping the CC3000 from doing it's thing. The AC current is completely separate from the Uno. The neutral wire is hard wired to the lights, the physical relay contacts switch the 117V.


Any thoughts?

Thanks,

Mark

NitroxDM
 
Posts: 9
Joined: Thu May 03, 2012 11:21 pm

Re: CC3000 and AC

Post by NitroxDM »

You described the set up well... however to make sure we are on the same page could you post a schematic?

markjames
 
Posts: 74
Joined: Tue Oct 01, 2013 1:28 pm

Re: CC3000 and AC

Post by markjames »

NitroxDM wrote:You described the set up well... however to make sure we are on the same page could you post a schematic?
Ok... no laughing now... I've never drawn a schematic before. I was trying to find some software to do this so it would look good but came up empty. Any suggestions on what to use to make things look better in future would be appreciated.

In the meantime here's a pic. The CC3000 is wired according to the online instructions other than the VBEN isn't on pin 5 as they use - rather it's on pin 7.

The Arduino pins control DPDT relays. The DPDT relays have one side of their coils attached to Arduino 5V. The Arduino pins are attached to the base of 2N2222 transistors that take the other side of the coil to ground when the pins go high. They're DPDT cuz that's what I happened to have on hand - I'm not using one side or the NC part.

The 110V neutral is hardwired to the three traffic lights. The hot side of it goes to one pole of all the NO relays. The other sides obviously provide power to the lights.

It all works perfectly - I just can't leave the AC plugged in when booting it or it won't connect to the AP. If I leave the AC unplugged it will connect and then I can plug the AC in and it's all ok. But with AC power there it simply will not connect. Very weird. Seems to be some sort of EMF thing.

Mark
Attachments
schematic_s.jpg
schematic_s.jpg (31.18 KiB) Viewed 470 times

markjames
 
Posts: 74
Joined: Tue Oct 01, 2013 1:28 pm

Re: CC3000 and AC

Post by markjames »

Well, my schematic left much to be desired. I've improved upon it and hopefully someone might have an idea why the AC hum/RF/??? is preventing the CC3000 from connecting to the AP. I haven't shown the CC3000 in the diagram but it's connected as per the CC3000 breakout instructions with the sole exception that VBAT is connected to pin 7 instead of pin 5

Thanks in advance,

Mark
Attachments
Wifi Traffic-page-001.jpg
Wifi Traffic-page-001.jpg (68.32 KiB) Viewed 434 times

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: CC3000 and AC

Post by adafruit_support_mike »

Your hand-drawn schematic looks okay. As with any kind of written language, making it pretty is a matter of practice and revision. It usually takes me six or seven tries to draw a new circuit in a way that doesn't suck. ;-)

The one suggestion I'd make would be to put resistors between the Arduino pins and the bases of the 2n2222s. The Arduino pin wants to go from 0v to 5v, but the transistor's base will only rise to about 0.7v. The built-in limits on the Arduino's output current will keep anything really bad from happening, but the Arduino will be happier if its pins can go where they want.

WRT the CC3000, how do you have the wiring laid out? It's very possible that you're getting 50Hz noise from the AC line, but the physical arrangement of the wiring matters.

markjames
 
Posts: 74
Joined: Tue Oct 01, 2013 1:28 pm

Re: CC3000 and AC

Post by markjames »

Thanks,

I thought I had used pulldown resistors but when I went back to draw the schematic I see that I didn't. I'll definitely put those in to avoid stressing the arduino.

I'll try to run the AC wiring away from the rest of the wiring. Right now they're in a bit of a tangle. Space is at a premium with trying to get the arduino, a wall wart, and a utility box with duplex outlets stuffed into the space that's just meant to hold the signal light. I have the arduino hot glued back to back with a prototyping board that has the relays, transistors, and AC on it.

Is there anything I could wrap the AC wires in to shield them?

Mark

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: CC3000 and AC

Post by adafruit_support_mike »

markjames wrote:I thought I had used pulldown resistors but when I went back to draw the schematic I see that I didn't. I'll definitely put those in to avoid stressing the arduino.
This may just be a point of vocabulary, but I was talking about using a resistor to make the connection between the Arduino and the transistor instead of a pull-down:
resistors.jpg
resistors.jpg (17.95 KiB) Viewed 399 times
Putting a resistor between two points makes it possible to have different voltages at either end. That's important in a case like this where the Arduino and the transistor's base have different voltage ranges.

A pull-down sets a default voltage. If you disconnect the Arduino, the pull-down will still guarantee a 0v signal at the transistor's base, shutting it off. It's a good idea to build those kinds of default values into a circuit, usually choosing values that will pull the whole system into a "waiting to do something, but not doing anything expensive or irreversible" state.
markjames wrote:Is there anything I could wrap the AC wires in to shield them?
Get as much distance as you can between the wires first.

Distance is the simplest and most bulletproof way to reduce induced noise. The limits it imposes are basic physics, and the math is easy. Shielding works too, but it's an engineering solution. Small details can make a big difference. A good shield is about 80% good design, 20% luck, and 95% repeated testing.

In general, you want to start by moving the noise source as far away from the thing it's messing up as you can, then use shielding to clean up the noise that remains.

Any conductor with a connection to GND will work as a shield. An ideal shield completely separates 'inside' from 'outside', but there's nothing special about being 'in' or 'out'. It's more accurate to say that a shield defines a boundary between two regions, and keeps the effects of EMF in one region from being felt in the other. Metal boxes make really good shields around circuit boards, and metal conduit makes a good shield around long runs of wire.

You don't always need an ideal shield though. As long as the wire or circuit you care about is protected, you may not care what happens on the far side of the noise source. A sheet of metal or foil between different parts of a circuit can give you enough shielding where you care about it.

Sheet steel is often used as shielding in manufactured products because it's strong. Copper foil is often used in DIY radio work because it's easy to solder. Chunks of copper-clad are also popular because they're basically foil with a stiff plastic backing. Aluminum flashing and foil work electrically, but soldering to aluminum is a PITA and you usually end up making your electrical connections with screws and washers.

Perforated metal, screen wire, twisted cables and braid also work, but at that point the math starts getting fancy. The amount of shielding you get depends on the frequency of the signal and the gap between the conductive parts of the shield.

Summing all that up in terms of ease and reliability:

- Get as much distance as you can first
- Add a box or metal conduit if you can
- Put a plate between the noise source and the circuit it's messing with
- Put a smaller box or plate around the wire, component, or section of PCB that needs protection
- Punt/pray

markjames
 
Posts: 74
Joined: Tue Oct 01, 2013 1:28 pm

Re: CC3000 and AC

Post by markjames »

Sorry it took me a couple of days to reply.

Thanks very much for your really helpful response. I had actually meant a pull down but see your point about using a resistor to make the connection instead. I'll be making that change tomorrow.

I'll try moving the AC lines as far as I can from the 5v lines and the rest of the Arduino and will wrap them in foil and electrical tape if that doesn't do the trick. Hopefully that will solve it. It works a charm right now - the only caveat is that the arduino has to boot first. It's pretty cool, though, triggering traffic light sequences across wi-fi. You guys have brought a whole lot of creative fun to me - much thanks!

Mark

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”