Login    Register
User Information
Username:
Password:
We are a free and open
community, all are welcome.
Click here to Register
Sponsored
Who is online

In total there are 72 users online :: 5 registered, 0 hidden and 67 guests


Most users ever online was 155 on Mon Aug 15, 2016 1:40 am

Registered users: Bing [Bot], Google [Bot], Google Adsense [Bot], MSNbot Media, Yahoo [Bot] based on users active over the past 5 minutes

The Team
Administrators
Global Moderators
global_moderators.png CS

Need help with an electronic circuit

All non-spudgun related discussion goes here such as projects, theories, serious questions, etc. All "off-topic" posts (aka useless posting, determined by moderators) will be removed.
Sponsored 
  • Author
    Message

Need help with an electronic circuit

Unread postAuthor: potatoflinger » Sun Feb 24, 2013 11:26 pm

Well, I am really new to making electronic stuff, and I am running into an issue with a project I am working on. The project is a chicken coop door that opens and closes automatically based on the amount of sunlight it receives. The door works by having an old drill wind up a rope to open and close the door. I programmed an ATtiny 85 to read the amount of light through a photocell, and then I wanted to use two relays to control the motor. (one for forwards, one for backwards)

The problem I am running into is that I know the ATtiny can't supply enough power to activate the relay, which requires 5vdc, but it needs more amperage than the ATtiny can supply. I know the best thing to use is probably a transistor of some sort, but I have no experience with them.

My question is: can anyone point me in the right direction for using a transistor to trigger the relay? I really just need to know what type of transistor to use and how I should connect it so that one of the digital outputs on the ATtiny will activate a relay.

Any help is very much appreciated.
  • 0

It's hard to soar with eagles when you're working with turkeys.
User avatar
potatoflinger
Brigadier General
Brigadier General
 
Posts: 1136
Joined: Thu Nov 02, 2006 3:26 pm
Location: Maryland
Reputation: 1

Unread postAuthor: Zeus » Sun Feb 24, 2013 11:30 pm

You can use a reed relay, they take some 20-50mA, and can switch 1A. Or just a 2N2222 to switch it.
  • 0

/sarcasm, /hyperbole
User avatar
Zeus
Major General
Major General
 
Posts: 1422
Joined: Tue Oct 27, 2009 7:34 pm
Location: 'Straya, C*nt
Reputation: 2

Unread postAuthor: dewey-1 » Mon Feb 25, 2013 1:36 am

I will do a schematic for you tomorrow.

What is the voltage and current of the drill motor? What is the power source?
Hopefully it is a DC motor.

Use a ULN2803 (sink driver) or UDN2981 (source driver) IC with one relay SPST for power on/off and a DPDT relay for polarity reversal.
  • 0

User avatar
dewey-1
Major General
Major General
 
Posts: 1298
Joined: Wed Mar 28, 2007 10:24 am
Location: NE Wisconsin USA
Reputation: 0

Unread postAuthor: Technician1002 » Mon Feb 25, 2013 3:37 am

A robotics RC servo amp/motor speed control and do the job. Direction and speed is simply defined by pulse width sent to the speed control. A positon feedback pot on the door can make it a full servo, so the uController can simply send a desired positon pulse width, and the servo will simply tend itself to drive to the desired position.

Look up info on driving RC servos for further reading.
  • 0

User avatar
Technician1002
Chief of Staff
Chief of Staff
 
Posts: 5190
Joined: Sat Apr 04, 2009 11:10 am
Reputation: 14

Unread postAuthor: Zeus » Mon Feb 25, 2013 6:02 am

Bear in mind though, servos aren't too cheap, and while I've used them, and love them, for this sort of application, they might not be worth the investment. Locally I'd pay $40-60 for a 5kg servo, which would be marginal for a coop door, whereas a windscreen wiper motor is about $5-15.

And personally, while micros are nifty, I'd just be inclined to make a simple light/dark sensor from $5 of parts, and not have to worry about voltage regulation and driving relays from different levels. The dependance on micros is getting concerning for the users of analogue circuitry, it's almost a dying art...
  • 0

/sarcasm, /hyperbole
User avatar
Zeus
Major General
Major General
 
Posts: 1422
Joined: Tue Oct 27, 2009 7:34 pm
Location: 'Straya, C*nt
Reputation: 2

Unread postAuthor: POLAND_SPUD » Mon Feb 25, 2013 10:14 am

Personally I'd use an H bridge - either as an IC or just build one out of transistors.


This part would make things a lot easier though I assume that the motor uses more than just 1 A ?
https://www.sparkfun.com/products/315

Does anyone know anything rated to more than 1A that has inbuilt diodes and is fairly inexpensive ?
  • 0

Children are the future

unless we stop them now
User avatar
POLAND_SPUD
Chief of Staff
Chief of Staff
 
Posts: 5405
Joined: Sat Oct 13, 2007 4:43 pm
Country: Israel (il)
Reputation: 10

Unread postAuthor: Technician1002 » Mon Feb 25, 2013 11:07 am

I some full mechanical servos are expensive as they are engineered to not fail when pulling high g forces on that 1/4 scale jet.. you don't need that level or expense.

The robotics guys pick up motor speed controls that are just fine for driving higher voltage (not 5 volts) with the H bridge built in. Some have a place to add a feedback pot to make the door a servo. To control it, only a single uP pin is needed with pulse width modulation.

If you want to roll your own, adding an H bridge to a very cheap servo (sub $10) to the servo amp is relatively trivial. A crash tested servo that has a good amp, but broken case or gears is a good source of a servo amp. It can drive a power amplifier to drive a drill motor.

http://www.seattlerobotics.org/encoder/200304/servo_speed_control.htm
A commercial solution adds spike suppression, noise isolation, and even opto isoloation so brush noise doesn't swamp your logic and cause glitches or full failure. In that regard they are relatively cheap.

http://compare.ebay.com/like/3805754977 ... &var=sbar#
  • 0

User avatar
Technician1002
Chief of Staff
Chief of Staff
 
Posts: 5190
Joined: Sat Apr 04, 2009 11:10 am
Reputation: 14

Sponsored

Sponsor
 


Unread postAuthor: dewey-1 » Mon Feb 25, 2013 2:56 pm

Here is a simple schematic for your reversing motor control.
Note that inductive loads have about a 30% of maximum resistive current in relay contact ratings.
  • 0

Attachments
PF-Motor-Ckt.jpg
User avatar
dewey-1
Major General
Major General
 
Posts: 1298
Joined: Wed Mar 28, 2007 10:24 am
Location: NE Wisconsin USA
Reputation: 0

Unread postAuthor: potatoflinger » Mon Feb 25, 2013 5:54 pm

Thanks for all the great info. That schematic seems like it should work well.

To answer a few questions, the power source is going to be a wheelchair battery, which is just a 12v deep cycle lead acid battery. The drill is a dc motor that runs at 9.6v. With no load on the motor, I measured a draw of between 3 and 4 amps, but under a load it would be higher.

There will be a set of normally closed sail switches (one at the upper limit of the door and one at the lower) that will cut the power to the relays that drive the motor when they are pressed, so that the door will stop in the right places.

I will post a video of it in action after I get it working. It will be at least a few days from now though, because I am going to be busy with other stuff for a little while.
  • 0

It's hard to soar with eagles when you're working with turkeys.
User avatar
potatoflinger
Brigadier General
Brigadier General
 
Posts: 1136
Joined: Thu Nov 02, 2006 3:26 pm
Location: Maryland
Reputation: 1

Return to Non-Spudgun Related Discussion

Who is online

Registered users: Bing [Bot], Google [Bot], Google Adsense [Bot], MSNbot Media, Yahoo [Bot]

Reputation System ©'