Jump to content

Welcome to WatercoolingUK Community Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

PC interface mod

- - - - -

  • Please log in to reply
39 replies to this topic

#1
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Hi guys, as you know recently finished my second TJ07 build.

 

One thing thats annoying me though is the inflexibility of some of the electronics I built into it, such as my LCD displays are fixed to do one thing, I have a separate USB interface mounted inside that controls LED lighting etc now I think i mentioned this before but it got me thinking that I could probably do a better job than the off-the-shelf stuff that Ive got in there regarding the USB interface.....To coin a Jeremy Clarkson phrase....How hard could it be?

 

So I decided to start a project thread for this little add-on project of mine to show how its coming along, think its gonna take me a fair while as i didnt realise the complexity of this before I jumped in at the deep-end. I thought it might be an interesting read for people on here since this is some damn complex and a one-off mod.

 

 

 

Broken down this is the wishlist:

 

  • Be able to PWM control fans from PC software (2 groups of 2 fans)
  • Be able to interface and measure multiple temperature sensors in PC software
  • Control around 5 or 6 12V supplies for lighting etc
  • Be able to sense a few switches into software
  • Fully control a 16x2 or 20x4 LCD display with messages sent from PC software and backlighting and possibly contrast.
  • Oh and did I mention its all gotta be small enough to go in a 3 1/2" bay

 

Nice little wishlist I've put together I think. Now its gonna be a test to see wether I can actually do it...or not.

 

Since things are always better with pictures this is the microcontroller I selected for it:

pic18fsmd.jpg

 

See i said its gonna be small, Imagine all the swearwords that will be streaming from my gob when I try and solder that thing in. However it does pretty much everything on my wishlist, built-in USB USART for comms to/from PC, around 20ish multi-purpose IO, analog inputs for temperature sensors, 2 channel PWM for controlling fans and best of all it only costs around £5-6.

 

Here's a basic prototype for now

usb_prototype1.jpg

That huge 40 pin chip is exactly the same chip as the small one, just a bit easier to work with on a prototype plus easy to replace if/when the magical black smoke appears :D

 

Ignore all the stuff on the left, just leftovers I havnt stored away yet. It will need quite a few external components, MOSFETs for controlling lighting and for PWM control of fans, filtering for temperature probe inputs etc however I plan to use SMD devices for this so as to keep everything tiny.

 

Anyways thats the progress for today, more to follow soon I hope. For the rest of today I shall be learning C for writing the firmware and C# for the PC side of things and trying to get the chip and PC to talk over a USB cable.



#2
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

It seems a lot of the work I was expecting to have to do is not greatly reduced so development is steaming ahead. Found this page http://www.waitingfo...C18F_USB_device

 

Simon has already kind of done a fair bit of what I wanted to do. So it'll simplify the job no end as his C# and C18 libraries are open-source and GNU so I can use those and modify them to suit my needs, So with regards to the firmware all I've got to really do now is get the LCD / analog / digital IO / PWM to work based on the instructions received from the PC.

 

At the PC end I'll have to do a fair bit more but the actual task of talking to the PIC can be handled with his library. That has cut a HUGE amount of development off.

 

If anyone is interested in how this is coming along I'll post a few screen grabs etc up with the frontend app etc and working hardware?

 

Cheers



#3
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Things are coming along well :D

 

Schematic is drawn up, with the component choices should be able to PWM control fans pulling anything up to about 25 amps :o

 

anyways started on a PCB design, heres the mess Ive somehow got to sort out

pcbrouting1.jpg

 

Ideally want to reduce the amount of through-holes (called Via's) to a sensible number, thats what the autorouting software came up with but I reckon with some time and patience I can manually re-route a few bits and neaten it up a lot.

 

Here's a rough 3d render of what it should look similar to when assembled:

3drender1.jpg

 

Not a lot more I can do till payday, plus I got busted for speeding the other day so that'll cost me a bit this month :(



#4
andybones12

andybones12

    Level 10

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 4,149 posts

You could build a spaceship for nasa,as that looks so complicated.

I'm glad somebody knows what they're doing  :wink:

 

Andy



#5
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

It looks worse than it is mate, in reality its just a lot of smaller circuits (building blocks if you like) hooked up together :) and as for knowing what I'm doing I'm kinda making it up as i go along :D

 

BIG BREAKTHROUGH made today though, check this out:

 

 

Thats one of the most complicated bits done now, I just created a C# form with two textboxes and the program running in the PIC interfaces the LCD, so whatever I type into the textboxes on the windows app is displayed onto the LCD in real-time. It sounds insignificant I know but in reality its kinda one of the hardest bits dealt with, the rest of the coding is just quite basic stuff :) Thankfully that site I mentioned before has a good basic framework to work with so most of the USB comms stuff is already taken care of using mostly his code.

 

Forgot to mention this will work with any LCD that uses a HD44780 compatible driver chip. So that could be 16x2, 20x4 etc

 

Next on the ToDo list is get the remote LCD contrast adjustment working and then the 2 channel PWM for the fans.



#6
IanF

IanF

    Level 10

  • Moderators
  • 2,896 posts

I find this all highly impressive, both the building and the programming!


ian.jpg


#7
andybones12

andybones12

    Level 10

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 4,149 posts

LOL you are a programming Genius.

You must work for some Government Secret Agency  [-Y

 

Andy



#8
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Nah, I just teach people to drive trains for a living :)

 

Cheers guys, its the 1st time I've ever programmed in C or C#, so I'm kinda feeling my way along with this. Got another update with a vid of more bits working later today, seems its kinda easier to demonstrate what this thing does with a video rather than me waffling on :D



#9
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Well, didnt get a vid done but here goes.....I'll keep it short and sweet :)

 

PWM working for the fans now, complete with the high-power switching circuit, each fan channel can theoretically handle about 25 amps which is a hell of a lot of fans with very good speed control adjustable in 0.1% increments. 2 Temperature sensor inputs to the PC now work quite reliably.

 

Had a real struggle getting the EEPROM stuff working, the chip has 2 areas of memory, flash program memory (suprisingly it holds the program) and EEPROM memory which can hold user data. So I wanted to make use of this and store a fixed percentage for the PWM fans and a default state for the 5 output channels for lighting etc.

 

Reason for this was that the interface is unresponsive to USB input until windows is up and running and the program started up, so it will default the fans to a specified setting and set whatever lighting channels are wanted until the PC is up and running. Simple enough to do, just grab the values from the program and stick them into the EEPROM area and then read them in the PIC program when it starts, that bit works fine, however reading the values back to the PC crashes the program by cauing an overflow. I think this is something to do with the time it takes to read the EEPROM values is like freezing the program up. So I'll try and split it into 2 procedures and do half the data in each and see if that helps.

 

Bits ordered today - high power MOSFETS rated at 35amps for the switched channels/fans, The design has had to change a little as I couldnt get SMD MOSFETs so they'll take up a little more space than I hoped and not sit flat to the board but oh well. Ordered some plain copper clad board (high quality not el-cheapo) and photoresist spray.

 

Hoping to have a prototype board assembled by end of next week.



#10
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

OK, so today I'm in the process of knocking up a prototype board, thought I'd take a few pics of the process as I go along:

 

So from the design on computer which is going to be a pain as its a double-sided circuit board, I've printed the top layer and bottom layer onto inkjet transparencies, drilled alignment holes in the transparencies and the copper-clad board:

 

artwork1.jpg

 

copperclad1.jpg

 

So then I sprayed both sides of the board up with a Positive Photoresist coating and baked it in the oven for about 20 minutes (just awaiting the wife's reaction to that), and then used the holes to pin the transparencies on either side of the board hopefully keeping them aligned as holes pass through from the top to bottom layer.

 

Once that was done, its time to expose it to UV light for about 20 seconds (very strong UV light source).

UVexpose1.jpg

 

Flip it over and do the other side using my DIY made UV exposure system

UVexpose2.jpg

 

So now we agitate it in developer solution, this washes away all the photoresist coating that was exposed to the UV light, leaving a positive image of what we want and any unwanted copper exposed

photoresist1.jpg

 

Then etched in Ferric Chloride for about 20-30mins and this is the result

etched1.jpg

 

Quick cleanup with a scotchbrite pad and we are left with this

etch_finished1.jpg

 

Just experimenting with a solder mask coating on a bit of scrap board, will be trying that tomorrow



#11
Phoenixdancer

Phoenixdancer

    Eyefinity Guru

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2,887 posts

Hmmm

Can u make one that will simply control fans based on temps?

 

Will gladly pay for that lol


My Rig:
I7 3770k @ 4.8Ghz
16GB DDR3
Asus Maximus V MATX
2 x AMD 290X @ 1100/1300
XFX 1KW Platinum PSU
Parvum Custom made - Soon Core P5 Wall case
Cooling: 2 x ET45 Alphacool Copper, 2x 290x EK, 1x EK HF, D5, EK Tube, 10/13 White Tube.
Phillips 4k 40" Monitor


#12
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Sure, thats what Ive got in my current build :) Fans off till 20degC then start at 30% and step up 10% for every 1degC increase

 

Couldnt sell them though as they are of a bit of a homemade quality. Might be able to do just a couple of these as I'll be paying to have a small batch of boards processed at a proper PCB manufacturing facility.



#13
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Well, disaster has struck on the prototyping and put about 2 days of work straight in the bin :(

 

some of the via's (holes that connect traces beween top/bottom layers of PCB) were causing so much aggro I lost my temper slightly and launched everything across the workshop. At the moment I'm now looking at around £40-50 if I send the design off and have a PCB manufacturer make the board to my design, so I'm going to look at going down that route I think. However before I commit to that I'll have to do a bit more in the development stages, such as testing the MOSFETs out controlling fans, check the temperatures they get up to etc.

 

When I place the order It'll take around 12 working days as the firm I plan to use outsource the manufacture to South Africa.



#14
andybones12

andybones12

    Level 10

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 4,149 posts

 I lost my temper slightly and launched everything across the workshop. 

 

I can understand your frustration lol.

Still very impressed with this build.

Good luck ;)

 

Andy



#15
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Cheers mate, I must admit my temper is always my downfall. Just ordered what's known as a breakout board from ebay (china) so I can test the 'proper' chip out for this, once thats done Ive already mostly got the final design done and will be sending it off to the PCB manufacturer in the next week or so :)



#16
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Having a few problems with the mosfet PWM control, seems to be related to the values of associated components, which means the speed-control range isnt 100% accurate, i.e. I'm getting sometihng like 0-100% control in a short amount of the range. Anyways here's a vid of it wort-of working with control off the PC

 



#17
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Right, things going really well now:

 

PWM working 100% properly now and a basic user interface done for now (mainly to test hardware so it isnt all pretty yet)..here's a screenshot:

 

usbinterface_screenshot1.jpg

 

Got the 3 digital input channels working, If i put 12V in (from a front panel switch etc) it gets detected

 

Got the 5 PC controlled switching channels (for lighting etc working)....Youtube video demonstrating this below:

 

 

 

These can handle some silly power figures (around 40A with the components used) however the limitation will be the width of the trace on the PCB so probably 2.5-5A would be a more sensible figure, also that low a current wouldnt need a heatsink so reduces cost and space.

 

Temperature sensors working now, circuit modified on prototype to make the readings more stable, accurate now to 0.1 degC

PWM fan control, had to do some frequency tweaking as the fans were making odd squealing noises and control was a bit erratic, now set at 25KHz as per Intel Specs and getting good results :) Also the components used are beefy enough that each PWM fan channel could easily handle 4 or 5 120mm fans without any problems.

 

Now all Ive gotta do is a few more little tweaks to do with the LCD like backlight switching etc and then on to do a final design for the board and send off for manufacture.



#18
andybones12

andybones12

    Level 10

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 4,149 posts

Well it seems to be coming along very nicely.

Still too complicated for my pewee brain,but looks like you're nearly there ;)

 

Andy



#19
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Getting there mate, thing is my design has gotta be spot-on otherwise when i have the PCB produced at the manufacturer at about £30 plus postage then if my design is wrong then all i'll get is something that doesnt work :) so its now really a case of triple checking everything, trying to get everything squashed into a small an area as possible without having signals interfering with each other.

 

Reckon I'm looking at around another week or two at most before I send the design off to have it made :)



#20
vitesse

vitesse

    Level 3

  • Members
  • PipPipPip
  • 160 posts

Since I havnt posted in ages, very short update. I have done absolutely nothing since last time. Waiting for a breakout PCB to arrive from Taiwan that I ordered a few weeks ago. Reason is some of the pin designations in the datasheet are different between the 40 pin inline chip (big one) and the 44 pin TQFP (small square one) and I want to test one of the proper chips out before I have the board professionally made to avoid screw-ups.

 

So just playing a waiting game.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users