Talking Ohmmeter Also Spits Out Color Bands For You

If you’ve got a resistor and you can’t read the color bands (or they’re not present), you can always just grab a multimeter and figure out its value that way. [Giacomo Yong Cuomo] and [Sophia Lin] have built an altogether different kind of ohmmeter, that can actually spit out color values for you, and even read the resistance aloud. It’s all a part of their final project for their ECE 4760 class.

The build is based around a Raspberry Pi Pico. It determines the value of a resistor by placing it in a resistor divider, with the other reference resistor having a value of 10 kΩ. The resistor under test is connected between the reference resistor and ground, while the other leg of the reference resistor is connected to 3.3 V. The node between the two resistors is connected to the Pi Pico’s analog-to-digital converter pin. This allows the Pico to determine the voltage at this point, and thus calculate the test resistor’s value based on the reference resistor’s value and the voltages involved.

A large fake resistor provides user feedback. It’s filled with addressable LEDs, which light up the appropriate color bands depending on the test resistor’s value. It’s capable of displaying both 3-band, 4-band, and 5-band color configurations. While six-band resistors do exist, the extra band is typically used for denoting temperature coefficients which can’t readily be determined by this simple test. It can also play audio files to announce the resistance value over a speaker.

It’s a neat project that surely taught the duo many useful skills for working with microcontrollers. Plus, it’s kinda fun — we love the big glowing resistor. We’ve featured some other fancy resistors before, too!

Continue reading “Talking Ohmmeter Also Spits Out Color Bands For You”

Infrared Following Robot Built As Proof-of-Concept For Autonomous Luggage

Once upon a time, the poor humans of the past had to lug around suitcases and trunks with their own arms. Then, some genius figured out that you could just put wheels on and make everyone’s life a million times easier. Now, what if you didn’t even have push, because your luggage could just follow you instead? Well, students [Yuqiang Ge] and [Yiyang Zhao] have figured out a proof of concept for how that could work.

Their build is a small robotic platform that they assembled for their ECE5730 final project. The tiny wheeled robot is programmed to rotate on the spot until its infrared sensors pick up a signal. In turn, the user is intended to carry an infared beacon for it to lock onto. A pair of sensors are used on the robot platform, separated by a board to serve as a blind. The robot determines the relative signal strength from each sensor, and uses that to vary PWM signals to the two DC drive motors to steer the robot platform to seek and follow the infrared beacon.

It’s a neat idea, and looks to work pretty well in a university corridor. It even has an ultrasonic range sensor to (ideally) stop when it gets too close to the user. Whether it would survive the tumult of a crowded airport is another thing entirely, but that’s what the engineering process is about. Indeed, the very concept has been commercialized already!

Following-robots are a common student project, and one well worth exploring if you’re new to the robotic field.

Continue reading “Infrared Following Robot Built As Proof-of-Concept For Autonomous Luggage”

Raspberry Pi Pico Becomes MIDI-Compatible Synth

ECE 4760 is a microcontroller course that runs at Cornell every year, and it gives students a wide remit to pursue various kinds of microcontroller projects. [Pelham Bergesen] took the class and built himself a MIDI-controllable synthesizer out of a Raspberry Pi Pico.

[Pelham] coded a library to parse MIDI messages on the Pico, with the microcontroller’s UART charged with receiving the input data. MIDI is basically just serial at a baud rate of 31.25k, with a set message structure, after all. From there, the Pico takes the note data and plays the relevant frequencies by synthesizing square waves using a PWM output. A second PWM channel can also be blended with the first to generate more complex tones.  The synthesizer is designed to be used with a source of MIDI note data such as a keyboard controller; [Pelham] demonstrates the project in use with a Roland JD-XI. It’s a fairly basic synthesizer, but [Pelham] does a good job of explaining all the steps required to get this far. If you’ve never done an audio or MIDI project before, you might find his guide very helpful for the way it steps through the basics.

[Pelham] didn’t get to implement fancier features like direct digital synthesis (DDS) or analog audio effects before the class closed out. However, that would be an excellent project for anyone else developing their own Pico synthesizer. If you whip up something that sounds good, or even just interesting, be sure to notify us on the tipsline. Video after the break.

Continue reading “Raspberry Pi Pico Becomes MIDI-Compatible Synth”

Cornell Updates Their MCU Course For The RP2040

The School of Electrical and Computer Engineering at Cornell University has made [Bruce Land]’s lectures and materials for the Designing with Microcontrollers (ECE 4760) course available for many years. But recently [Bruce], who semi-retired in 2020, and the new lecturer [Hunter Adams] have reworked the course and labs to use the Raspberry Pi Pico. You can see the introductory lecture of the reworked class below.

Not only are the videos available online, but the class’s GitHub repository hosts extensive and well-documented examples, lecture notes, and helpful links. If you want to get started with RP2040 programming, or just want to dig deeper into a particular technique, this is a great place to start.

From what we can tell, this is the third overhaul of the class this century. Back in 2012 the course was using the ATmega1284 AVR microcontroller, and in 2015 it switched to the Microstick II using a Microchip PIC32MX. Not only were these lecture series also available free online, but each has been maintained as reference after being replaced. One common thread with all of these platforms is their low cost of entry. Assuming you already have a computer, setting up the hardware and software development environment for these modules costs less than the price of a pizza dinner, a fact no doubt appreciated by the ECE department’s budget director.

We’ve covered this course before back in 2015 when it first changed. Another free online course on embedded system design is from [Prof James Conrad] at UNC Charlotte, based on the Renasas RX63N microcontroller — the UNC Charlotte team drove development of the autonomous vehicle project we covered back in 2009. If you know of other online embedded systems classes, let us know in the comments below.

Continue reading “Cornell Updates Their MCU Course For The RP2040”

RP2040 DMA Hack Makes Another ‘CPU Core’

[Bruce Land] of Cornell University will be a familiar name to many Hackaday readers, searching the site for ‘ECE4760′ will bring up many interesting topics around embedded programming. Every year [Bruce] releases yet more of the students’ work out into the wild to our great delight. This RP2040-based project is a bit more abstract than some previous work and shows yet another implementation of an older hack to utilise the DMA hardware of the RP2040 as another CPU core. While the primary focus of the RP2040 DMA subsystem is moving data between memory spaces, with minimal CPU intervention, the DMA control blocks have some fairly complex behaviour. This allows for a Turing-complete CPU to be implemented purely with the DMA hardware and a sprinkling of memory.

The method ties up three of the twelve DMA channels, and is estimated to have a similar performance to ‘an Arduino’ but [Bruce] doesn’t specify which one of the varied models that could be. But who cares anyway? Programming the CPU is a matter of leveraging the behaviour of the hardware, which is all memory mapped and targetable by the DMA. For example, the CPU can waggle GPIO pins by using the DMA to write values to the peripheral address space. The basic flow can be seen in the image above. DMA0 is used as the program counter, which points DMA1 to an array of DMA control blocks, a sequence of which codes for some of the ‘opcodes’ of the CPU model. DMA0 chains to (hands over control to) DMA1 which reads the control blocks and configures itself accordingly. DMA1 performs whatever data move is programmed, chains to DMA2, which in turn reprograms the DMA0 program counter to point to the next block in the list to be executed by DMA1.

Continue reading “RP2040 DMA Hack Makes Another ‘CPU Core’”

PIC32 DMA Is A Weird Machine

Direct memory access (DMA) systems in computers are more powerful than you might think, and [Bruce Land] and [Joseph Primmer] have done some clever hacking to take full advantage of this on the PIC32 microcontrollers. This is a cool proof-of-concept hack — you can do general computing in the DMA subsystem without using the CPU at all if you don’t mind taking your time — but they also include two useful examples: a direct digital synthesis machine and a random number generator. Both of these run using exactly 0% CPU time.

How do they do it? DMA is a mechanism for shuttling data around in memory or between hardware peripherals without involving the CPU. Say you want to take a large block of memory containing music, and spit it out slowly to an I2S audio converter. A DMA subsystem could be configured to take an interrupt from the sound chip, pass it a chunk of data, increment the data pointer, and wait for the next interrupt.

The gimmick, which goes back at least to [Rushanan] and [Checkoway]’s “Run DMA” paper, is that you can modify the memory source and destination addresses of one DMA service from another DMA service, and that some registers automatically perform mathematical operations on whatever data is put into them. Combine these together, and you’ve got transport-triggered programming.

(An awesome side-note: our own [Al Williams] developed a one-instruction transport-triggered CPU way back in the day: the One Instruction Wonder.)

What is this good for? Writing simple helper applications that run independent of the CPU on a PIC32 microcontroller. [Land] and [Primmer]’s direct-digital synthesis example is a great one. But there are a lot of cases where you simply want to take in some new data and pre-process it a little bit before it enters the main program flow. While creating weird machines in the DMA engine might be a slower way to get it done, it keeps the CPU free for doing other stuff. We’re sure you’ll come up with something.

Microcontroller Studies The Blade

Kendo, a Japanese martial art, is practiced with a special sword. It’s not a particularly sharp sword, though, since the “blade” is essentially a length of bamboo. For this reason, Kendo practitioners must rely on correct form and technique in order to make sure their practice is as effective as possible, and Cornell students [Iman] and [Weichen] have made a Kendo trainer that helps the swordsmen in their art.

The core of the project is a PIC32 microcontroller hooked up to a set of three piezoelectric sensors and a LSM9DS1 inertial module. The three piezoelectric sensors are attached to a helmet and the inertial module to the sword, and the sensors work together to determine both the location of the strike and whether or not it had enough strength to be considered a “good” strike (the rules of Kendo are beyond the scope of this article). The trainer can then calculate all of the information and provide feedback to the user on a small screen.

While martial-arts related builds seem to be relatively rare, we did find a similar project from back in 2011 called the Virtual Sensei which used a then-popular Kinect in order to track movements. This PIC32-based project, though, seems to be a little more thorough by including the strength of the strike in the information the computer uses, and is probably less expensive to boot!

Continue reading “Microcontroller Studies The Blade”