element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Replacing a device's button with an Arduino
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 30 replies
  • Answers 11 answers
  • Subscribers 393 subscribers
  • Views 4795 views
  • Users 0 members are here
  • arduino uno
  • arduino_tutorials
  • advice
  • costume
Related

Replacing a device's button with an Arduino

talongrayson
talongrayson over 8 years ago

Hi,

 

Let me start by saying that I'm fairly new to electronics, and I may get some terminology wrong in this post. I'll do my best to ensure it makes sense, though, and please feel free to correct me where necessary as I am very keen to learn.

 

As the title (vaguely) suggests, I am working on a project in which I need to - for want of a better description - replace a device's 'push to make' switch with an Arduino Uno.

 

The project is actually the glove of a costume I am building. It is going to release 'smoke' when the wearer's hand is in specified positions. The setup isn't hugely complicated, and I believe I have everything straight in my head except for one thing. I'll start by explaining the setup...


In the glove I have an accelerometer, and with my Arduino sketch I can define gestures and recognise those gestures.

 

I've built a basic shield for the Arduino with a transistor so that I can control a blower fan. The Arduino and fan are powered by a 9v battery which connects to this shield. I've essentially enclosed the blower fan so that its inlet is connected to a 'vape' (you know, one of those e-cigarette type things).


So far I have got everything working, but the vape is not connected to the Arduino in any way. In fact, it hasn't even arrived yet, so while awaiting its delivery I've been considering how I might connect it all up.

The intention is to have the fan and some LEDs turn on and the vape button pressed when a specific gesture is made. The vape will heat up, the fan will suck vapor through the tubes, and the vapor will emerge from the glove. When the gesture is no longer being made, the fan turns off and the vape button is released.

 

I've gone through a couple of options in my head, including things like having the Arduino control a servo which mechanically presses the button on the vape, but what I'd really like is it pretty much desolder the vape's switch, remove it from the vape, and solder wire at its connections which then connect to the Arduino... or thereabouts, if you see what I mean.

 

So I'm here to get some advice on what would be the best way to approach this. Is it possible? Trivial? Will I need to use a transistor, a DAC, a relay, or some other method?

 

Any help would be greatly appreciated and I am more than happy to elaborate further if needs be.

  • Sign in to reply
  • Cancel

Top Replies

  • talongrayson
    talongrayson over 8 years ago +3
    The reed relay arrived today. To cut a long story short, it works like a charm. Next step is to migrate that part of the circuit to the shield. In due course I will upload photos/video to show it in action;…
  • jlangbridge
    jlangbridge over 8 years ago in reply to talongrayson +2 verified
    Aha... So there is a bit of logic there, this isn't a simple on/off switch (I'm not a vaper either, so I had no idea). Well, maybe the "easiest" solution would be to use a relay. There are several types…
  • jlangbridge
    jlangbridge over 8 years ago in reply to talongrayson +2
    Possibly, but I still need a bit of information first; the amount of power required to activate the switch. The relay itself is powered by a coil, and that coil requires power, but a lot of relays require…
Parents
  • jlangbridge
    0 jlangbridge over 8 years ago

    Hi there! Welcome to the wonderful world of Arduino. With the ideas that seem to be in your head, this is probably just the beginning of your adventure image

    It is extremely difficult to answer your question without having seen the hardware. If the "switch" is just a signal to tell the vape to work, you might not actually need any electronics at all. If, on the other hand, it is a power button, and pressing the button sends the energy to the vape, then things become slightly more complicated, but only slightly, you will probably be using a relay, or something close. Relays on the Arduino range from easy to very, very easy. Some might require a little bit of power, by adding a transistor, but you might find a model that will work with the Arduino's output current.

    Sorry if I can't answer that question right now, but the only answer I can give you is that I don't see any difficulty in completing your project, depending on what the button does. I don't see this as a problem, and you should be up and running with minimal fuss image Just let us know when you get the hardware!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • talongrayson
    0 talongrayson over 8 years ago in reply to jlangbridge

    Hey, thanks for the welcome and the fast reply! From what I've seen of the hardware so far, it functions roughly as follows:


    The vape is powered by a pair of 3.7V, 35A batteries. The vape is essentially a single button device, so you use that one button to turn the vape on or off with 5 presses in a row, and once on, you hold the same button down to heat the element which vaporises the glycerine. Typical usage would be to turn the vape on with 5 presses, then whenever the user wants to take a puff, they hold the button down and suck the vapor out (again, maybe not the correct terminology, I'm not a smoker/vaper), then release the button between puffs.

     

    I do know that the tech inside the vape is fairly sophisticated. It has timer cutoffs, temperature cutoffs, and so on. But in essence I am just looking to replace the physical switch with a virtual one - and I guess running all the vape's current through the Arduino as a means to that end.

     

    From a software point of view, when the Arduino recognises the prescribed gesture, the code will 'press' the switch 5 times (with maybe 500ms between presses, or whatever), then 'hold the button down', and when the gesture is no longer recognised the button would be 'released', and then 'pressed' 5 times again. Each press or hold would, I presume, be an analogWrite(); so the code for an on/off toggle would be:

     

    // Toggle on/off:

    for(int i=0; i<5; i++) {

    analogWrite(VAPE_PIN, HIGH);
    delay(20);

    analogWrite(VAPE_PIN, LOW);
    delay(500);

    }

     

    Anyway, I'm kinda brain dumping here... I'll come back with some photos of the hardware once I receive the thing in the post, or if I find any tech specs, I'll post those.

     

    Cheers

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to talongrayson

    Aha... So there is a bit of logic there,  this isn't a simple on/off switch (I'm not a vaper either, so I had no idea). Well, maybe the "easiest" solution would be to use a relay. There are several types, but here, a reed relay is the simplest; you don't have a lot of current or voltage to switch on and off, so let's keep things simple. To test, there are multiple shields and breakout boards withrelays. And yes, your code will look something very much like that (although these are going to be on/off pins, so stick with digitalWrite, we don't need analog outputs). Looking forward to the photos!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to talongrayson

    Aha... So there is a bit of logic there,  this isn't a simple on/off switch (I'm not a vaper either, so I had no idea). Well, maybe the "easiest" solution would be to use a relay. There are several types, but here, a reed relay is the simplest; you don't have a lot of current or voltage to switch on and off, so let's keep things simple. To test, there are multiple shields and breakout boards withrelays. And yes, your code will look something very much like that (although these are going to be on/off pins, so stick with digitalWrite, we don't need analog outputs). Looking forward to the photos!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • talongrayson
    0 talongrayson over 8 years ago in reply to jlangbridge

    Something like this would potentially work, then (would I need the 12v version)?

    https://www.rapidonline.com/ece-edr0201a0500z-5v-spno-dil-reed-relay-60-2400

     

     

    So long as I connect all the pins correctly, of course!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlangbridge
    0 jlangbridge over 8 years ago in reply to talongrayson

    Possibly, but I still need a bit of information first; the amount of power required to activate the switch. The relay itself is powered by a coil, and that coil requires power, but a lot of relays require more power than the Arduino can handle; typically 40mA per pin max. I'm stuck in a meeting right now, I'll have a look at some options when I get home.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • talongrayson
    0 talongrayson over 8 years ago in reply to jlangbridge

    Hi again!

     

    The vape arrived today and oh boy are these things more complex and sophisticated than I'd assumed. The unit itself has 3 buttons, as stated before. 2 of them are used to set the amount of power used to heat the element, the other is the 'fire' button, which is the one I wish to control.

     

    I've done some tests to make sure the rig works as a whole (i.e. vapour is drawn from the vape, through the tubing, etc) so I know it all works, and I think I am now ready to hook the thing up to the Arduino via a reed relay. Well, I'm ready to (with some help) figure out how to hook it up to the Arduino, to be more precise!

     

    I've attached a photo of the switch itself (nothing terribly exciting - a 4-pin push to make) but I'm not really well versed in electronics to know what we need to figure out. I'm guessing current across the switch while the unit is on, and current across the switch while the element is being heated?

     

    In terms of wiring it to the Arduino, given how small the solder points are, I'm thinking - to avoid getting up close and personal with the soldering iron - I could tin some wire and heat the wire from further up in the hope that the tinned wire and solder on the board fuse together. And I'm thinking I could leave the switch in since running wires to the Arduino will allow the circuit to ignore the switch anyway. Does that sound ridiculous?

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube