help pid temperature with dimmer lm35

Hi how, well I explain more or less what I want to do to see if it is possible or not:
for a school assignment, I have to control the temperature of a box with a pid control
Parea had thought about that

as sensor and lm35
as a power stage, a paperdimmer with 8 levels (teacher's suggestion)
as a heater a 100w bulb

what happens is that I do not know how to make the program activate and deactivate the pins so that the power levels of the paperdimmer change and thus change the power of the focus

Can this be done or is it impossible?
What do you recommend me to do?

What's a paperdimmer?

Virtually all heating & cooling systems cycle on & off rather than "dimming". That works best because temperature doesn't change instantly. You hold the heater on 'till the temperature is slightly above the target. Then you turn it on again when the temperature is slightly below target.

Break up your project into managable chunks, like displaying temp on the serial monitor and (PWM controlled?) dimming of the lightbulb (a relay could be easier).
Then merge the individual working sketches into the final sketch.
Leo..

a paperdimmer is basically a dimmer but instead of varying power manually, it can be varied with the Arduino by activating and deactivating pins (with 3 pins you get 8 different levels of power). What I wanted to do is that the sketch will vary those levels depending on the level of error that had. For example, if the error was too large the Arduino would put the maximum light bulb, if on the other hand there was little error that lowers the power to the minimum. Can impossible things be done or am I thinking?

DVDdoug:
What's a paperdimmer?

Virtually all heating & cooling systems cycle on & off rather than "dimming". That works best because temperature doesn't change instantly. You hold the heater on 'till the temperature is slightly above the target. Then you turn it on again when the temperature is slightly below target.

I don't understand what your teacher really wants. As DVDoug said, heater control usually is an on/off thing, with heater ON while the temperature is too low, and heater OFF if the temperature is too high.

If your teacher expects you to implement a PID, a better solution tends to become an endless loop, due to the delayed temperature response that is very hard to compensate. But give it a try and learn some new tricks.

A PID regulator is quite easy to implement, you'll find many examples in the web and forum. The trick is the tuning of the PID, as you'll find out yourself soon. The regulator setpoint can come from a pot using analogRead(), the feedback comes from the LM35. The regulator output can be mapped into the 8 levels, then you split that number into 3 bits and send these bits to the dimmer inputs.