Go Down

Topic: Velleman + Arduino (Read 2373 times) previous topic - next topic


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
            100ohm resistor
            4.7uh capacitor
- 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.


Velleman what? They make all kinds of stuff.
These guys seem to carry the entire line.
Search for relay - 63 hits!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


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


Yep, its that one. K8064


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. 


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.
Use 1K resistor, 1uF cap, should smooth out the 490 Hz PWM okay for.

Pg 15

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Aug 22, 2012, 03:29 am Last Edit: Aug 22, 2012, 03:34 am by aguyton Reason: 1
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:

And here's the code for the knob:
Code: [Select]
//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?


Try adding
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 .

#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).
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131