Pages: 1 [2]   Go Down
Author Topic: Step down 16 volts, 10 watts AC (yep, AC, not DC) to 5 volts DC  (Read 1061 times)
0 Members and 1 Guest are viewing this topic.
Helsingborg, Sweden
Offline Offline
Sr. Member
****
Karma: 23
Posts: 498
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks ok from what i can tell from your photo. The only thing i could not see was if the IC was inserted in the right direction.
Make sure it is.
Some  troubleshooting tips:
Start by taking away the wires between the bredboard and the arduino
Does the bell sound when you push the button?
If so, measure the voltage over the resistor with a multimeter. Is there voltage when the button is pushed? When not?
Logged

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

Yes, the doorbell works. I think I might know what the problem is though... So, the optoisolator detects current and lights up, the other end detects light... so, when the doorbell button isn't pressed, there is enough current to light up the doorbell itself.

I've attached unpressed (0.13V) and pressed (12.5V).


* 2013-11-27 18.03.58.jpg (1455.4 KB, 3264x2448 - viewed 11 times.)

* 2013-11-27 18.03.44.jpg (1432.28 KB, 3264x2448 - viewed 10 times.)
Logged

Helsingborg, Sweden
Offline Offline
Sr. Member
****
Karma: 23
Posts: 498
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thats the way it should work. It seems that the problem is in the optoisolator.
Logged

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

Well, probably not the optoisolator... I think I probably messed up my arduino smiley-sad

I just tested by only hooking up 1 wire to the digital port, not connected to anything and it still wavers back and forth like a button is being pressed. If there is no cable, it does it less, but still does it....

Unless my app is messed up or something... I'm so frustrated smiley-sad


* 2013-11-28 01.07.40.jpg (2184.77 KB, 3264x2448 - viewed 21 times.)
Logged

Helsingborg, Sweden
Offline Offline
Sr. Member
****
Karma: 23
Posts: 498
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A wire hooked up like that will act as an antenna and pick up any electric energy in the air. And thats enough to trigger an input.
The next step in troubleshooting is applying the multimeter to the output of the optocoupler. In order to get it working you must have supply connected to it. If it is working you should get a 5V signal when you press the bell button and 0V when not. Now you can tell whether to replace the optocoupler or not. Next step would be writing a simple sketch that just transfers the value from the input pin to a led. I see you are using a yun. Don't know much about that one but all my arduinos have a onboard led connected to pin 13. So i'm assuming the yun has it as well. If not you have to connect your own.
Code:
void setup(){
  pinMode(13, OUTPUT);
}//setup()

void loop(){
  digitalWrite(13, digitalRead(3));
}//loop()

Check the value of the resistor. It should be around 1kOhm. Not critical, everything from 300Ohm to 3kohm will probably work. Check the direction of the diode as well, its a common error source to orient them backwards.
Logged

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

Hmmm... ok, I think you might be right. I double checked the wiring, applied the voltage to the doorbell, tested it and it works to plan. I hooked up the arduino and plugged the multimeter into the board on the same heads on the arduino side (check attached image).

I got 0.1v when it wasn't pressed and 1.7v when pressed.... bad optoisolator?

Edit: I made a video to illustrate what I'm talking about: https://www.dropbox.com/l/otIbk7UbzyIkL0JlvTnCeO


* wiring.png (11.3 KB, 529x435 - viewed 9 times.)
« Last Edit: November 28, 2013, 04:55:03 am by binarypower » Logged

Helsingborg, Sweden
Offline Offline
Sr. Member
****
Karma: 23
Posts: 498
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what voltage do you get when you measure between arduino gnd and arduino out? Try to repeat this measurement with a 270Ohm ( or so..)resistor between arduino out an arduino gnd
Logged

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

Ok, so without the resistor, 0.07v  unpressed and -0.7v pressed.

with a 270 ohm resistor between ground and the output, 0.00mv unpressed and -0.70mv pressed.

Logged

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

Ok, so I made my own optoisolator using a LED and a photoresistor.... now it works. Hade to make some minor tweaks to the code though (changing to analog pin) and a lot of electrical tape... but I think I'm good now. THANK YOU FOR ALL YOUR HELP!!!  smiley-kitty

Code:
#include <FileIO.h>
#include <Process.h>
#include <Console.h>

const int sensorPin = A0;   
int senselight;

void setup() {
  Bridge.begin(); // Initialize the Bridge
  Serial.begin(9600); // Initialize the Serial
  FileSystem.begin();
}

void loop() {
 

senselight = analogRead(sensorPin);


Console.println(senselight);
 
Process p;
 

if (senselight > 10)

  p.runShellCommand("cat /etc/ssmtp/doorbell.txt | ssmtp myemail@gmail.com  2>&1");

while(p.running()); 

 
  while (p.available()>0) {
    char c = p.read();
    Console.print(c);
  }

}


* 2013-11-28 19.25.00.jpg (1808.15 KB, 3264x2448 - viewed 9 times.)

* 2013-11-28 19.30.21.jpg (1603.04 KB, 3264x2448 - viewed 7 times.)
Logged

Helsingborg, Sweden
Offline Offline
Sr. Member
****
Karma: 23
Posts: 498
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice to hear that. good luck with your projects int the future. And I'm sure you learned a lot
Logged

Pages: 1 [2]   Go Up
Jump to: