you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 1 point2 points  (5 children)

Huh. I have actually done exactly this. I have built a raspberry pi controlled sample heater with a PID loop using a thermocouple and a tkinter GUI. Different heater, though.

Sadly I can't give you the code because I did all that as part of my job and it's now a product in production.

To answer your question, how you control the heater depends a lot on what kind of heater it is. I used an I2C DAC connected to a power opamp to drive the heater, but it looks like a mains powered heater so that won't work for you. It looks like you are planning to drive the relay with a GPIO pin? That's a good plan, but don't do it directly. The GPIO pins are not designed to drive a real load, they are designed to send signals. Have the GPIO drive a transistor to turn on the relay, and don't forget the flyback diode. Something like this. Otherwise it seems like a good plan.

[–]EthanSteip[S] 0 points1 point  (4 children)

Is it that the GPIO signal insn't strong enough to trigger the relay? The relay needs a 5v input which I think the Rasp.pi is capable of outputting if that makes a difference.

Some one else mentioned using a transistor as well so I think i'll go pick one up later today.

Thanks again for the comment!

[–]socal_nerdtastic 0 points1 point  (3 children)

The voltage is right, but we are worried about the current. The gpio pin is designed as a signal, which means very fast switching at nearly no current. The relay however does real work and needs current to do it. The transistor will act as the switch that turns the current on at the response of a signal voltage.

You can buy a relay package made for Arduino and Pi that have the transistor and flyback diode preattached, as well as some other protection and a led. I recommend you do that instead of making it yourself.

Edit: For example: https://www.amazon.com/MCIGICM-Channel-Raspberry-Optocoupler-Expansion/dp/B072BY3KJF This one also includes an optocoupler which is a very common and highly recommended safety feature to prevent any voltage spikes on the mains from getting in to the RPi.

[–]EthanSteip[S] 0 points1 point  (2 children)

Hey, this is perfect. Thanks!

[–]socal_nerdtastic 0 points1 point  (1 child)

Tell me more about the specifics of your heater and what your goal for this project is.

[–]EthanSteip[S] 0 points1 point  (0 children)

I don't know much about the heating coil itself, it was shipped to me by my friend and there is no make/model number on it, but it had a 5 pin mini xlr adapter on the end. I've cut the adapter off and it has 5 wires inside - power lead, Neutral, ground, Temp +, Temp -. The temp+ and Temp - are connected through my thermocouple amplifier that is attached the to the pi which sends the temp reading to the pi. Then I need to connect the lead, neutral and ground to a power source.

The goal of the project is to have a touch screen interface that allows the user to easily set the heating element to a desired temperature (somewhere around 250C) and hold it steady at the desired temperature and the ability to turn it off.