Yes... ... ... And also what these days do to you - well certainly to me. If you can relate to it - that was the point I was at - "you've grubbed-around, have seen some of the concepts and learned some of the words - now look up and outwards and step clear because you cannot do this to yourself".
---------------------------------
Have you ever studied a foreign language? At first it's totally unfamiliar and mysterious but after two weeks or so of "drinking from the fire hose" it starts to make sense and you have developed a mental filing system to associate and store new words and concepts.
My first year French class was conducted entirely in French for the first few weeks, the Total Immersion system, and it did work for us.
formatting link
Once you have learned one communications system picking up others will be much easier, since you have seen the problems and a solution to them. Modern tech is very much computers communicating with each other, as in a car, and the Internet of Things.
formatting link
Actually the Air Force began it in the early 60's with a network for parts order control that soon grew into the secure global computer data network I maintained in the early 1970s, when hard drives were the size of washing machines. Teletypes had been interconnected much earlier but without computers. The terminals themselves automatically exchanged information about their status.
This is an unclassified description of an earlier system:
formatting link
compression technique works quite well in a properly tuned system, and gives a data rate below the upper frequency range of the transmitted voice. Did you know that most of what you say is random white noise?
The DEW Line of the 1950's was the first big attempt to network computers, to send radar data from remote northern stations over phone lines to interception control centers. No single company understood radar and computers and communications, and the non-profit civilian Mitre Corporation was the result of several less successful attempts to define and manage the large systems engineering. The academics who had contributed to defeating the Nazis were less interested in fighting the Communists.
Didn't find your answer? Ask the community — no account required.
J
Jim Wilkins
Yes... ... ... And also what these days do to you - well certainly to me. If you can relate to it - that was the point I was at - "you've grubbed-around, have seen some of the concepts and learned some of the words - now look up and outwards and step clear because you cannot do this to yourself".
-----------------------------------
For me the second exposure to a subject was easier. In night school in the
90's I aced the math and engineering courses I had struggled with in the
60's.
Partly that may have been due to the nature of university life in the 60's.
J
James Waldby
The webpage pictures and your problem descriptions aren't clear enough or specific enough for definitive help. Explicit wiring diagrams and complete code listings are needed, as well as context like Arduino IDE version number.
formatting link
may be of help if you can fully explain what you wired up and give a minimum-working-example for the problem,
I suggest that when getting started, you first navigate to the Blink sketch (run Arduino, then File / Examples / Basics / Blink) and compile it and download it. Then, to verify you are able to make and install program changes, copy it to a directory of your own with a new name, eg Blink2, and try a few simple changes, like substituting 13 in place of LED_BUILTIN, or 400 in place of 1000, etc. and download again. If you want to try an external LED, connect it to some other IO pin (not D13) with eg a 2K resistor, put that IO number into your Blink2, test it, etc.
Then, if you are working with a program like DigitalInputPullup, connect a switch between an IO pin and Gnd, say D2 and ground, per .png-image schematics in examples/02.Digital/DigitalInputPullup . When you download the program to the Uno and it starts running, setup() will be called, which will set up serial IO and pinModes for D2 and D13. The pinMode(2, INPUT_PULLUP) statement places D2 into input mode with a pullup resistor to V+ (say 5V). That is, if D2 is in the INPUT_PULLUP state, an internal resistor like 35K ohms (RPU min
20K, max 50K per spec sheet) is connected between V+ and D2, which means that if you leave D2 open, D2 will sit at V+; or if you connect D2 to ground, after transients settle (~1us) D2 will sit at 0V, and some number of uA, eg 5/35000 A ~ 143 uA, will flow through the pullup resistor. You can measure that current by hooking an ammeter between the pin and ground if you want to calculate pullup resistance. If the current's really high or is zero the pin's not in INPUT_PULLUP mode. If you have an external pullup and turn on INPUT_PULLUP, the effective pullup resistance is the two resistors in parallel. If your external resistor is a pulldown (connected to Gnd instead of V+) the open-pin voltage [open aside from pull resistors] will be that of a resistor divider, instead of 0 or V+.
Re the I2C problem with your MCP9600 breakout board - Again, wiring diagrams and code listings are needed for diagnosis. One comment: You could write an if statement to try both addresses, 0x66 and 0x67, mentioned in the Pimoroni page, or a loop to try the whole range
0x60-0x67, proceeding ahead when a ready-test succeeds. Or, for simpler programming you could make a program with one address, download and test it, then change it for each possible address until successful. The I2C fails I've seen were due to wrong addresses, miswiring, bad chips, or in one case wires longer than a few feet.
Setting an open IO to low or high output like that is one approach, but on the Arduino Uno a simpler / less risky approach is to set pinMode to INPUT_PULLUP. Note, ATmega328P microcontroller chip hardware as on an Uno sets all IO pins to INPUT during Reset, but boot firmware changes the modes of some pins like D0, D1, D13 as per eg
formatting link
One can do a lot with indicator LEDs attached to several outputs. You can connect a resistor in series with an LED between an IO pin and ground or 5V. Eg, a 3.5V LED with a 1.5K resistor will draw 1 mA, either when the pin is low if series is between 5V and pin, or when the pin is high if series is between Gnd and pin. ( 0.001 A = (5V-3.5V)/1500 ohms.) Or, because modern LEDs light up ok (visible but not annoyingly bright) with a few microamps, you can connect an LED between an IO pin and Gnd; turn it on with perhaps 43 uA, ie (5V-3.5V)/35000 ohms, when you set pinMode to INPUT_PULLUP; turn it off by setting pinMode to INPUT. Note, outputting debug data via the serial port also is easy to do with Arduino.
If you are uncertain how much electronics work you'll do, or have to really economize, an item like
formatting link
($37) would get you at least basic scope function, making it possible to see switch bounce, PWM sequences, and other low frequency stuff. For a hundred or two more, you can get a 50MHz 2 channel scope like previously mentioned, a big step up. If you're into micros for the long term, go ahead and get a medium cost 4 channel 100MHz or 200MHz scope, somewhere between $300 and $800. Scopes in that range often have an input to accept data from optional add-on logic analyzer modules, adding 8 or more 0-1 inputs, and often have builtin protocol analyzers. Eg, besides displaying an I2C waveform they show its data content as text on the screen.
It's mostly switch bounce, not noise. On some switches bounce will be over within just a few milliseconds (ms), on others it can be dozens of ms. With search terms = arduino debounce, you can find code examples plus simple switch or switch+resistor circuits, and may also see pages like below with more-complex Schmitt trigger hardware debounce, or with low-pass filters, which in some cases are truely awful, amazingly bad. Following link explains bounce problem and shows hardware and software debouncing with detailed code notes.
formatting link
R
Richard Smith
I have learned a bit of other languages. Problem is the one-to-many relationship, as a native English speaker. It was amazing learning some Turkish when working in Turkey. Never took any language that far.
J
Jim Wilkins
The webpage pictures and your problem descriptions aren't clear enough or specific enough for definitive help. Explicit wiring diagrams and complete code listings are needed, as well as context like Arduino IDE version number.
formatting link
may be of help if you can fully explain what you wired up and give a minimum-working-example for the problem,
I suggest that when getting started, you first navigate to the Blink sketch (run Arduino, then File / Examples / Basics / Blink) and compile it and download it. Then, to verify you are able to make and install program changes, copy it to a directory of your own with a new name, eg Blink2, and try a few simple changes, like substituting 13 in place of LED_BUILTIN, or 400 in place of 1000, etc. and download again. If you want to try an external LED, connect it to some other IO pin (not D13) with eg a 2K resistor, put that IO number into your Blink2, test it, etc.
Then, if you are working with a program like DigitalInputPullup, connect a switch between an IO pin and Gnd, say D2 and ground, per .png-image schematics in examples/02.Digital/DigitalInputPullup . When you download the program to the Uno and it starts running, setup() will be called, which will set up serial IO and pinModes for D2 and D13. The pinMode(2, INPUT_PULLUP) statement places D2 into input mode with a pullup resistor to V+ (say 5V). That is, if D2 is in the INPUT_PULLUP state, an internal resistor like 35K ohms (RPU min
20K, max 50K per spec sheet) is connected between V+ and D2, which means that if you leave D2 open, D2 will sit at V+; or if you connect D2 to ground, after transients settle (~1us) D2 will sit at 0V, and some number of uA, eg 5/35000 A ~ 143 uA, will flow through the pullup resistor. You can measure that current by hooking an ammeter between the pin and ground if you want to calculate pullup resistance. If the current's really high or is zero the pin's not in INPUT_PULLUP mode. If you have an external pullup and turn on INPUT_PULLUP, the effective pullup resistance is the two resistors in parallel. If your external resistor is a pulldown (connected to Gnd instead of V+) the open-pin voltage [open aside from pull resistors] will be that of a resistor divider, instead of 0 or V+.
Re the I2C problem with your MCP9600 breakout board - Again, wiring diagrams and code listings are needed for diagnosis. One comment: You could write an if statement to try both addresses, 0x66 and 0x67, mentioned in the Pimoroni page, or a loop to try the whole range
0x60-0x67, proceeding ahead when a ready-test succeeds. Or, for simpler programming you could make a program with one address, download and test it, then change it for each possible address until successful. The I2C fails I've seen were due to wrong addresses, miswiring, bad chips, or in one case wires longer than a few feet.
Setting an open IO to low or high output like that is one approach, but on the Arduino Uno a simpler / less risky approach is to set pinMode to INPUT_PULLUP. Note, ATmega328P microcontroller chip hardware as on an Uno sets all IO pins to INPUT during Reset, but boot firmware changes the modes of some pins like D0, D1, D13 as per eg
formatting link
One can do a lot with indicator LEDs attached to several outputs. You can connect a resistor in series with an LED between an IO pin and ground or 5V. Eg, a 3.5V LED with a 1.5K resistor will draw 1 mA, either when the pin is low if series is between 5V and pin, or when the pin is high if series is between Gnd and pin. ( 0.001 A = (5V-3.5V)/1500 ohms.) Or, because modern LEDs light up ok (visible but not annoyingly bright) with a few microamps, you can connect an LED between an IO pin and Gnd; turn it on with perhaps 43 uA, ie (5V-3.5V)/35000 ohms, when you set pinMode to INPUT_PULLUP; turn it off by setting pinMode to INPUT. Note, outputting debug data via the serial port also is easy to do with Arduino.
If you are uncertain how much electronics work you'll do, or have to really economize, an item like
formatting link
($37) would get you at least basic scope function, making it possible to see switch bounce, PWM sequences, and other low frequency stuff. For a hundred or two more, you can get a 50MHz 2 channel scope like previously mentioned, a big step up. If you're into micros for the long term, go ahead and get a medium cost 4 channel 100MHz or 200MHz scope, somewhere between $300 and $800. Scopes in that range often have an input to accept data from optional add-on logic analyzer modules, adding 8 or more 0-1 inputs, and often have builtin protocol analyzers. Eg, besides displaying an I2C waveform they show its data content as text on the screen.
It's mostly switch bounce, not noise. On some switches bounce will be over within just a few milliseconds (ms), on others it can be dozens of ms. With search terms = arduino debounce, you can find code examples plus simple switch or switch+resistor circuits, and may also see pages like below with more-complex Schmitt trigger hardware debounce, or with low-pass filters, which in some cases are truely awful, amazingly bad. Following link explains bounce problem and shows hardware and software debouncing with detailed code notes.
formatting link
-------------------------- Thanks, I'm glad someone whose Arduino experience is less archaic than mine has jumped in. I think in hardware terms, voltage and current, and should have clarified that INPUT_PULLUP is sufficient to make the pin high.
The $23 one-channel DSO211 oscilloscope I have doesn't seem available and wouldn't capture both I2C signals so I didn't suggest it. I bought it for signals whose return can't be grounded.
IIRC the Arduino needed a separate terminal to talk to the user, the IDE didn't provide that function. Does it now?
The simplest switch debouncer I've seen and used is a spare buffer or noninverting gate(s) with a feedback resistor from output to input that makes it retain its logic level until the switch on its input yanks it to the other one. The switch needs to be double throw, connected to both power and ground, the resistor limits gate output current. In the days of hardwired logic there were almost always spare gates available.
J
Jim Wilkins
I have learned a bit of other languages. Problem is the one-to-many relationship, as a native English speaker. It was amazing learning some Turkish when working in Turkey. Never took any language that far.
-----------------------------
Then I used a bad example. I'd heard that Europeans (or Continentals) tend to learn more than one, unlike Americans. Urban Germans often knew English while rural ones mostly didn't, and many spoke significantly different local dialects which doubled my difficulty understanding them. It helped that some of the differences were those by which Saxon German morphed into Old English. For example Ein/Eine became Uh (a) and Der/Die/Das became Duh (the).
Anyway learning computers becomes easier once you pass over the initial hump of the seemingly unrelated basics. Programming is really just another language, that fortunately you don't have to speak and understand in live conversation. It's said the Romans' greatest accomplishment was being able to speak their grammatically challenging language.
J
Jim Wilkins
I have learned a bit of other languages. Problem is the one-to-many relationship, as a native English speaker.
--------------------------------
Although "dead", Latin clarified the grammar and vocabulary of many modern European languages including English. German gave me entry to Dutch, Scandinavian and Yiddish. French has been useful in neighboring Quebec and some help with Spanish, in fact the two shade together across Provence and Catalonia. I gave up on Russian when they turned inward and hostile, the little I know is recognizable in other Slavic languages. I know the alphabet and have some vocabulary in Greek because of its heavy use in science but can't put a sentence together.
R
Richard Smith
Hi James, everyone
Thanks for the ideas in your reply.
Do thing of copying the example code then adding features. eg. "blink" -> flashes-out morse code with LED on "breadboard" At least got that far.
Addresses hint re. Arduino I2C to breakout board great.
Maybe accept crawl before tray to walk - do simpler code just to see if can get the I2C connection going - forget trying to read the thermocouple yet? Thinking of the idea of trying the addresses.
Rich S
C
Clare Snyder
I picked up a cheap portable storage scome (single chanel only) for that kind of work then stumpled across a primo Tektronics 465 with the DM44 add-on for $50. I had been scopeless for a couple decades since my old Heathkit blew a couple capacitors (with a big bang and lots of smoke) Picker it up to do some automotive electronic troubleshooting - and made a pressure pulse sensor for it as well.
C
Clare Snyder
I've found Stabilant22 can make a HUGE difference in electronic connections that are "noisy" or intermitternt. Pricy stuff at about $400 an ounce but it goes a long way. 1/4 ounce mixed with 3/4 oz of
99.9 ethanol makes an ounce of 22E for about $100 - the last ounce lasted me about 20 years. Just mixed 2 oz of 22E and 2 oz of 22A (mixed with 99% IPA) yesterday. $5 an ounce for the ethanol and $7 for half a liter of IPA - (and no, not the hoppy beverage libation 111)
One drop of the stuff can make a noisy control DEAD QUIET. or an intermittent connection rock solid Used on test lead plugs? fantastic
- electrically virtually identical to a good soldered joint and no worries about shorts between pins etc. I stumbled across the stuff when working on American Megatrends mother boards back when all the memory and most other chips were still socketted and the pin connections would get flaky from heat cycling. You could re-seat the chips once every 2 months - or use a bit of Stabilant22 and never touch them again for 5 years. with 3 year warrany on our machines the stuff was worth it's weight in platinum in eliminating over 90% of warranty claims
L
Leon Fisk
<snip>
Yowza! That's a really nice looking scope👍 I can't beat that deal...
C
Clare Snyder
There used to be a "tuner lube" for mechanical TV tuners that had a real fine abrassive in it - the stuff was a black paste in a hypordermic needle that you very carefully squirted in to the contacts of all the wafer switches inTV tuners to "quiet" them down. My lat tube hardened up and gat thrownout tears ago - I think it was from M-G Chemicals (same company that manufactures Stabilant up here north of Toronto) - Their NuTrol is a pretty decent volume control cleaner too.
C
Clare Snyder
high or low and all analog inputs low to prevent ambiguous outputs. and don't forget de-spiking capacitors still work on Microprocessors!!!
C
Clare Snyder
Took a bit of French in grade 9 - that's 60 years ago - and a conversational Spanish course back in about '76. The 2 languages are just close enough I managed to get out SOME "Spenchlish" for a couple of years - - - My eldest daughter (turnd 42 on Sunday) has worked predominantly in French for about 12 years (in charge of programs in a large part of French West Africa for a major NGO) She's made good use of her French Immersion schooling.
C
Clare Snyder
The most I ever accomplished was a remote elevator trim for homebuilt (experimental) aircraft using a large scale Radio control servo driven by the arwuino with 2 push buttons for "UP" and "DOWN" and one for "reset to neutral" - with a small micro-servo slaved as the trim indicator on the panel. Then I had fuel guages using pressure transfucers plumbed into the bottom of the tank that calculated the volume by the fuel column weight and converted togallons in the tank using a table ofvolume per inch of depth (irregular tank shape)
I just started out with some sample "sketches" and built from there. After getting a sketch working to do one part of the job, I'd set it asife and work on another function - then link the sketches together - calling them as sub-routines as required.
each project took several weeks of spare time
There was enough capacity for one Arduino to handle both tasks, but I wasn't smart enough to combine the 2 programs and I felt safer with the 2 functions on separate controllers in case of a failure - where I would only lose one function at a time - - - Sold the plane before I got a chance to fly it.
J
Jim Wilkins
Hi James, everyone
Thanks for the ideas in your reply.
Do thing of copying the example code then adding features. eg. "blink" -> flashes-out morse code with LED on "breadboard" At least got that far.
Addresses hint re. Arduino I2C to breakout board great.
Maybe accept crawl before tray to walk - do simpler code just to see if can get the I2C connection going - forget trying to read the thermocouple yet? Thinking of the idea of trying the addresses.
Rich S
------------------------------------------- For me finding and correcting programming errors is hard enough that I try one new thing at a time so I know at least where to look if it fails. That's why I decide and test how to display dummy data before measuring it for real. I2C data may be useful if shown both as binary bits and their numerical equivalent, for configuration and temperature.
I've programmed since the early 80's but a few days ago I got tangled in a simple IF THEN ELSE in a spreadsheet. After breaking off to do something else and returning with fresh eyes the typing error was obvious.
C
Clare Snyder
It was something of an estate sale. The old guy had been an engineer with Square D Canada and Allen Bradley (Rockwell Automation) and continued doing some repair work at home after retirement and had ammassed a PILE of "stuff" the family had to dispose of after his death. I cot boxed of compinents, 8X10X2 inches for $2 Canafian each - the scope, a decade resistir sub box, a 10 amp CanLab Powerstat in a nice cabinet, Also a brand new foot swith unit with a heavcy magnetic contactor - all in nice cabinetry and a brand new Sencore SCR tester (but without the required Sencore Megger to use it woith - know anyone who needs it?) I think the total was $75 or $80. There was still a truck-load in the garage when I left - but I had no room for any more
- wife's always at me to get rid of "stuff"
J
James Waldby
[big snip]
Yes, it's a good feature of battery-powered small cheap scopes that they allow ungrounded operation. As you note, some of them can't capture I2C, which I didn't think about WRT the cheap scope I linked. It does 250 KHz, not good enough for `Fast Mode` I2C at 400 KHz, let alone the 3.4 MHz and 5 MHz versions of I2C.
I think a decade ago there were some issues with Serial.printf, and some serial-over-USB drivers had bugs that hung around a while, but for a good while the same USB link used to program an Arduino Uno or Nano has been working fine for serial IO to a window that's part of the IDE. However, on Linux at least, a not-IDE Python or C program can't share a serial link with the IDE; one or the other has to relinquish it.
Note, the IDE now has an easy-to-use Serial Plotter tool. If a sketch outputs some numbers on each line of serial output and you open a Serial Plotter window, data will be plotted as it arrives, like on a multi-channel scope.
At the time, gates were cheaper than lines of code, vs the other way around now. But if an application has lots of switches, software debounce may be to much of a challenge for some programmers. So there are libraries, eg Bounce2, that can be used to take care of software debounce with a not-too-bad learning curve.
J
James Waldby
[snip]
That's probably ok advice in general, particularly for an Arduino Uno being used for numerous projects. But setting the modes of unused inputs to INPUT_PULLUP seems safer, because then they won't be at risk of Gnd-to-V+ shorts due to program glitches. That aside, I should do some measurements to see which is best among the various INPUT / OUTPUT / INPUT_PULLUP modes, with input left open / connected to Gnd / connected to V+. Note, some Arduino inputs don't have internal pullups available. For example, A6 and A7 on Arduinos with ATmega -P and -PA processors, and most IO pins on ESP8266-based micros.
J
Jim Wilkins
To Richard: The IDE is the computer host program that communicates with the Arduino. Input pullups are generally harmless except on analog inputs making measurements.
I haven't seen a floating input cause an overheating problem on a device released for production but I have in R&D where I found the resulting hot spot on the chip with a microscope and infrared camera.
formatting link
Inputs and outputs have normally reverse-biased clamp diodes to (+) and Gnd, either inherently or for static protection. An external High signal on a pin when the device isn't powered up will pass through them to the device power supply and try to power the board and charge its bypass capacitors, which may damage the pin or the signal source. This means one switch should control the power for every board in the circuit.
Some power supplies don't take well to externally applied voltage on their output when they are turned off, or higher than their set point. This is mainly a concern when using them to charge batteries, also some consideration in bench test setups.
Hot-pluggables like USB have (or should) built-in surge current limiters to prevent damage or voltage dips in the source. They may be a series "thermistor" whose resistance increases sharply when they warm up. Otherwise plugging in a USB device could crash the computer. For USB2 the current limit is 0.5A, with some brief overload capacity to charge capacitors. If a USB-powered board and whatever you add to it draws more current the USB 5V output may drop and the board not work right.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.