Arduino screen lifter and home theatre system

I always wanted to build a screen that
can be lifted up and down and recently I had the ability to build
one, so I did some research on the internet and found nothing. So I had to start from scratch and I came up with this system so the system is based on an arduino nano. I putted it in a small box in here You just have to push the button. So two servomotors, one for the spool. I customize it for continuous rotation. And the
small one for the lock. there is also a night light Here, for my kid. and a temperature control for my stuff in here so there is a temperature sensor inside and the temperature rises, it makes
the two fans here moving. OK so I will explain the problems I had when I built this and how I managed to figure out some of those problems so first of all I had to face a problem that the screen will touch the top of this furniture so I had to build to design some kind of wheel to make it slide on here so I used those metallic parts on a screw Also a microswitch. the lower microswitch & there is also of course in
the open position another microswitch this wooden part will hit the which in the lower position and it will makes the screen stops. For
the spool, I had to face another problem. okay so the screen is about 3 or 4 kilogram it’s quite heavy actually so I had to design a break. To design the spool, I used as a base the regular horn from the servomotor, and I bounded it to this stuff Like this, with some pinions here, and with this master model
I built a silicon mold. actually it’s my job, I’m a prototype builder, so it wasn’t a big deal for me okay and I vacuum casted the pool with a resin thermoset resin. So that the first one, the very first one I made but the pinion gear was way too thin so when the stopper hits it in the upper position it make it break. So the second stopper I made has two teeth. It was better still not enough so the one I use now has 3 teeth. when I designed this spool I
had to be very careful about one thing to have exactly the same space here and here, on to parts of the spool. why because if you don’t have the same space
that means that the cable won’t rise at the same
rates speed on the left and the right it’s a very very bad thing so I had to
be very very careful in measuring the distance. my three years
old kid sleeps in this room so I had to build a nightlight with an auto off
function so I put the LED tape on here and you can control the light with a
regular potentiometer here. and to choose the timer there’s actually four timer keep pushed the lower switch of the screen and just turn the potentiometer. And there is four series of flashes. so one flash is for 15 minutes to flashs is for
30 minutes three flashes for one hour, so you
get the idea okay so before starting with the code,
you will have to understand two things the first one is if you want to control
the speed of a regular computer fan, you will have
to increase the PWM frequency. The native arduino PWM frequency is about 500 Hz so 0.5 kHz. you can eventually control the fan but it will emit a very annoying sound
like a loudspeaker so you don’t want this, trust me. so you have to increase the speed of the PWM
frequency so you can do this, you just have to add this line to your code in the setup and your done. The second thing is the analogWrite resolution if you want to use a very dimmed light. At 255, the default setting, the gap between
the first levels is perceved by the human eye to be
quite huge actually and if you dim the light gradually
down to zero it won’t be smoth. So there is a
library to change it it’s called the PWM library here and you
just have to add this line in your setup to
change it the resolution of the timer one and 2 related pins, and with this, certain instead of 255 levels you will have the 30 000 levels A lot of automated functions such as
delay relies on timer zero, so this
function let timer zero at its default values.
the drawback is you cannot uses timer1 all 2 related methods anymore that includes libraries. so that means no servomotor library. but no problem there is a way to control
servo with a regular function without the servo library. I will show you. You have to understand how works a
servomotor. A servomotor is waiting for a pulse every 10 milliseconds the longer the pulse, the longer the angle will be. your main loop has to be about 10
milliseconds long. I supose it depends on the maker of the servomotor but
for mine it worked well down to 8 milliseconds and I don’t know for the upper limit but
I think it should be find up to about 20 milliseconds but I can’t assure you, you have
to try. to make it simple forget the delays() when
the servomotors are moving and cut the servo power with a relay or a transistor when you are done is a good thing to do. I won’t explain everything in the code only the big lines, for example the runningMedian library here is used to smooth the
readings of the analog temperature sensor. The wire is about 1.5 meter long so this kind of sensor is very sensitive to electrical noise so to limit it first, use a shilded cable may help a
lot and you can also add capacitor and a resistor near the sensor The last thing is if possible don’t put the sensor or the
cable close to a PWM noise emitting device, it can be hard… But of course the best choice you
can do is instead of a analog sensor use a
digital one those are not so sensitive to electrical noise. I should have done with this kind of
sensor actually… I regret that. That is a function that
controls the light the first part is to reset does it come down love that tamer
everytime you touch a potentiometer I use a threshold to avoid that self reset a in the case of UE a few want to use a cheap potentiometer and they’re not very stable so threshold may be a good thing and to have a
smoooooth demean I made this formula to slow down to decrease P dove the
value huge number decreases very fast but when you get close to the row it
will slowdown and put it quite happy with
this an OK this function is for the choice of
the time there when the screen is a in the upper position you just have to
keep push to the screen lower switch and
choose a time where you want to be the position within at Flushing sequence will give your
feedback one flash file 15 minutes to flashes for 30 minutes its
Terra you couldn’t do it that makes the screen
moving is based on the switch days and to avoid
delay a used timestamps when the state of the
screen changer from moving to not moving for a reason
to as this several times 10 3 reset in here so to make things happen exactly when they want anyen the all
there I want I just have to count the time with Emily the functionality
and compare it to to what they want so for example
here after 300 milliseconds the sweetheart & and after 325 anything on this and so on so I don’t think that might cause the is the piece of for of
art or something i hadn acquitting UBA started out we know and
programming engineer on about to two months is a go saw the I’m completing you the the to his some help in the internet you can do it
charlie great things now that we know is a very
powerful tool and ever and someone who is absolutely no background in programming
can do in such kind of thing very easily so small
bonus for the end this is the way I John increases by a vote 50 centimetres the stance from the projector to this
creator its your images rejected the the night admiral hunger by a regular section Cup the can rest down so I take a decision get
an eight to 10 screw things 8 and but he made he’s perfectly restricted


Add a Comment

Your email address will not be published. Required fields are marked *