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
GIZMO 2
  • Products
  • Dev Tools
  • Single-Board Computers
  • GIZMO 2
  • More
  • Cancel
GIZMO 2
Forum Gimzo 2 custom On/Off button?
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join GIZMO 2 to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 51 replies
  • Answers 2 answers
  • Subscribers 13 subscribers
  • Views 6147 views
  • Users 0 members are here
Related

Gimzo 2 custom On/Off button?

Former Member
Former Member over 10 years ago

Ideally I'd want to modify the BIOS to autostart without pressing any button. But if nobody ends up knowing how to do that, I'd like to at least have a custom proper button on my device's case for turning the Gizmo on. I've read one of the pin pairs can be used, but which ones?

 

mCPawjq.png

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 10 years ago +1 suggested
    Hi Mark, The information is in this thread: http://www.element14.com/community/community/designcenter/single-board-computers/gizmo2/blog/2015/07/30/gizmo2--flash-bios-to-autostart-on-power-up . In summary…
  • shabaz
    shabaz over 10 years ago in reply to Former Member +1
    Hi Mark, Enrico is suggesting try it with a resistor, see if it works for you. If you observe some behavior that is undesirable (e.g. having to hold the button pressed for a long time) then it can be considered…
Parents
  • fvan
    0 fvan over 10 years ago

    Check out this post where I added an external power and reset button: http://www.element14.com/community/community/designcenter/single-board-computers/gizmo2/blog/2015/01/28/gizmo2-adding-external-pwr-and-rst-buttons

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to fvan

    Oh wow, so much great tutorials I'm having hard time finding image

     

    So you didn't use a resistor?

    Is there any requirement for what button can be used. All I know is buttons have a maximum current rating, this shows how little my electronics knowledge is. But it's going to be fun programming the Gizmo after I get this figured out.

     

    PS. Is that a 3d printed enclosure? That's another hobby of mine.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    So im confused, you think debouncing will be an issue here, or the opposite?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to Former Member

    Hi Mark,

     

    Enrico is suggesting try it with a resistor, see if it works for you.

    If you observe some behavior that is undesirable (e.g. having to hold the button pressed for a long time) then it can be considered further and you then may need a more complex circuit.

    His linked article is extensive, and provides much detail on how different debouncing circuitry works.

    Whether you actually need delays, debouncing, etc., can be answered in detail either by Gizmosphere (since they designed the board), or a detailed examination of the circuit and the power management IC user guide (which would require some time to investigate). An alternative approach (as suggested by Enrico) is to just try it, observe the results and see if it fits your required button-press behavior.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to shabaz

    Thanks shabaz image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    Sorry that I didn't get what you meant the first time. Thanks.

     

    EDIT: Oh wow, I confused the original post by Frederick Vandenbosch with Enrico Miglino because both of you had similar minions avatar, thats why I felt I was getting contradicting info from you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    Sorry for being a bit too cautious.

    The power on/off pins are these, right (highlighted in green)?:

    image

     

    And does the size of the switch matter? (different current from different resistance or something?)

     

    And hopefully last question: if I want Gizmo to autostart, just use a simple jumper with resistor for these two pins?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    The first answer is yes.

     

    The second answer is no. The pin simply send a signal based on the pull down as it is pressed and connects the high signal to ground then this input signal tells to the boot firmware to start the boot process, load the bios etc.

     

    To have the system autostart you should know how and modify this internal part of the firmware. In theory it is possible, just with the programmer and the sources of this part of the Gizmo2 project. As the entire device is open source you should not have difficult to find the information and software that is needed. But what is the reason you need the system autostart? And autostart what does ti means for you? Something should happen to make the system to start, correct? What event ?

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    Was the first answer also the answer to "does the size of the switch matter"?

     

    Okay, here's the reason I was thinking of having autostart for the Gizmo:

     

    1) The device is something like a light fixture consisting of 3 individual devices in one case:

    1. a tiny video projector

    2. Gizmo 2, which generates graphics and sends to the video projector

    3. an Arduino (Nano), for having buttons to choose between media files stored in a USB stick and read by a program running on the Gizmo 2 and communicating with the Arduino via serial, as well as controlling a tiny shutter motor to block video projector beam in some instances.

     

    So I need to turn on 3 individual devices, but want to have 1 button for that. It might be simple to create a circuit board for most of you to do this, but I don't have the skills.

    Arduino boots and starts executing when Gizmo 2 does, if connected via USB. So no problem there.

    Video projector is more complicated, it has a button you need to press and hold for 4 seconds for it to turn on. Sadly it can't autostart like the Arduino when power is applied.

     

    Now, if Gizmo autostarted as well when I connected the (not stock) power supply, I could still have what I want ( 1 button for turning on (visibly on) the light fixture ) and pressing the turn on button would start the video projector, and everything else (Arduino and Gizmo) would be ready already.

     

    But if autostarting Gizmo is not easy, I need some simple solution for powering both the Gizmo and video projector with one button.

     

    One solution I have in my mind is having the power on button just start the Gizmo, and then emulate the 4 second button press by a DC-DC relay and the Arduino (soldering cables around the video projector's start button).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    In my opinion you have the solution in your hands but you don't see it image

     

    Power on - Arduino starts

     

    Then the first thing that Arduino should do one is power the projector, then power the Gizmo2 then Gizmo2 starts communication etc. etc.

     

    How to? In both cases you need to connect the button that should be pulled to GND to one of the Arduino I/O and with a simple circuit based - for example - on a PN2222 transistor it is Arduino that do the job of powering on and off the systems.

     

    To manage the long press on the projector, short press on the Gizmo2, long press on Gizmo2 for power-off all can be done (and must be) by the Arduino, that is just the board that - as it is a Micro Controller - has this role in your architecture.

     

    The following link explain you very clear (with circuit) how to use and I/O digital pin on Arduino to simulate a push button switch using a PN2222 transistor: https://teachmetomake.wordpress.com/how-to-use-a-transistor-as-a-switch/

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    If I dont find a right transistor on time, are there DC-DC relays which could be used for this?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    Isn't that simple to me as it is to you I'm afraid.

    Although I did find the transistor needed.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    Isn't that simple to me as it is to you I'm afraid.

    Although I did find the transistor needed.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    Helo Mark,

     

    if you find the PN222 the solution is in your hands (at least the first part). The use of a relay is essential the same (the transistor is a realy). The difference is that with the realy you can switch digitally the relay and it can power on/off a different current. As in this case you need only to emulate a simple switch with a very low power the amplification and switching capabilities provided by a PNP transistor are more than sufficient. I suggested a PN222 because it is the one I use more frequently in this case but you can use it or any equivalent transistor, no matter for this.

     

    At this point, if I were you I will try breadboarding a simple circuit with the transistor (as shown in the linked documents of the post above) and see if without any debouncing it works fine. At this point the transistor switch operation should be done by the Arduino board (the first powering on and the first device running). So, as the entire system get powered, Arduino start its loop and the first thing that should do once is just to change the state of the I/O pin you have connected to the transistor. It switches the Gizmo2 and then if needed you can do the same to switch automatically the projector.

     

    As the projector needs the switch pressed for 4 seconds to start, the faster way to test the entire system is to use a delay(4000) in the startup Arduino script for the I/O pin of the Arduino connected to the switch of the projector. Then when all is working fine and you see that almost the hardware circuit is reliable you can optimise the Arduino code to make it more elegant and efficient.

     

    Let me know what are the steps that you have not clear so I can try to find better words to explain what I mean.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    I understand this is basic electronics and I'm really sorry for asking here, it's just I have a deadline and didn't expect I'd need this knowledge until the end of the project. You're being very helpful. Thanks a lot man!

     

    So two pins of the transistor are are connected before and after the On button of the projector, and the third pin is connected to the Arduino PWM pin which controls the switching of the transistor? Did I get it?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    Not exactly, Later I will post some example, I think it is better image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    Oh...

    Thank you image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    Hello Mark,

     

    the on button (generically any switch of this kind) when it is pressed it put the signal from the I/O to the GND generating the logic signal for the device. So take a look to the next image showing a piece of schematics that is what you need:

    image

    The GND signal is in common with the Arduino ground and the GND side of your power button (check on the schematics of the Gizmo2 where it is).

    The other side of the button is connected to the collector of the transistor (that is, the pin 1 of the connector JP10 in the schematics above).

    The Arduino control pin (one of your choice, no matter if this is PWM or not) is connected to the PB1 signal on the schematics.

     

    When the Arduino pin (PB1) goes low, the JP10 Pin 1 goes low too shortcut to the GND signal, the same what the push button do.

    The Arduino setup() you should set is the following:

     

    void setup() {
    
      pinMode(OUT_FLASH, OUTPUT); // Flash
    
      // Your initialisation code here
    
    }

     

    Then, create a function to switch the pin in the desired mode (e.g. simulate push button for 4 seconds)

     

    void lightFlash(int duration) {
      // Simulate button press
      digitalWrite(OUT_FLASH, true);
      // Wait the nmber of ms needed with the button pressed
      delay(duration);
      // Release the button
      digitalWrite(OUT_FLASH, false);
    }

     

    And call the function where you need only when the arduino starts (maybe as the last instruction in the setup() function.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    I suggest that you DON'T assume the question answered until you have not solved the problem by yourself or someone has not got you a correct answer.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    There's a bit of language barrier but you're giving a great illustration and explanation. image I hope I understand it all. So the main difference between a relay and the transistor is transistor uses the same Ground as the controlled current?

     

    I just dont get one thing, what about the pico projector button emulation?

    As I understood the ground for all has to be the same for some reason, right? Will I need to check the PCB of the pico and maybe post a close up photo so we can guess from where it flows?

     

    I don't really mind using a relay right now as I don't have much time left. You're teaching some interesting stuff which I'll probably need to know in the future, but for now if a relay could work, how about just using that?

    Just one thing, the device the switch is on is 12V DC.

    Does that matter for relays if the controlled power is AC or DC?

    I have a typical 1 channel relay shield right now: http://www.ebay.com/sch/i.html?_odkw=arduino+relay+shield&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xarduino+relay+shield+1.TRS0&_nkw=arduino+relay+shield+1&_sacat=0

     

    However, if you think I better go with the transistor route, I'm for it and thankful either way. I just don't want us to waste our time if the relay solution is simply only less practical way for doing this.

    Again, thanks for all this.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    As I told you before, the transistor is equivalent to the relay. If you should manage 12 VCC use the realy. If you have no time and you already have the relay shield use the relay for the projector. The function is the same, nothing changes at all. But as you have so few time, why don't try to study two hours what I wrote and the link that we got you? Maybe you get more clear ideas instead of trying to copy and paste and nothing else.

     

    Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to balearicdynamics

    I did read the link, I'm trying to understand everything honestly. I posted what I understood above, is it right?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • balearicdynamics
    0 balearicdynamics over 10 years ago in reply to Former Member

    Yes it is correct. As following the schematics and using the relay in the case of the high current (that you already have) I think you don't risk to make damage to the boards. Pay attention to the polarity and make the breadboard circuit then you can try to add the software and test what is working and what is not. If you have a tester, as 4 seconds is already a long time, you can see if the button simulator is pressed simply checking the voltage between the two pins of the signal and GND. When voltage goes to zero, it is sure that the shortcut is done. The same with the relay that you can hear distinct "tick" when the contact is closed.

     

    Let me know your progress. Enrico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify 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