An archive of community.esquilo.io as of Saturday January 26, 2019.

Need to control SSR for heating element

JefferyS

I need to control a heating element with a SSR. The SSR does 3 - 32v dc input and output is 120v ac at 25 amps.

I plan to use the PID in the library.

I've seen many ways to do this but want the best way for the Esquilo so I don't damage anything. I thought maybe an opto-isolator to keep it safe, the SSR only uses 7.5ma at 12 volts.

In the Docs it talks about using a transistor or FET.

Thanks,

Jeffery

Scott_Shumate

There are certainly many ways to do that but if it were me, I'd use a couple of FETs. Connect the Esquilo output to the gate of an n-channel FET with the source to ground and the drain connected to the gate of a p-channel FET with its drain connected to the SSR and the source connected to 12V. You would also want a 10K pull-up from the p-channel gate to 12V. You could certainly use an opto though I don't think the isolation is needed. The FETs will protect the Esquilo output.

JefferyS

Thanks Scott. I've never used a FET before so I'm not sure what parameters I need to look at to pick one out.

I found these on SparkFun.com and they say it is good to use for a micro controller but I'm wondering if they are overkill.

https://www.sparkfun.com/products/10213

https://www.sparkfun.com/products/10349

Mouser.com has them too.

Thanks,

Jeffery

gwittie

I used a standard N-channel transistor to connect the Esquilo GPIO to the SSR relay.
Here is an example of how I used one.

Scott_Shumate

gwittie's low side switching is better since it would save you a transistor.

For his circuit, you could use pretty much any general NPN such as the NTE123 or a 2N3904:
http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/2N3904BU

Or you could use an n-channel FET and remove the base resistor. This n-channel FET would do with Esquilo's 3.3V outputs:
http://www.mouser.com/ProductDetail/Microchip-Technology/TN0104N3-G

JefferyS

Thanks guys for the information.

Scott, would I need a p-channel still like your first post?

If I just need the n-channel you said would work from mouser with the 3.3 volts, how would I hook that up?

Do I go from the Exquilo to the gate and put one side of the SSR on the Drain and the other to 3.3v or 5v and source to ground?

Thanks,

Jeffery

Scott_Shumate

For low-side switch like gwittie used, you would not need a p-channel, just an n-channel. Connect the Esquilo's output to the gate, the source to ground, and the drain to the negative terminal of your SCR's control input. Connect the positive terminal of your SCR's control input to 12V or whatever it uses.

JefferyS

Thanks Scott, when you say low-side switch are you talking about the voltage that turns the FET on?

Scott_Shumate

Low-side switching means you are switching the load, in this case your SCR control input, to ground on its negative side rather than switching its positive side to a voltage, which is called high-side switching. There are safety and other cases where low-side switching is not appropriate but that is not the case for your SCR.

JefferyS

Thanks Scott, that makes since. Should I put a 10k resister on the gate to ground to make sure the SSR stays off when not high?

Scott_Shumate

That would be a good idea to keep the SCR off until the software drives the output.

JefferyS

That's great, I think I have one more question. In your first post you said to connect it to 12v. Do I still need to do that or can I use 5v. I have a separate 5v from the Esquilo using a LM7508 from the 9v power adapter I'm using. The 9v go into the Esquilo too.

I can easily use a 12v if needed.

Thanks,

Jeffery

JefferyS

Thanks gwittie for your help. Did you make the picture with Frizting? I've been thinking about using a buzzer too, is the 1M ohm resister to catch the voltage from the coil when it is turned off kind of like a relay but I see the relays with a diode all the time?

Scott_Shumate

I was just using 12V since you mentioned it in your example. You can connect it to anything within the stated range of your SCR control input (3-32V) and less than the max rating of the transistor (which is 40V for both of the two I mentioned). If it were me, I would probably connect it to the 9V from your power adapter for greater power efficiency but the 5V from your regulator is fine too.

gwittie

I did not use Frizting for my drawing. Even though I am now trying it out. My go-to drawing tool is the Draw App that is part of the OpenOffice package. It works on Mac or PC (Linux too) which makes it portable. It has an export to pdf format which is also handy. I have used Draw for electrical schematics and mechanical drawings for projects around the home. It has a lot of good features (such as layering, scaled dimensions, etc). The feature that Frizting has that I like a lot is the hard connections of an object to the connecting wires. Move the object and the wires go with it. This is not part of the OpenOffice Draw app which would save a lot of time when making changes. Except for that, I would highly recommend this application.

To create a schematic, I insert a picture of the Esquilo board into the Draw window and any other boards or components that have pictures available. I sometimes have to build a component drawing/schematic like the door switch in my example (I group the collection of lines, boxes, etc into a group to make it easier to move later). At that point, I can connect the boards and components with the line object and then resize the line width, color, etc.

The buzzer that I have in my example came from a OSEPP Arduino kit that used the 1M ohm resistor across the inputs in their examples. The buzzer is listed at 5V but worked just fine with the Esquilo 3.3v PWM outputs.

JefferyS

That cool, didn't think about using Draw though I use LibreOffice.

Thanks for letting me know about the buzzer too.

JefferyS

Hi, I have my hardware ready, just need to control it.

I've looked at the PID nut but wasn't sure how to use it to control a heater.

Are there any Demos of using this that I can look at to get started?

Thanks,

Jeffery

gwittie

Jeffery,
You may want to review the Arduino site covering PID. It references a relay control demo near the bottom of the page. It will give you some insight on using the SSR to control the heating element.
See link: http://playground.arduino.cc/Code/PIDLibrary

JefferyS

Thanks gwittie I'll check it out.

JefferyS

Hi, I've been working on this, have it basically running for one ssr just to test. Not sure how to tune it though. I saw the Arduino Autotune Library, may try to port it to the Esquilo Following the PID format that someone converted. The way they converted from c code to Squirrel code.

I will have at least 6 heaters on this so I was wondering, can I create an instance for each pid one heater will use and store it in a blob? My thought is I can run through the blob checking each running pid and run the compute for it to do it's calculations.

I'm not sure if this is possible to put a class instance and have it running in a blob variable.

Other wise I guess I would have to hard code all the heaters in a function and run through each of them in code.

I was hoping to do it dynamically so if I need to add or remove I could do that from my information I keep in the NV about my temperature probes and anodizing settings.

Any Ideas would be most helpful.

Thanks,

Jeffery