Shop OBEX P1 Docs P2 Docs Learn Events
12V Load Control — Parallax Forums

12V Load Control

cahcah Posts: 4
edited 2008-04-24 22:37 in BASIC Stamp
I found a simple way to monitor voltage between 5-16V at this site http://www.bobblick.com/techref/projects/a2d555/a2d555.html·using a 556 timer from Radio Shack so I decided to try load controlling.


I am having some trouble with certain loads in the following setup using a STAMP and a IRF510 Power MOSFET.· It seems that a 12v LED light @ 200ma·can be switched between 11-13v·great, but a fan @ 400ma not so great.· The STAMP will loop a couple of times then stops debugging but the load continues.· Is the fan causing noise that can be filtered?

HIGH 1
start:
DO
V1· VAR Word
V2· VAR Word
V3· VAR Word
V4· VAR Word
PULSIN 5,1,V2
V1=21816
V4=V1/V2
V3=V4*100 'I am going to get around the integer-only Stamp math.
V4=V2*V4
V1=V1-V4*10 'remember the Stamp has left-to-right math
V4=V1/V2
V3=V4*10+V3
V4=V2*V4
V1=V1-V4*10
V4=V1/V2
V3=V4+V3
V3=V3+260 '250 is really 2.5 volts
DEBUG "Voltage = ",DEC V3,CR 'we get a reading in hundredths of volts
DEBUG CLREOL
PAUSE 2000
LOOP UNTIL (V3<1100)
LOW 1

DO
PULSIN 5,1,V2 'I used pin 0
V1=21816
V4=V1/V2
V3=V4*100 'I am going to get around the integer-only Stamp math.
V4=V2*V4
V1=V1-V4*10 'remember the Stamp has left-to-right math
V4=V1/V2
V3=V4*10+V3
V4=V2*V4
V1=V1-V4*10
V4=V1/V2
V3=V4+V3
V3=V3+260 '250 is really 2.5 volts
DEBUG "Voltage = ",DEC V3,CR 'we get a reading in hundredths of volts
DEBUG CLREOL
PAUSE 2000
LOOP UNTIL (V3>1300)
GOTO start
872 x 360 - 22K

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-04-22 23:52
    cah



    ······························· Take a look at this post this might help you

    ·http://forums.parallax.com/showthread.php?p=625984··· ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 4/23/2008 12:03:31 AM GMT
  • cahcah Posts: 4
    edited 2008-04-23 16:00
    Thanks for the reply I was hoping to save my adc for something else and keep my stamp current draw as low as possible.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-04-23 23:20
    It's hard to tell from your drawing there, but it looks like you have one lead of the fan connected to +12 and the other to a Stamp pin (pin 1 or something) and where is the MOSFET?
  • cahcah Posts: 4
    edited 2008-04-24 22:37
    Pin 1 is connected to the gate of the MOSFET. Sorry drawing is a bit crude.
Sign In or Register to comment.