thegoodfellas/blogset-br huggingface dataset:
The most basic kind of input to a microcontroller is the digital, with buttons or switches.Then, there is the analog input, where a certain level of voltage or current is read by the microcontroller and interpreted as a number. The analog to digital converter (ADC) module is responsible for doing this.The wikipedia article about ADC is good enough. LINKAs you may have read on thePIC18 datasheet, our ADC works this way:You have the Tacqt, which is the time used to sample the voltage level, the Tad, which is the time needed to find the value of each bit of the result, which is a 10-bit number. Based on the maximum impedance of the source, you find Tacqt. In the datasheet it recommends 2.5us. Knowing the desired Tacqt, you find the suitable Tad. Or, you can chose a Tad and set Tacqt as zero, so that you manualy put a delay before starting the conversion.The main problems with using the adc are:>> to get a good reading: the best you can do about this is ensuring that the Tacqt is as low as possible but greater then the minimum required, which is lower for lower inpedance source. Using a 1k potentiometer instead of a 10k for instance (try comparing the quality of results), or using a current buffer if necessary. That's becouse you have to ensure that the adc capacitor is fully charged in Tacqt.>> to convert the adc result into the correct real value: after you get the ADC result, you have a binary number, an integer. But you most probably will need to convert it to a real number or at least know which real number that integer is representing. If the result is the integer 0, is the voltage really 0.0V (supposing the analog voltage goes from 0.0 to 5.0V) ? Or if the result is the hex 3FF, is the voltage really 5.0V ? The use of voltage regulators on the ADC circuit and also isolating it from interference and using quality components may help.The LM78XX voltage regulators are very common. LINK for the datasheet.Now, to the program. It gets an adc reading of a potentiometer each 100ms and shows the result on the lcd.The timer0 and its interrupt is used to get the 100ms period.As you program the timer to count the number of instruction cycles, you must find how many instruction cycles makes 100ms, and which minimum prescale value must be used to make this number smaller than 65535 (witch is the maximum count for a 16bit counter/timer).After finding the value from which the timer will start counting (since its interrupt is on overflow), you write the high byte before the low byte, to prevent glitches if the timer is running.The main routine is the timer0 interrupt, which does what we want every 100ms.There's also two functions for the lcd. Their purpose is to get the value in the W byte and show as an hexadecimal.There is also a very low quality video. LINK (my cellphone camera sucks, haha).The files are here: LINK. As always. Hello again,
this time i'll show how to use a keypad.The most basic form of input in a system is digital input through a button. You press the button, the system detects it and respond accordingly.So, as one or two buttons is boring, let's go with 16 (this "method" should work for any number, but 16 is the most common number of keys in a keypad).I'll use the Futurlec's Keypad Mini Board, LINK, as reference design.This "method" for reading the keys is based on a matrix configuration. The buttons are linked in rows and colums.How does it work?The default state of the rows and colums is high (that's why the pull-up resistor's are there), and then you force a line to go low, and look which colum went low. This gives you the coordinate of the pressed button, as the colum will only go low if one of it's button is pressed, and the line you already know (you turned it low).Read the "16keypad.inc" to understand the routine, LINK. But basicaly it consists in turning one row at a time low and looking for which colums went low, and for each button detected as pressed, setting a corresponding bit on a memory register word.One thing you should be aware of is the bouncing effect while pressing and releasing a button.I'm borrowing two images from here, LINK:When you press or release a button, the voltage level doesn't goes high or low immediatly. Instead, it spends some time 'bouncing' between the two states. So, it may occur that your routine for button state detection is fast enough as to try to detect the button state while the boucing is still going on. One way to avoid it is to check the button state more than one time in a small time interval, and only use the result if the two readings are positive for button pressed.So, in my routine, i read the states of all buttons once, and 5ms after i do it again and compare the results. Some recomend 10ms or 20ms, this depends on the button and the level of noise in the system. You can also do more than one re-reading of the button states. This is called "debouncing".Another thing is the simultaneously pressed key detection.My program reads the keypad and shows on the LCD all the keys detected as pressed. But there is a... let's call difficulty. It may detect more keys than are pressed. Why?If you examine the logic of the wiring, you'll see that if you press any 3 keys that happens to be 2 on the same colum and 2 on the same row, a fourth key will be detected as pressed, the one that "closes" the rectangle:The '4', '8' and 'A' key's are detected correctly, but the '6' key is not. That's becouse this kind of configuration of pressed keys gives a route for the electric current to bypass the not-pressed button logic.A simple way to avoid this is using diodes between each button and the colum wire, allowing the current to flow one way but not the
other. Unhappily, you don't find this kind of keypads to buy, so i think you can just ignore the reading result whenever they return positive for more than 3 buttons.Finaly, here are some pics of the working thing (again, sorry for the poor quality, it's my cell phone camera):One key pressed, two keys pressed, three keys that not generates a "difficulty", and three keys generating a difficulty. Nice.One note to conclude this post: these assemblies with jumper wires and breadboards are very noisy. This sucks.
Today we're going to talk about capacitors and inductors. We are not going to talk so much about them because most of times they are used in analog circuits and not on digital circuits. The inductors we use are normally in motors or relays, etc... And we actually don't see it as a common inductor.The reason why they are on the same post is because I don't use them very much so I can't really talk a lot about them.Take a look at these videos from Collin Cunninghan:Capacitors: http://www.youtube.com/watch?v=ZYH9dGl4gUEInductors: http://www.youtube.com/watch?v=STDlCdZnIswSo capacitors are used to store energy, and one good application for that is to remove the noise from a DC power supply. Like this:So this is the basic idea of a power supply. It's divided in this "blocks". The first block is the one which will make the voltage from the wall outlet a bit lower and more useful for our circuits (like if you using an 110v wall outlet, it maybe something like 36v or any other lower voltage). The second block will eliminate the negative part of the signal, which most of times is not needed. The third block will take off this "holes" (the noise) in the signal and it'll be like a straight line which has no noise. The forth block will regulate the signal to the voltages we will need. For example if we need 5v and 3.3v from the same power supply, instead of using 2 transformers, or anything else to regulate that, we can use zener diodes and some transistors or even some nice voltage regulators ics for that.The third block most of times are built with capacitors and inductors.When we connect a crystal to a microcontroller, we need to add some capacitors. They need to be the right values because wrong values will give different oscillation, which should be avoided.Adding capacitors together to get a bigger capacitance value, its a bit different from adding resistors:When we add capacitors in parallel we have a capacitance C equals to the sum of the capacitance of those capacitors. So:Parallel -> C = C1+C2+C3Series -> 1/C = 1/C1 + 1/C2 + 1/C3Well, I never needed to do this, but may be useful for someone else.Take a look at this video using inductors to create an electronic xylophone that plays itself:http://www.youtube.com/watch?v=sR3xmof8rZYWell, there are a lot of advanced things here. We will talk about microcontroller code later. But that shows you a bit of what can be done with inductors and that making your own may be useful for custom design that fits your projects.There is something about that video that will be useful when using transistors with inductors. Look at this schematic:This is the schematic to control a 12v relay to power a 120v lamp. This 2 are the same schematic, but in a simulation where the left one has the lamp off and the other has the lamp on. A relay is the component with the label "RL1" and has an inductor inside of it. So in order to use it with a transistor, we need to use
a diode connected to the relay with inverted orientation, like the schematic. Instead of a switch, we could use the output of a microcontroller or any kind of digital circuit. Relays are good to control high voltage or AC devices like lamps, AC motors, etc. A relay is an electromechanical component, so it means it has some moving parts inside of it... and because of that you should avoid making some fast "on and off" changes... like PWM on that lamp for example. (We will talk about pwm later).Well, if you saw the 3 videos and read everything, you probably know what you'll need to understand next posts.Next time I'll talk about diodes, also I probably not going to talk much about them, but a little bit more. (I believe)Cya next time.
Today we are going to cover a bit of diodes and transistors. You can check these videos from Collin Cunningham:Diodes: http://www.youtube.com/watch?v=AqzYsuTRVRcLEDs: http://www.youtube.com/watch?v=P3PDLsJQcGITransistors: http://www.youtube.com/watch?v=-td7YT-PumsAs Collin says, transistors can be used as amplifiers or switches. In this tutorial we will only cover switches...maybe we cover op-amps in the future, so you can amplify signals more precisely.This is a nice tutorial about diodes: http://www.sparkfun.com/tutorials/212I didn't read much about analog electronics (pretty much because I never had to use it at my projects) and that's why this parts of my posts are a bit small.So you can check Collin's video for history of diodes, leds and transistors if you want to... I'm just going to talk about what you will probably use them for.I didn't know diodes where so useful... but after reading this sparkfun tutorial I liked them a lot. Pretty much everyone that already built something with electronics has worked with LEDs. But I believe a lot of them didn't use it as a diode... just a light source.So diodes "block" current flow in one direction and "allow" it on the other direction... so diodes are used a lot in power supplies. A normal diode has a voltage drop value around 0.7v... that means if you connect it in a 9v signal, it will be around 8.3v at the output. I believe the most common use for diodes in power supplies are the rectifiers. Like this one: So you connect "~" to a AC source and you get a DC source from "+" and "-" terminals... but why that? Look at this picture: So you see this "A" and "B" labels at the bridge rectifier inputs... so when current is positive the current go trough "B" and follows the red mark to the circuit and gets back to the rectifier following again the red path and going away trough "A". When the current is negative, it goes trough "A" and follows the blue path, and after passing the circuit it gets back to the rectifier going away trough "B" following again the blue path. The diodes won't allow the current go from "A" to "B" or "B" to "A" if it doesn't pass the circuit first. So in your circuit you get a wave like that one near "RL" from the AC wave that was the input of the circuit at the left of the bridge rectifier. So, that's cool. Again, LEDs can be used in some applications, not all of them. If not well designed, the LED can fry out. LEDs come in all kinds and colors... there are even infrared LEDs (IR LEDs) which is the one you probably have in any TV/Stereo/etc remote controller. (You can see it if you get a camera on it and press any button of it).LEDs may also be combined in custom displays, like these ones:So you can see here a RGB LED cube, blue LED bargraph, and RGB LED matrix.And a RGB LED strip, RGB LED 7 segment display, and a high power LED. (These guys get like 20W or higher, so they have these
heat sinks on them)Look at these videos:LED globe here.LED propeller clock here.So there a lot of applications where you use LEDs. You need to learn about how to get them working when you want to use it at your project. I'll talk about a few of them in the future (I believe).There are also the zener diodes, which "allow" negative current flow in "one specific voltage". This can be useful if you have a 5v circuit connected to a 3.3v circuit. So you can have a schematic like this:So instead of a 5v signal, the 3.3v circuit is going to "see" a 3.3v signal. There are all sorts of values for the zener diode... so you can find the right one for your application.A Schottky diode is useful when you want to protect your circuit and avoid voltage drops. While a common diode has a voltage drop of 0.7V, a schottky diode has a 0.15 - 0.45 voltage drop.Enough of diodes. So transistors are great too. As I said before, I will not talk about how to use them in an amplifying configuration... just because I don't know how to do it. I never searched for it, and actually never needed to amplify a signal before. But the switch configuration is very useful, and really easy. Take a look at this schematic:So this schematic is basically turning on a LED using NPN transistor or PNP transistor. These resistors limit the current for the transistors and for the LEDs. The transistors are working as switches... the NPN one will let current pass through the arrow direction if there is enough current at the base, while the PNP will "allow it" when there is no current... and that's why you see the PNP switch is closed and the NPN is open. These schematics are not very useful, but it's just to show how the transistors will work in a switch configuration. Also there could be anything at the base, like a microcontroller output pin, that would give 0v or 5v signal, so it was possible to turn on and off the LED. And the LED could be a motor or something like that.Speaking of motors, there is a very popular circuit to handle dc motors... the H-bridge. Look at this:The way a dc motor works is that if you connect it to positive current it will turn one way, if you connect it to negative current, it will turn the other way... so in order to control it we need to change the two terminals of the motor so we can set the proper orientation. In order to make current flow from left to right of the motor's terminals we need to close "transistor one" and "transistor three" and open the others, so current will come from "POWER +" trough "transistor one" and will pass through the motor and go away trough "transistor three" to "POWER -". If we want it to turn the opposite way, we close "transistor four" and "transistor two" and open the others.So that's not that difficult to understand... and
it's very useful. When choosing the transistor for your project, you need to look at its datasheet. Datasheet is like a "manual" which contains like all the info about a component. You can find datasheets on the internet and googling the component's name.For example, if you dealing with motors, you will need some high current transistors, so you need to check the datasheets to find out what is the max current of each of the models available. If you have proteus you can use it to find out info about components. If you go to add a component, and you find the component you want, there is some info on the screen that can be what you searching for. Like in this picture:So you can see that the values at "Description" can be handy to choose a component for you project, and you don't need to see a lot of datasheets to find a nice one for your application. You can search by the contents of description, so you can search for 5A transistors, it will give you all 5A transistors on the proteus library. You can check if they are available in an online electronic components store like digikey, sparkfun, etc.Also, it's good to search on sites like sparkfun and see the components available to see the models they sell, so you do not spend so much time search. For example if I need a common NPN transistor for low power applications, I can see sparkfun sells 2 of it, so I can choose any of them, and get my order.Sparkfun doesn't sell high current transistors... so for this kind of specific analog circuits you probably will need to go to digikey or ebay. It's easy to find things on ebay... you may prefer that than digikey.So, I believe it's all for this time. You can try checking more about transistors and diodes and anything I talked about already on the web.Next time I'll talk about an integrated circuit and logic ports.Cya
de sentir algo de forma consciente]. Nao sao osanimais, nem os grandes primatas objeto de exposicao como obra de arte criadapelo homem, afirmou.O santuario de Sorocaba foicriado no ano 2000. E o primeiro e o maior dos quatro santuarios filiados aoProjeto Grandes Primatas (GAP) no Brasil, iniciado por Pedro Ynterian. O GAP euma iniciativa internacional que defende o direito de os grandes primatasviverem em liberdade no habitat deles. A equipe do santuario tem duasveterinarias e 20 tratadores. Alem de mais de 50 chimpanzes, outros 250animais, entre felinos, ursos e aves, vivem no local.Com informacoes da Agencia Br para o site Redecol Brasil
obras de duplicacao da rodovia estao paradas. A previsaoestabelecida em contrato de concessao previa que toda a extensao da BR 040entre Brasilia e Juiz de Fora/MG seria duplicada ate 2018, o que certamente naosera cumprido. E mesmo sem obras de duplicacao, os motoristas sao obrigados atransitar por uma rodovia extremamente perigosa, pagando altas taxas de pedagioe sem perspectiva de melhorias.No pior dos cenarios, devido aconjuntura atual da economia, as dificuldades de credito junto ao BNDES e asrevelacoes feitas pela operacao Lava Jato, varias concessoes de rodoviasfederais estao em risco e em pouco tempo o governo pode retomar o controledessas estradas, acarretando em mais prejuizos a populacao.Com informacoes daASCOM/Prefeitura de Cristalina e edicao Redecol Brasil
de pagar a altas mensalidades de Tv por assinatura. Hoje, o preco de uma antena parabolica varia entre R$ 250,00 e R$ 300,00 sendo a Century e a Cromus as marcas mais populares. Se voce quer comprar ou ja tem uma antena parabolica e quer saber a lista de todos os canais de TV disponiveis, entao veja abaixo a relacao de todos os canais atualizados em abril de 2017: No do Canal Polarizacao Frequencia* Canal 1 H 1430 Globo (Nacional) 2 V 1416 SBT (Nacional) 3 H 1400 TV Brasil (Nacional) 4 H 1380 TV Escola 5 V 1380 Ultra Farma TV 6 H 1360 Terra Viva 7 V 1360 RedeTV! (Nacional) 8 H 1340 Band (Nacional) 9 H 1320 TV E-Parana 10 H 1300 Polishop TV 11 V 1296 Record (Nacional) 12 H 1260 Rede Vida 13 H 1240 Rede 21 + TV Igreja Mundial 14 H 1280 Canal do Boi 15 H 1220 Claro TV Promo/Clube Disney 16 H 1140 Ideal TV 17 V 1140 RIT 18 H 1120 TV Aparecida 19 V 1120 NBR 20 H 1100 Novo Canal 21 V 1080 Cancao Nova 22 H 1080 CJC (Canal Juventude Crista) 23 H 1060 TV Camara 24 V 1060 Conexao BR 25 H 1040 Gazeta SP 26 V 1040 Shoptime 27 H 1020 TV Senado 28 V 1020 TV Novo Tempo 29 H 1000 TV Seculo 21 30 V 1000 Rede Familia 31 H 980 Canal Rural (*) A frequencia de audio padrao e de 5.80 ou 580 MHz.(**) Frequencias em Banda L correspondente da Banda C.Veja abaixo as emissoras de radio disponiveis atualmente na antena parabolica analogica:CanalPolarizacaoFrequenciaAudioRadio Rural AMH9806.20Radio SenadoH10206.20Radio CamaraH10606.20Radio Cancao Nova AMV10806.36Radio AparecidaH11205.55/6.20Radio Boa NovaH12806.20Radio Parana Educativa FMH13206.20Radio NacionalH13805.55/6.20Radio MECH14005.55/6.10Globo SAPH14307.40Clique aqui para ver a frequencia e polarizacao de cada estacao.
Agropecuarios diz que apoia a acao da PoliciaFederal. "A operacao esta alinhada aos objetivos de auditores fiscais federais agropecuariosno sentido de aprimorar a inspecao de produtos de origem animal noBrasil". Segundo o sindicato, as denuncias constam de processoadministrativo que tramita no Ministerio da Agricultura desde 2010.Ministerio afasta 33 servidores O secretario executivo doMinisterio da Agricultura Pecuaria e Abastecimento, Eumar Novaki, disse hoje(17/03) que as fraudes no processamento de carnes por algumas das maioresempesas do ramo alimenticio do pais, como JBS, BRF e Peccin, identificadas pelaOperacao Carne Fraca, sao um fato isolado e que os consumidores podem ficartranquilos.Segundo o secretario, 33servidores do orgao ja foram afastados. De acordo com Novaki, a maquiagem deprodutos vencidos foi verificada em carne de frango, mortadela, salsicha e ha asuspeita de carne bovina. A fraude foi confirmada na unidade da BRF da cidade deMineiros (GO) e nos frigorificos de Jaguara do Sul (SC) e Curitiba, da empresaPeccin Agroindustrial. Os tres estabelecimentos foram fechados pelo Ministerioda Agricultura e passarao por inspecao rigorosa.Sao 21 SIFs [Servico deInspecao Federal], de quatro grupos economicos, de um universo de 5 milestabelecimentos. Isso demonstra que nao e um fato cotidiano, mas um fatoisolado, que nao representa, de modo algum, a postura do Ministerio daAgricultura, afirmou Novaki. Segundo o secretario, em ate 15 dias, oministerio apresentara um diagnostico preciso sobre os produtoscomercializados pelas empresas investigadas.Mesmo afirmando que osconsumidores podem ficar tranquilos quanto a procedencia dos produtos, osecretario recomendou que a populacao fique atenta a possiveis sinais de maconservacao. De acordo com Novaki, oministerio esta atuando para identificar e retirar do mercado lotes de produtosadulterados. O queremos dizer para apopulacao e que fique absolutamente tranquila. Nosso sistema de fiscalizacao eum dos mais respeitados do mundo. Se perceberem qualquer problema, comuniquemao Ministerio da Agricultura, que tomaremos a providencias.ExportacoesPerguntado sobre o possivelimpacto nas exportacoes, ja que o Brasil e o principal exportador de carne domundo, o secretario executivo do Ministerio da Agricultura disse que os paisescompradores tambem fiscalizam os produtos. Alem disso, Novaki reiterou que osfatos isolados nao podem comprometer toda a cadeia.Os produtos brasileiros estaopresentes em mais de 150 paises, e isso demonstra a qualidade dos produtosproduzidos no pais. Cada um dos paises tem seu sistema de vigilancia que atestaos produtos quando la chegam. Portanto, se tiver problema, isso sera acionado esera resolvido, e aquilo nao sera entregue.Com informacoes da AgenciaBrasil e Sistema Redecol Brasil de Comunicacao