STM32F0 calculating temp and using fan to cool it, display the C in lcd

Thread Starter

Doruk öztürk

Joined Aug 7, 2017
7
Hello there everybody!

Hope its a good for all =).

So jumping right ahead to my project.
What I have to do is basicly by using STM32F0 discovery microcontroller to measure the temperature with a sensor (lm35), and then use the fan to cool the sensor temp to threshold value and then stop cooling until the temp goes up again.

I have managed to pull of this part, although I want to add 2 more features to my project (more points yay!). First one is to use pwm control to adjust fan speed acording to temp and the other one is to display the temp on a lcd. But I am kinda stuck since I dont know how to display it on lcd and coundt really find a guide.

I have figured out that I have to set duty cycles for pwm control but some help in thia part would also be appriated.

Here are the stuff that I have bought in order to build my circuit and some of my codes, so maybe you can give me some feedbacks =D.

12V relay 1A (At least 2 pieces)
 BJT NPN Transistor BC237 (At least 2 pieces)
 Crocodile cable (At least 2 pieces)
 Male-Male jumper (At least 10 pieces)
 Female-Female jumper (At least 10 pieces)
 Temperature Sensor LM35 (At least 2 pieces)
 Breadboard
 12V DC Fan around 0.2A nominal current (Optional)
 DC Power Supply (Available in the laboratory)
*lcd display (16x2)
*10k and 330 ohm resistors
*potantiometer
*uln2003 motor drives, a guide was telling that it is necessary for fan but I didnt really understand what for.

Guess thats all, I have some spare parts as well.

Any and all help would be much appriated and thanks in advance to every one!

Have a great day.

Here is the link for my main.c :
https://drive.google.com/file/d/0B3q2KcuOLPR_RDh5MUZLd1ExazBiSVVqM1lncGxGSjdaU2FN/view?usp=drivesdk
 
Top