Feedback on schematic for Photon-based smoker control

Hey, friends.

I’m working on a Photon-based control for a meat smoker. I’m very much in the noob/hobbyist/tinkerer camp when it comes to electronics. I’m turning to y’all since you’re some of the most friendly and awesome people I know. :smile:

I’d love some feedback on the design and components as well as some generic, non-Particle-related questions. I’m trying to use parts I have on hand, if possible.

First the schematic:

Second the questions:

  • How do I pick a good value for a flyback diode? Some advice I saw on the 'net suggested look at the motor’s voltage and current usage and multiply by 2. Is that enough? Seems like momentary spikes could be bigger.
  • On the 12vdc -> 5vdc regulator, I got the cap values from the datasheet’s reference design. The problem is I don’t have those exact values on hand. I saw somewhere (electronics.stackexchange.com) that I could use 10uf and 1uf as substitutes for 0.33uf and 0.1uf respectively. Is this true, and what sort of issues would I run into potentially? Do I have to use electrolytic capacitors, or can I use ceramic caps?
  • Do I need to do any type of filtering/protection between the motor and the LM7805 or the Photon? Is the power ‘clean’ (for lack of a better word)?

"BOM":

  • Voltage regulator LM7805. (I know switching regulators are more efficient, but I have a handful of LM7805s, so I’d like to use them if I could. I do have a heatsink.)
  • High-side power switch using:
  • FQP27P06 P-channel MOSFET
  • PN2222A or 2N3904 NPN transistor (I have both. I’m assuming either would work.)
  • MAX6675 Breakout that talks to the Photon over SPI (Type K thermocouples to go with the boards).
  • 12vdc / 360mA blower fan (specs on the mA, not tested yet) - unsure if it has a built-in flyback diode or not. If it does, I’ll take one off.
  • 1n4148 diode for flyback, but I’m worried it’s too wimpy.

Late realizations:
The breakout boards want 5v (they might be fine with 3.3v also, but I haven’t tried), so I wired them up to the 5vdc bus, but the pins in SPI mode aren’t 5v tolerant on the Photon according to the datasheet. So, I’ll have to address that somehow. If any of you have advice on this, I’d appreciate that too.

Thanks for any advice you can give!

The SPI pins on the Photon are 5V tolerant in SPI mode. Also, digital mode. The confusion is because the analog pins are not 5V tolerant in analog input mode, but as long as they’re configured in digital mode and not using internal pull-up or pull-down resistors, you should be fine.
EDIT: Let me add a caveat. I’m pretty sure SPI is 5V tolerant. It doesn’t look to me like the MISO pin has an internal pull-up or down. It shouldn’t need one because when a slave device is selected it should be driving the pin high or low, but I’m not 100 % sure there isn’t one. Before you connect a 5V device to it you probably should check with someone who knows more than I do.

1 Like

Clean is the word to use to describe the quality of the power supply. It is recommended that you have separate power supplies for the MCU and motor as having a huge current draw by the motor might result in a voltage drop, causing the Photon to reset. You can consider using a USB powerbank for the photon and 12V supply for the motor.

For the decoupling capacitors for the regulators, most people use 0.1uF and 1.0uF. You shouldn’t run into any issues with that. The higher value capacitor filters the low frequency noise and vice-versa.

As for electrolytic or ceramic, more importantly is to check out the Voltage rating for the caps. A design guideline is to have 2 x operating voltage as caps start to derate near their maximum voltage.

Flyback diode wise, make sure the current rating exceeds that of 360mA. As for voltage rating… I’m not so familiar with this but @peekay123 might have some idea :slight_smile:

1 Like

@jtzemp, the MAX6675 board you have will work just fine at 3.3v since the MAX6675 is rated for that voltage. Supply current is less than 2ma so you can even power them from the Photon’s 3V3 pin or even a GPIO pin!. So that takes care of the SPI voltage issue.

As for D1, the 1N4148 can do the job (Vrrm = 100V, If = 200mA, Ifsm = 1A for 1 millisecond). Remember, this is for a very fast transient voltage, not sustained. You can also chose a 1N4149 which has a 100V, 1A (1 sec) rating.

The 7805 is a great regulator but it will need to shed 7V at whatever operating current so it may get hot. @kennethlimcp recommendations are good. Given you are powering the 7805 via long wires to a wall-wart, I would use a larger input capacitor (100uF). :wink:

1 Like

Great feedback, thanks!!

With respect to clean power, I figured it would be better just to have two ac-dc adapters, one for 12v and one for 5v. It complicates the project quite a bit for other reasons, so if possible I'd like to stick with one 12v and the LM7805 for now the 12vdc adapter can handle much more current than the motor and the Photon (and sensors) will need, so I'm not so worried about under-current-ing the Photon (at least until trying it proves me wrong ;)).

Theoretically for projects where that isn't possible at all, what are best practices around isolating motors from MCUs? Other than current drop, are there 'ripples', or noise or other induction-related issues that can affect other components? If you couldn't isolate power supplies, other than current drop, would you need to isolate them? If so, how would you? -- Just to help educate a novice. :smile:

This is great info! I'm not sure what all the terms in the data sheet mean and how they relate, but it looks like the forward continuous current for 1N4148 is 300mA, but the motor is listed as drawing 360mA (don't yet know what it is in real life). That was the thing I was most concerned about.

Are you saying that since the peak is so short, we can look at the peak forward surge current (listed at 2A on the datasheet I have) and rely on that?

I ordered some 1n4004 and 1n4007 (handling much higher current) diodes, but they won't get here for a week or more. If my 1n4148 can get me by on a few tests until the better ones show up, that'd be great.

Back to the capacitors:

If you don't mind me asking, what are the considerations for picking capacitors on the regulator? All I've seen is what the manufacturer recommends, and that the input needs to have a larger cap than the output. Is there a 'rule of thumb' for picking capacitors? What problems do long wires cause? Resistance? Inductance?

Is bigger always better (keeping BOM costs in mind)? I've got some pretty big caps in my stash that I could throw on there, but I've got plenty of 10uf and 100uf caps. Would sticking a 100uf on the input and 10uf on the output work ok?

@kennethlimcp, you said higher value caps filter low frequency noise. Do motors put out low frequency noise? Is 3khz (RPMs of fan) considered low frequency from the perspective of this circuit. It's not in the mhz, but it's faster than I can count in a second. :wink:

Lol... yeah, I didn't even look closely at the chip data sheet. I just trusted the eBay listing for the breakout board, and assumed it would be accurate and complete. I'll try powering them from the 3.3v rail on the Photon and see if that'll work. It's a super tiny change.

I really appreciate you three chiming in and giving some guidance! I love learning this stuff. I spend so much time in high-level code that it's fun to get down to the metal. :smile:

Hmm... I usually isolate the supplies as weird behaviors start to happen with a single power supply.

One great example is the Neopixels which are chopping the supply a lot during pattern changes and having an analog circuit that requires a clean supply (eg. microphone) would cause issues with the readings.

A way to resolve it is to add a huge capacitor as what @peekay123 suggested so that it can supply the current required during a sudden surge without too much of a voltage drop.

Some people use a separate LDO to power the sensitive circuitry as a means to isolate the noise from the input. Another school of thought says that this is not practical. Personally not an expert in this field but i would do this..

Another way is to have a low-pass filter using Inductor and Capacitor to isolate the two circuit and reducing electrical noise traveling in both directions.

It's a mix of both resistance and inductance. For a DC supply, we are not really concerned with the inductance introduced (i think) but more of the voltage drop due to the resistance in the long wires. Adding a capacitor will allow us to have a cleaner supply at the board side. For AC, the long wires becomes like an antenna that radiates waves and leads the discussion about EMI.

I am just like you, always looking around for the answer as to how capacitor values are chosen for regulators. The norm seems to be 0.1uF and 1.0uF even when using them with other circuitry (between the input supply and gnd) My guess is that the My guess is that the 2 common values will bypass the high frequency noise in the KHz-MHz range.

Disclaimer: I am, just like you, learning and exploring. Hoping to hear from people like @AndyW :smiley:

1 Like

Hi, i just got a Photon with the hope of building a smoker control and came across this.This is the first example of this type of project that I have found that is using the max6675 temp sensors. I have gotten most of the hardware portion of the project figured out but the software has been a stumbling block. I was wondering if you would share your code for this project.

Thanks, Robert

Hey, @RPM55.

So, the project has kinda sat on a shelf for a while. I did a PCB (happy to share the board files) and have it mostly populated. I did have a WIP firmware that would read from the max6675 sensors. I’ll see if I can find it.

Hey, thanks for the response. Yeah it would be great if you could find those files. It would give me something to work with to better understand and learn how to use this.

Apologies for bumping an old thread.

Would anyone have some examples of code using a photon with the MAX6675 chipset and thermocouple? Found a cheap MAX6675 set on Amazon for about $7 and would like to use that and a photon (and an MCP98080) to monitor the temp on my Wood stove.
Thanks, Mike