Pages: [1]   Go Down
Author Topic: Velleman + Arduino  (Read 1209 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone know how to make a Velleman work with Arduino to make a lamp dim?

I have it all plugged in and I have a simple knob set up on the Arduino to be able to dim one lamp.
I had seen on another post that to get the thing to work with 5v or 220 wall power that I had to use a 100ohm resistor and 4.7uf capacitor between the Velleman and Arduino. Here: http://arduino.cc/forum/index.php/topic,15708.0.html

So it looks like this

arduino                           velleman               
+ pos ---------- I--------------+ pos
                     I
            100ohm resistor
                     I
            4.7uh capacitor
                     I
- neg ---------- I-------------- -neg

It could be a problem with my callibration too. The Velleman instructions say:
"To trim RV1 just below the bulb ignition threshold"
- I don't know if this means to turn it off so it doesn't blink at all or?

Then "Adjust RV2 (max level) until LD1 burns steadily"
- Does that mean until its not blinking and is solid green or until it holds a blinking rhythm or?

If someone has been successful in using Velleman with Arduino in dimming a light please help me out.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 434
Posts: 23593
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Velleman what? They make all kinds of stuff.
These guys seem to carry the entire line.
Search for relay - 63 hits!
http://www.omnikits.com/phpstore/index.php
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Manchester, UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 288
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think she's talking about the K8064 (http://www.vellemanusa.com/products/view/?country=us&lang=enu&id=521945)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, its that one. K8064
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yesterday when I had it all hooked-up, like I wrote above, I was at the stage where I was calibrating it but following the directions as I understood them (continue turning RV1 until it flickered quicker then back it off a little bit until it flickered slowly again, Then turn down RV2...but I never got it to be solid green, which is what "burn steadily" means?) So when calibrating it this way the bulb seemed to stay just fully lit with little flickers every so often. I found I could dim the light only if I  I physically turned the Velleman's RV1 pot (above the red LED). All the way off and the bulb was very dim, all the way up and the bulb was bright. 
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 434
Posts: 23593
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, so you' re really interested in using a PWM output thru a RC lowpass filter to make an analog level to drive the optocoupler.
http://sim.okawa-denshi.jp/en/CRtool.php
Use 1K resistor, 1uF cap, should smooth out the 490 Hz PWM okay for.

Pg 15
http://www.vellemanusa.com/downloads/0/illustrated/illustrated_assembly_manual_k8064.pdf

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that. Unfortunately, there's still something wrong.
I've swapped out the components and now it looks like this:


The calibration instructions say the following:
1. Turn RV1 fully counter clockwise and turn RV2 fully clockwise
2. Set the control voltage to 0 VDC
3. Apply AC power
4 Adjust RV1 until LD1 (green) starts flashing rapidly
5. Trim RV1 just below the bulb ignition threshold <----I don't really know what that means
6. Set your max control voltage e.g. 10VDC <-----I'm doing 5v, which is my max
7 Adjust RV2 until LD1 (green) burns steadily <------goes out instead of being solid

Here is a video of exactly what I'm doing:
http://www.angelaguyton.com/temp/velleman.MOV

And here's the code for the knob:
Code:
//Example 06B page 67 of the Arduino book.
// A brightness specified by the value of the analogue input

#define LED 13 // the pin for the LED
#define lamp 9 // pulse width modulation to VELLEMAN

int val = 0; // variable used to store the value coming from the sensor

void setup() {
  
  pinMode(LED, OUTPUT); // LED is as an OUTPUT
  // Note: Analogue pins are automatically set as inputs
  pinMode(lamp, OUTPUT); // lamp is an OUTPUT
}

void loop() {
  
  val = analogRead(0); // read the value from the sensor
  analogWrite(LED, val/4); // turn the LED on at the brightness set by the sensor
  analogWrite(lamp, val/4);
  delay (10); // stop the program for some time
 
}

It feels like the value of the pots that I adjust are in the wrong range, but they are the ones that came with the kit and their values match the instructions in the booklet (so its not like they're the wrong type).
What do you think it could be?
« Last Edit: August 21, 2012, 08:34:18 pm by aguyton » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 434
Posts: 23593
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try adding
Serial.begin(9600);
into void setup

and add
Serial.println(val) ;
after reading it and see what you are getting.

Make the delay(2000);
so you swamp the serial monitor.
The PWM  output won't change .

Also
#define LED 13 // the pin for the LED
13 is not a PWM pin, so
analogWrite(LED, val/4); //
is not going to do much. Try moving LED to 11.

Put a meter on the filtered PWM signal and see what you are getting.

analogRead returns a 10-bit number, 0x00 to 0x03FF (1023).
/4 cuts off the lower 2 bits,  so that analogWrite can work on an 8-bit number, 0x00 to 0xFF (255).
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: