What the official arduino site with code and tutorials? - Page 1
Forum section: electronics / general

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 01:13:42 am
content: This awesome sanesmart arduino kit just made the arduino really hot (the transistor package part next to the DC input plug with three pins on the botom and a tab on the top). Best part is the notes in the code are still in chinese and the instructions tell you two different way to hook it up. Any way to tell if the IR sensor was damaged?Heres the tutorial with code:QuoteQuoteThe lack of effort these companies put into their products is disgusting. Luckily I took this product back and bought the microcenter version, but it doesnt contain any tutorials.

author: ataradov
author_rank: Super Contributor
timestamp: March 06, 2017, 02:29:47 am
content: Both arduino.org and arduino.cc are official sites.Voltage regulator getting hot means a short on the power supply. You did something wrong assembling your circuit. It is impossible to say what is wrong without knowing what exactly you have assembled.

author: ataradov
author_rank: Super Contributor
timestamp: March 06, 2017, 02:30:57 am
content: Those are knock-off products. It is like buying a bootleg DVD and complaining about quality of picture. There is a reason those things are cheap.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 02:43:57 am
content: Quote from: ataradov on March 06, 2017, 02:30:57 amUnfortunately I did not know that when I bought it. I had to rely on the salesman because I cant see very well. Wasn't cheap either.

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2017, 04:56:13 am
content: Code:#define IR_IN 8 // IR receiveInt Pulse_Width = 0; // store pulse widthInt ir_code = 0x00; // user code valueChar adrL_code = 0x00; // command codeChar adrH_code = 0x00; // command code anti-codeVoid timer1_init (void) // timer initialization function{TCCR1A = 0X00;TCCR1B = 0X05; // Give the timer clock sourceTCCR1C = 0X00;TCNT1 = 0X00;TIMSK1 = 0X00; // Disable timer overflow interrupt}Void remote_deal (void) // Executes the decoding result function{ //Data DisplaySerial.println (ir_code, HEX); // hexadecimal displaySerial.println (adrL_code, HEX); // hexadecimal display}Char logic_value () // Determines logical values ??"0" and "1" sub-functions{TCNT1 = 0X00;While (! (DigitalRead (IR_IN))); // low waitPulse_Width = TCNT1;TCNT1 = 0;If (Pulse_Width> = 7 && Pulse_Width <= 10) // low level 560us{While (digitalRead (IR_IN)); // is high waitingPulse_Width = TCNT1;TCNT1 = 0;If (Pulse_Width> = 7 && Pulse_Width <= 10) // then high level 560usReturn 0;Else if (Pulse_Width> = 25 && Pulse_Width <= 27) // then high level 1.7msReturn 1;}Return -1;}Void pulse_deal () // Receive address code and command code pulse function{Int i;Int jIr_code = 0x00; // clearAdrL_code = 0x00; // clearAdrH_code = 0x00; // clear// parse the user code value in the remote control codeFor (i = 0; i <16; i ++){If (logic_value () == 1) // is 1Ir_code | = (1 << i); // save the key}// parse the command code in the remote control codeFor (i = 0; i <8; i ++){If (logic_value () == 1) // is 1AdrL_code | = (1 << i); // save the key}// parse the code in the remote control codeFor (j = 0; j <8; j ++){If (logic_value () == 1) // is 1AdrH_code | = (1 << j); // save the key}}Void remote_decode (void) // Decode function{TCNT1 = 0X00;While (digitalRead (IR_IN)) // is high waiting{If (TCNT1> = 1563) // When the high level lasts longer than 100ms, it means that there is no key press at this time{Ir_code = 0x00ff; // user code valueAdrL_code = 0x00; // key before the value of a byteAdrH_code = 0x00; // key after a byte valueReturn;}}// If the high level lasts no more than 100msTCNT1 = 0X00;While (! (DigitalRead (IR_IN))); // low waitPulse_Width = TCNT1;TCNT1 = 0;If (Pulse_Width> = 140 && Pulse_Width <= 141) // 9ms{While (digitalRead (IR_IN)); // is high waitingPulse_Width = TCNT1;TCNT1 = 0;If (Pulse_Width> = 68 && Pulse_Width <= 72) // 4.5ms{Pulse_deal ();Return;}Else if (Pulse_Width> = 34 && Pulse_Width <= 36) // 2.25ms{While (! (DigitalRead (IR_IN))); // low waitPulse_Width = TCNT1;TCNT1 = 0;If (Pulse_Width> = 7 && Pulse_Width <= 10) // 560us{Return;}}}}Void setup (){Serial.begin (9600);PinMode (IR_IN, INPUT); // set the infrared receive pin as inputSerial.flush ();}Void loop (){Timer1_init (); // timer initializationWhile (1){Remote_decode (); // decodeRemote_deal (); // execute the decoding result}}There is absolutely nothing in that code that could account for the regulator overheating. The only Arduino pin configured as an output is the serial TX pin, and that couldn't account for more than 50mA draw even if you'd shorted it, and only a few mA in normal operation.Five possibilities exist (IMHO most probable first):You've hooked up the IR sensor wrong (e.g. reversed the supply pins) so its drawing excessive current from the 5V rail..You've applied an excessive voltage to the DC in jack or Vin. Although the regulator can withstand up to 20V abs. max in and is nominally rated at 800mA, its thermal resistance to ambient with the amount of copper area on the official Uno board is something like 85 °C/W (They f--ked it up and didn't give it enough copper area, or enough vias to get the heat to the bottom). Tj_max is 150 °C. Assuming 60 °C 'ambient' near that part of the board, (not unreasonable if its in a case or the 5V rail is heavily loaded), that means its only good for about a watt before thermal shutdown, half that for reliable operation*. That puts an upper limit on the load current of 250mA @9V in or 140mA @12V in, which doesn't leave much for any shields etc. as the UNO draws about 50mA from the 5V rail. TLDR: At 12V in the regulator will over-heat if you draw more than about 30mA extra from the 5V or 3.3V rails..You've blown the regulator (reverse bias) by powering it via the 5V pin and shorted the Vin pin to Gnd..Sainsmart used a crappy clone regulator that has failed..Sainsmart f--ked up the layout or the regulator decoupling caops and its oscillating under load.* Opinions differ - SeeArduino UNO regulator capacity? - Arduino ForumWhat to do?Disconnect everything, power the board from USB and try the Arduino IDE examples 01. Basics: Blink sketch. If the LED doesn't blink its FUBARed. Then disconnect the USB, apply 12V (+/-1V) to the DC power jack, and check it still blinks without the regulator overheating. Then add a 150R resistor from +5V to Gnd to draw 33.3mA - the regulator should now be running warm but shouldn't overheat. Check the 5V rail. If its below 4.9V the regulator's probably bad.Regulator replacement is possible if the UNO still runs from USB, if you can solder well enough and have a decent iron.If it doesn't run from USB, its BER.You can test the IR receiver (which is probably a TSOP38xx) or similar , without the Arduino by hooking it up to a 5.0V supply with a LED (cathode to out) + 1K series resistor between its output and +5V. The LED should be normally off and blink when it is receiving an IR signal. Its idle supply current shoud be <0.5mA. If the LED doesn't blink, or its drawing excessive current, you've blown it!

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 08:59:26 am
content: Just hooked up the temperature sensor exactly the way this tutorial said. One minute later smoke started poring out of the temperature sensor.That sucks I was actually going to make something with this sensor.Hooked up to 5V and ground. Arduino is running off usb power.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 09:07:57 am
content: Quote from: Ian.M on March 06, 2017, 04:56:13 amI did hook the ir receiver up like that. Put an led and a resistor on the negative pin, +5 on positive pin. It lights up. I tried hooking the led to the center out pin to ground and pointing a remote at it but I didnt see it coming on.I did run the fading LED example from the arduino library and it worked fine so seems to be OK.

author: ataradov
author_rank: Super Contributor
timestamp: March 06, 2017, 09:12:48 am
content: Quote from: raspberrypi on March 06, 2017, 08:59:26 amWell, this pin out does not match the standard one, and the one that is mentioned in the "Chapter16 Infrared remote control"Nevermind, you are now talking about temperature sensor.Can you show pictures of your setup?

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2017, 09:27:35 am
content: If its a LM35 analog temperature sensor it will work as shown in fig 12.3 of the Sainsmart tutorial, but if you have a DS18S20 digital temperature sensor and connect it like that it will let the holy smoke out as its +supply and ground pins are the opposite way round. Also many TO92 transistors would smoke if you mistook them for a LM35.If you are having problems with distinguishing small faint component markings, maybe consider a hand-held USB microscope, with LED illumination so you can get a well lit and very large view of the component on your PC screen.Quote from: raspberrypi on March 06, 2017, 09:07:57 amErrr NO. The IR sensor needs Gnd on its middle leg, and with the lens 'bump facing you and the legs down, 5V on the righthand pin. The lefthand pin is the output that goes LOW when it receives an IR signal, so connecting the LED between there and Gnd wont help you much, especially since its a lot harder to see if a LED briefly flickers off instead of wiring it so it flashes on.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 11:21:26 am
content: Quote from: Ian.M on March 06, 2017, 09:27:35 amI made this:I wonder if those USB micro scope will work with a raspberrypi. Then I could have a dedicated monitor on all the time.

author: legacy
author_rank: Super Contributor
timestamp: March 06, 2017, 11:35:52 am
content: Arduino as forum is a shitty place. Sorry, it's what I believe.Low quality in technical answers plus the attitude of promoting xenophobic attitudesSomeone there also believe s/he is in the "upper class", therefore s/he is allowed to insultand a lot of guys are on "fuck off idiot, you must know C++, it's a MUST"I won't suggest you to go there.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 06, 2017, 12:02:08 pm
content: Quote from: legacy on March 06, 2017, 11:35:52 amThanks for the advice. Thats why I like this board. I always get a laugh when people try to show off on these technical forums that have a beginners section. You know in real life they are complete losers who didnt lose their virginity until the age of 25, then put a ring on the finger of the first girl desperate enough to fuck them. If you have to show off on the internet its for a reason. They remind me of high school. The nerdy kids hated me because I was usually right (and I would rub it in so bad) and they were supposed to be the nerds. They also would always try to ask out my girl friends. So much to the point I told one of my girl friends(I had two) to lead them on, have them bring her out to dinner, then half way through I would show up and sit at the table and act as if they weren't there because she had an hour glass figure and DD cups. So I kind of already had my revenge on those people. The closest thing they will get to an hour glass figure is a 1/4 watt resistor, or a mail order bride.

author: Ian.M
author_rank: Super Contributor
timestamp: March 06, 2017, 01:29:11 pm
content: Should have worked except the resistor MUST be 1K not the 100R illustrated as the TSOP382xx output transistor is only rated for 5mA abs. max.Also I said 5V supply, testing at a lower voltage may conceal prior damage.If the LED resistor was 1K, your IR sensor probably died earlier when the Arduino regulator got hot, and connecting it to a 5V bench supply let it draw too much current and incinerated its corpse!The Pi as a bench webcam server is an interesting idea, however there are three strikes against it:Finding one with a known chipset with a Linux driver will be difficult, except by gambling by buying and trying.If it has software controlled lighting, turning it on from LINUX may be impossible without reverse engineering the Windows utility.The Pi's single USB root hub, shared with nearly all its I/O and low processor MIPS is likely to severely limit the max framerate, making the video very jerkyHowever, others have had good results:https://blog.adafruit.com/2013/04/19/sweet-usb-microscope-works-great-with-raspberry-pi-on-bus-power-piday-raspberrypi-raspberry_pi/Add a compact removable ring light built with 3mm white LEDs, sanded to diffuse them, run in series off a separate adjustable current LED string driver and it could be excellent.If your bench monitor has a composite in, take a look athttp://www.romanblack.com/VGA_microscope/VGAmic.htmand leave out the VGA converter board. Its not as high magnification as the USB microscopes, but as you wont have software zoom control that's probably not a bad thing.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 08, 2017, 03:59:55 am
content: The IR sensor works (even with 100resistor; I built it before seeing that post, and ran it from 3.3v to about 12v using my new diy variable power supply).Is there a way to test the temperature sensor? The smoke was from a USB cable it was touching and has no visible damage. I have had alot of components I have over heated the shit out of and they still work, how long I dont know but work well enough to play with.

author: ataradov
author_rank: Super Contributor
timestamp: March 08, 2017, 04:05:27 am
content: Quote from: raspberrypi on March 08, 2017, 03:59:55 amApply supply voltage and measure the voltage between the ground and Vout. There is formula in their wiki that tells how to translate that voltage into a temperature reading.Quote from: raspberrypi on March 08, 2017, 03:59:55 amThis is not the best attitude to take.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 08, 2017, 08:20:47 am
content: Quote from: ataradov on March 08, 2017, 04:05:27 amWhos wiki?

author: ataradov
author_rank: Super Contributor
timestamp: March 08, 2017, 08:22:13 am
content: Quote from: raspberrypi on March 08, 2017, 08:20:47 amhttp://wiki.sainsmart.com/index.php/Chapter11_LM35_temperature_sensorI'm sure LM35 datasheet has all this information as well.

author: raspberrypi
author_rank: Frequent Contributor
timestamp: March 09, 2017, 09:44:31 pm
content: Quote from: ataradov on March 08, 2017, 08:22:13 amI tend to stay away from these because the english is quite poor and most times just causes more confusion then when you started. This is one of the better translations, but still piss poor. You spend more time trying to translate the chinglish then learning,Quote

author: ataradov
author_rank: Super Contributor
timestamp: March 09, 2017, 09:45:59 pm
content: Quote from: raspberrypi on March 09, 2017, 09:44:31 pmThat's up to you. I personally take any information I can get in any language available.