I would like to know if someone met the same problem on Arduino board. Know if there is a solution ?
My Arduino board has only 1 month. The pin 0 worked well before. I don't know if it's possible to "burn" a pin. (ex : use a too high voltage ? )
Output A0 connected to 5V Output A1 connected to V
On the screenshots you provided it shows the value on the pin, so technically speaking your analogRead has no problems. Check the link and connections. But regarding your question - yes, you can burn pin and even board with high voltage, so don't forget resistance when it's needed.
Also good practice to use arduino macro for analog pins like analogRead(A0); which is perfectly fine for arduino
Your screenshots show that the values read from A0 are changing (190 first, 300 second). That suggests that the problem lies in the electrical connection. Try to resolder the A0 connector pin, and possibly appropriate pin of the microcontroller. Check if the path leading from the connector to microcontroller pin is not cut somewhere.
Related
I have custom board on which I can upload my code generated from platformio and as board bluepill_f103c8. And I can make led blink etc. but when I want to do analogRead it always returns 0.
I'm trying to read from PA8 pin.
In my setup I put that pin as INPUT_ANALOG, do I need to do something else in order to get the reading?
Voltage that's on pin is about 0.25V that I'm trying to read.
According to STM32F103 Datasheet, page 34, any of 3 onboard ADCs simply do not have the ability to connect to PA8. PA8 can only work as simple GPIO (default, reads only 0 and 1), or as USART1_CK, TIM1_CH1, MCO in alternative configuration.
Arduino can use it as PWM output, or software USART, but there is no way to get analog reading from it.
If you really need to read analog voltage coming to that line, you would have to modify your board and solder PA8 to one of PA0..PA7, PB0..PB1, PC0..PC5 and re-configure ADC to read from that line.
#TonoNam, regarding your problem: unless PA1 is permanently damaged, it is fully capable of working with ADC, so there is something wrong with initialization or reading procedure.
Reference the pinout diagram here https://wiki.stm32duino.com/index.php?title=File:Bluepillpinout.gif
analogRead will only work with the pins which have associated ADC channels.
So this is PA0 through PA7, and then PB0 and PB1, so I guess this is your issue.
Looks like PA8 is a PWM output.
I have a GSM shield V2 for Arduino, and I want some buzzer to make some noise when there is an incoming call. At this link http://www.thaieasyelec.net/archives/Manual/M10_HD_V1.00.pdf page 44 I found that by connecting a simple transistor and a buzzer to the actual "buzzer" pin I should be able to produce sound. I tried and that does not work as expected, all I get is noise from the GND of the shield, that typical GSM noise that everyone know of.
I also tried to connect another arduino as to analog read the buzzer signal, but I get nothing that look like a ringing tone.
Has anyone any idea? Did I forget to setup some things software wise? So far it seems that the buzzer behaviour is completely unrelated to anything code wise, there is just that "buzzer" pin, and that's it, nothing more to set up.
Any help would be much appreciated !
Cheers
Here's a great beeper/alarm part I've used in a couple of recent projects. It is loud but can be muffled. It's self-driving, so all you have to do it supply it enough current at its rated voltage, like through a transistor or Darlington. It has a wide voltage range, and runs great from 3.3V up to 20, So it's ideal for microcontroller projects at 3.3V or 5V. No need to fiddle with timers or PWM to make it beep. Try out this great part.. Drive it from any output pin to a small-signal transistor with a beta of 50 or better and you'll be good to go. Turn output pin on, it starts. Turn output pin off, it stops. I made mine "chirp" like the alarm on a car security system. Easiest thing in the world.
I'm currently working on a project involving a GPRS Shield based on Sim 900 Chip
I was wondering if anyone would know which ones are the VIN Pin and the RING pin ?
It doesn't say on the board itself and all other searches have lead me to a dead end.
Also if you have a detailed pin layout it would be much appreciated.
Thank you
The GPRS shield is the one in the link below
http://imgur.com/a/1a2gx
Ring Pin
If you have a Multimeter with continuity testing, check where the RI pin (#4) on the Sim 900 chip is broken out to. Here is an overview of the pins:
If it isn't (some shields don't have them broken out) you could solder a wire to the RI pin with an LED and resistor to Ground, something like this:
[RI Pin]--------[wire]--------[LED]--------[Resistor (330Ohms?)]--------[Ground]
The ring indicator is HIGH by default and LOW when there is an incoming call. So, when there is no call the LED is on and off when there is an incoming call.
VIN
When the position of the switch (middle left in the image below) is set to "extern" (right), you have to supply power to the barrel connector. When you set the switch to the left position, the module takes power from the 5V pin of the arduino OR (dont attach both!) an external power supply you attach to that pin.
Hope it helps :)
PS: These SIM modules can have current peaks up to 2 Amps. I recommend you to use an external power source that can provide minimum 2A at 5V.
Edit:
This might be helpful:
http://wiki.seeed.cc/GPRS_Shield_v1.0/. I think its the same module as yours. Have a look at the "GPRS Shield v1.4 Schematic" at the bottom of the page.
Edit 2:
Comparing the board from the link and yours, i'm very certain that the ring pin is the one marked in red in the image above. Checking with a multimeter doesnt hurt though. You can add the same circuit i described above to that pin to add an LED indicator.
When we upload the code on arduino ,sometimes we do not get the desired results.
I saw a friend of mine doing the test on arduino using a multimeter to make sure that the code is right.
He said that we can make sure the code is right by checking the voltages on carious i/o pins on arduino. Like if the voltage on i/o pins is less than 5 V then the code is having some error,and also if we chckt the voltage on RX and Tx pins it should be 0.29 V.
I know question posted by me is not clear, but this is something which worked but i was not able to understand it properly.
So if anybody can deduce what this means and how it is done so, please proide an answer?
There are two main things to test with your multimeter: the voltage of the power to the Arduino (between 5v and Gnd), and the voltage of the IO pins (between them and Gnd).
Voltage of the power supply simply tells you if the Arduino is powered up correctly, if its power management circuits or power supply have failed, you'll be able to pick it up here.
Voltage of the outputs should be either 5v or 0v, relative to ground. By testing the voltage on a pin you can tell whether it is being written high (5v) or low (0v) by the Arduino, hence seeing what the code is doing to the pins.
I should make it clear that there is no right or wrong way to tell if the code in general is working based on the voltage of the pins.
I have a CO2 sensor with 4 pins. VCC, DOUT,AOUT, GND. Where does the VCC, AOUT, and DOUT wire to? I found no wiring manual when I purchased this sensor off of ebay. I have gone to this link where someone is using the same sensor. However, I don't follow his path considering the third pin (red) isnt going anywhere. It just leads out and stops. http://middlewaresensing.files.wordpress.com/2010/08/100708144455.png
Can anyone spell it out for me clearly for me please?
GND - wires to GROUND
Vcc - Wires to ?
AOUT - Wires to?
DOUT - Wires to?
GND -> negative
VCC -> positive (voltage/current depends on sensor)
AOUT -> analogOut, goes to a analogInput if you want to read the sensor that way. Pay attention that arduino can read at max AREF volt, by default AREF = AVCC = VCC = 5V (please note, taht is vcc of arduino, not of the sensor)
DOUT -> digitalOut, goes to a pin depending on protocol used, because it is one wire, it can be something like "OneWire",
Voltage and current needed by VCC, and voltage/current ouputted by AOUT and protocol used by DOUT can be extrapolated only by datasheet.
Please note on image he use a arduino nano that exista at 3.3V and 5V, also seems wrong as these kind of sensor normally use a lot of current, witch arduino alone cannot supply
Since it is a MG811, a bit of google search give that tutorial: http://sandboxelectronics.com/?p=147