Learning from Udemy Arduino course

I signed up for the Arduino Step by Step course from Udemy, and have now got partway through it (25%!).  It is pretty good, and I wanted to summarize my key  lessons learned:

Sensors:  the course walked through a bunch of them, but most of them are pretty straight forward or I had used before.  QRE113 line sensor was one I hadn’t seen before, but extremely simple and cheap.

Rotary encoders:  hadn’t run into these before, but they are pretty useful.  Allow a count of change, but don’t know there absolute position.  They can go continuously (i.e. don’t have a hard stop on one end).  There are different types:  conductive, optical, magnetic, etc.  Conductive seems to be the cheapest. YK-040 is a cheap example, has 20 positions per rotations.  Pretty simple operation: DT and CLK are the way to track rotation, while SW is the indicator for the switch (i.e. you can press the knob like a button, use a pullup/down resistor as well).  The sketch example used interrupts to count, so the CLK pin needed to go to pin that has an available interrupt.  Debouncing is necessary, either in software or in hardware (e.g. with capacitors).

Relays: they have 5 points of connection,  and alternate between connections (rather than be just closed/open like a switch).  Typically, the middle point on one end is the common pin for the alternating connection, with the far two pins the two different ends of the alternation.  The other two pins, across the middle pin, are for the coil which does the switching; they are not polarized.  Best to have a diode across the coil and also power the coil from a transistor (pay attention to the current limiting resistors and coil resistance to get the needed current flow).

Serial communication:  if you upload a blank sketch (or presumably a sketch with no serial comms), if you plug in a peripheral to the Tx and Rx pins on the Arduino by mirroring (i.e. Tx to Tx, Rx to Rx), you can see the peripheral serial comms on your serial monitor.  Basically it implies that the Tx and Rx pins are hardwired in to the USB chip on the Arduino.

GPS:  At least the Adafruit GPS chip communicates in serial using standard text sentences that can be parsed.  Seems to standard for most GPS chips as a NMEA standard.  There is an Adafruit library and a TinyGPS++ library, where you can query if a piece of data has been updated since last time and is apparently easier to use and more broadly applicable.

PCB manufacturing: can use Fritzing for PCB design, however, limited to 2 layers.  If you want more, use Eagle (up to 16 layers).  Drag the components on, and then move them around to where they are to be on the board. Minimizing physical space minimizes cost.  Can also add drill holes for screws, and vias to switch a trace from top to bottom. Then you can highlight the lines to make them traces, using multiple layers.  Can use a ground fill to fill one side completely with copper, grounding multiple elements at once and also using it as a heat sink (ish?), but not sure exactly what the benefit of that really is. Make sure to click “Check Design Rules” before sending for production.  For production, want to use gerber files.  Can check the gerber files at gerblook.org.

I have been doing the course a little out of order, so more to come!  Looking forward to the sections on internet and wireless communications, and on interrupts!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s