Author Topic: Noob questions about basic electronics  (Read 3088 times)

gladoscc

  • Newbie
  • *
  • Posts: 4
Noob questions about basic electronics
« on: December 16, 2014, 11:13:57 pm »
Q1: I have one of the push buttons that has 4 pins. I've tried hooking it up to the Digispark Pro and reading it, however when I press down on the button the Digispark resets (I can see the connected OLED screen reset). It's connected like this (substitute the uno for a digispark, of course):



Why is it resetting?

Q2: I have one of this microphones and I understand I'll need to use an amplifier to read from them. However, how does this component actually work? Does the sounds in the air change the resistance of the microphone? With 2 pins, one should be current and one should be ground right? How can information be transferred?



--

These questions are a bit noob, sorry. Thanks in advance :)

DeuxVis

  • Full Member
  • ***
  • Posts: 107
Re: Noob questions about basic electronics
« Reply #1 on: December 17, 2014, 01:33:00 am »
1) If get the legs distribution of that button right, you are sending 5V straight to pin 2 when you press it - maybe that "shortcut" is trigerring a reset ?

2) I am not absolutely confident with my understanding of a microphone so I'll quote Charles Platt "Make: More Electronics" book which I recommend along with the previous "Make : Electronics" if you are starting hobby electronics - see attached screenshot.

So basically the microphone generate a - tiny - audio signal : current - or I presume more accurately, voltage - varying over time to represent the sound waves.
You cannot use that as an "instant reading" sensor like a potentiometer : it's the variation over time that matters.
« Last Edit: December 17, 2014, 01:37:57 am by DeuxVis »

gladoscc

  • Newbie
  • *
  • Posts: 4
Re: Noob questions about basic electronics
« Reply #2 on: December 17, 2014, 02:04:49 am »
Hi DeuxVis,

Thanks for the response!

Re (1), I'm sending it to pin 4, year. Is sending 5V to an input pin a problem?

(2) I'm trying to grasp how the current flows? Does it actually output the current / voltage so it can be amplified and read with an input pin? But wouldn't that current need to flow to the ground.. so does the microcontroller pins all hook into ground if it's set to the input mode?

Thanks again!

DeuxVis

  • Full Member
  • ***
  • Posts: 107
Re: Noob questions about basic electronics
« Reply #3 on: December 18, 2014, 05:40:35 am »
1) It's not the 5V that is a problem directly on a Pin, it's the amount of current - here you are not limiting the current (amperes) and I believe it is what trigger the reset. You could actually damage a lot of components by putting an unlimited current through it.

To limit the current add a resistor - say 1kOhms - in series with the pin, for instance between the pin and the switch.

2) I think you got it right, but the microphone output is too feeble to be read directly by the 'spark.

See here for an example circuit that use a LM386 amplifier (a little chip) to boost the microphone signal to a level an arduino can read : http://www.learningaboutelectronics.com/Articles/Sound-detector-circuit.php
Note : just got that out of a googling session, not tested it myself.

There might be simpler circuits, maybe using a simple transistor to do the amplification.