Saturday, 30 January 2010

Solenoids- done!

I am now, finally, able to control my solenoid through arduino and NOT just with a power supply.

Big Achievement!!

For the first time with my electronics, the problem was not in the coding, but in the circuit. This is one of the hardest things to hook up, made harder with the use of a program and external power supply.

Coding is simply turning the solenoid on or off. When it is turned on, it will suck the piston in, and when released (off) pushes the piston out. This is why it is easy to use with solely a power supply, turn on the power, the solenoid is on, turn off the power, the solenoid is off. But i want to control it via arduino.


To begin:
I hooked the solenoid straight to the arduino board. Along with the red led, i programmed them to go on and off every second. This did work however, not enough power was available so the piston did not hold very well, i.e it was not strong enough current.



So:
I began using a MOSFET to drive the current up and an extrenal power supply to allow a higher voltage to be available, therfore producing a stronger hold. As you can see in the image, i hooked up one of the solenoid's wires straight to the power supply. This magnetized the solenoid independently of arduino. (With a higher voltage, the strength of the solenoid was greatly improved.)



So:
I started looking at ways to connect the solenoid indirectly to the power supply so I introduced a voltage regulator, which looks identical to the MOSFET. (The MOSFET is to the right)

I believe i hooked this up incorrectly as i smelt burning and touched my voltage regulator. ouch! Next time i advise disconnecting the power and letting things cool down. I discovered that the green wire should not connect the two devices...

Then:
I tried for AGES to hook up the circuit with both components before removing the voltage regulator as i wondered if i even needed it...


So:

I went back to the web and searched for pictures showing how to connect the components. This was very tricky...not much available in books and online showing you how to do it. But i did find a few, and with my systems diagrams i just kept at it.

This one made the solenoid vibrate

This one made the MOSFET really really hot and the solenoid didn't do anything. I don't think the MOSFET likes a direct ground line from the power supply.

This one magnetized the solenoid independently from arduino but the MOSFET did not heat up...


So... I went to the arduino forum hoping they might have a tutorial on how to use them and the only thing i could find was this systems diagram which i had looked at few weeks earlier in the anticipation of receiving my solenoids.

http://www.arduino.cc/playground/uploads/Learning/solenoid_driver.pdf


After studying it for a while i noticed i had missed out the green wire below. This adds an extra ground line from the arduino board to the' source' in the MOSFET.

voila! this is how to hook up a solenoid to arduino

Now i just need to program the pattern i would like my solenoids to play!

Developing form

These are my first proper sketches at developing the form of the device.

The form must include:
  1. a dial
  2. at least 1 toggle switch
  3. flat back edge where the solenoids will be
  4. must look good either on wall or on flat surface
I am also experimenting with the idea of using aluminum and cork. Both these materials are light weight, relatively easy to shape and cork is an excellent shock absorber.



Tuesday, 26 January 2010

Related Article

Some more research on sleep cycles, gender related:

http://www.dailymail.co.uk/health/article-1246029/Who-REALLY-needs-sleep--men-women-One-Britains-leading-sleep-experts-says-answer.html?ITO=1490

Zen Alarm

I really hate this device but what i do like is the output this device produces and how it delivers. This device uses a chime and begins its signal soft and gradually gets louder. This makes it perfect for relaxation and yoga apparently.

I thought i would mention this device to show that non recorded sounds are beginning to be used, but i am aiming for a pleasant yet assertive sound that the individual has control over.

The Da Vinci Alarm Clock

I have found a similar product to the one i am developing.

This alarm clock trains you to enjoy a 21 hour day by following the instructions the screen tells you and responding to the high pitched sound produced.


I semi-like the design but what i do like is that this alarm clock does not display time either, but indicates when to wake and when to sleep much like my own to build a routine.

By Marc Owen

Friday, 22 January 2010

Wind Charm Alarm clock


This device gently wakes you up in the morning at the set time. I only like the concept of this clock; using natural elements to wake you up.

http://craziestgadgets.com

Wednesday, 20 January 2010

The Dial

The dial that controls awake time is now completed with the real time clock. The dial will automatically set off the night time alarm as well.

So:
The dial has been separated into 12 sections or ranges from 0 - 12. Each section has a different alarm time, e.g:

at 0: the time set here is 6am AND 9pm

timeSetValue = analogRead(timeDial); //find what value the dial is sitting at

if(timeSetValue/68 == 0){ // if value = 0 then it is pointing to 6am

if(hour == 6 && minute == 0){ // so at 6am signal
digitalWrite (ledred, HIGH);
delay(1000);
digitalWrite (ledred, LOW);
delay(1000);
}}

else if(hour == 21 && minute == 0){ //AND signal at 9pm, still based on the same value.
digitalWrite (ledred, HIGH);
}

From this, i started to roughly mark out around the dial what value it is (pink) and therefore what time is being activated(black). In this image, you can see that the pointer is over 7am which will activate the 7am alarm along with 22pm alarm automatically.


There is also some circuit problems i need to speak to mike about. The dial will only ever give me my full range of 0 - 12 when plugged straight into my arduino board and not when in my bread board for some reason...

I am also ordering a multi-sector potentiometer that clicks when it is turned between it's values.