pwm-front

Well, rather than struggle with a tool not designed for the job, I threw away any thoughts of doing the stripboard in MS Word. Instead I downloaded the demo of a bit of prototyping software called LochMaster 4.0. It natively does stripboard, and you can even flip the board to see the solder points and cut strips underneath! I’ve now purchased the software, as I think it’s going to be pretty handy.

Anyway, this is the top of the board, the Vin of the Nano is bottom right. The power connection to the red and black rails on the right is 12V. The 5V green rail is taken FROM the Nano, you don’t supply it.

Additional parts :

  • C1 – 0.1 uF cap to make the 3.3V reference voltage smooth.
  • D1 – Small diode to prevent back EMF from the fan. A 4001.
  • D2 – Small 5V LED (this and the resistor are actually entirely unnecessary, as the on-board LED would probably be enough)
  • T1 – The transistor at the top is for switching the fan on and off. I think its a BC337

Regarding the pin strip headers, the top (4-way) is for the PWM fan. The S pin is the RPM pin, and the P pin is the PWM signal pin to the fan.

The bottom 3-way header is for the TMP36 thermistor. Since I wanted to have this at the end of a cable, so I could position it where I wanted, I made it a header.

pwm-back

This is the back of the board, showing the places where the strips need to be cut.

Code is to follow, when I’ve commented it and tidied it up. I’ll mark the Nano pins on my next project. You should be able to work it out from the circuit and the code though.

It’s done… The mighty Nano has been deployed in my TV cabinet, behind the Xbox One. The TMP36 thermistor is resting at the end of a cable on top of it. When the XB1 is turned on and the temp rises to 30 degrees, the fan kicks in, and will give a smooth stepping of speed up until 50 degrees, where the fan is maxed out. (I’m hoping I never get to this stage!!).

But, in the true spirit of tinkering, I’ve already got at least 3 improvements/changes that I want to put in to the next version!!

Firstly, the RPM calculation isn’t working properly, but that’s moot anyway, because I’ve got no way of showing what it is!

Secondly, the flashing LED is a bit pointless, because the on board one is bright enough, but in any case, it wouldn’t be needed if #1 is done.

Thirdly, I need to mount it properly, in a box.

..etc

Wow – of all the mistakes to make, I finished making the stripboard layout (again), cut all the holes, and went to put the Nano into the 2 female pin strips, and…

I’d cut the strips 1 hole too many !!! I think that I might be able to get away with it though, I might just be able to remount the 5V, GND and Vin lines which are the only ones used from the right hand side of the Nano…

Moral : measure 38 times, cut once…