Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerSalida Principal

Jump Cacti With an LDR and a Pico

6 Septiembre 2024 at 08:00
A light-dependent resistor detects cacti in the Google Chrome Offline Dinosaur game.

By now, probably everyone is familiar with the “You’re Offline” dinosaur that stars in Google’s T. Rex game. You know — jump cacti, avoid pterodactyls. Repeat until you lose, or, we suppose, make the leaderboard. Well, what if you theoretically couldn’t lose? That’s kind of the idea behind [Bas BotBerg]’s cactus detection-and-avoidance scheme (translated from Dutch).

Like many of us, [Bas] firmly believes that repetitive tasks should be automated, and that includes the controls of the famous T. Rex. Since the cacti are always dark gray and appear along the same plane, it’s easy to register the difference between cacti and screen electronically. In order to accomplish this, [Bas] is using a light-dependent resistor and a pull-up resistor to create a resistance bridge, which is then connected to an analog input pin on a Raspberry Pi Pico.

But [Bas] didn’t do this just to cheat at Offline Dinosaur. Really! It’s for educational purposes, to get people comfortable with embedded processing, sensors, and interfaces between different devices. Check it out in brief action after the break.

Once they get familiar with these concepts, maybe introduce the ESP32 version of Offline Dinosaur.

Photoresistor-based Single Pixel Camera

23 Julio 2024 at 11:00

[Hugh] has been going back through episodes of the Hackaday podcast, and Elliot mentioned in episode 67 that it can often be inspiring to go back through the archives of Hackaday to find ideas for new projects. Well, he did just that and came across a single-pixel camera made using an infrared photodiode. He decided to try and hack together his own single-pixel camera, but this time on the cheap and using an ever simpler component – a photoresistor!

His description of the project tickled me – “I’ve used an ESP32, MicroPython, two servos, a peanut butter jar lid, a toilet paper roll, a paper towel roll, magnets and scrap wood for this version.” That’s certainly a much simpler bill of materials than the original (which was written up by Hackaday way back in 2015), which used a nice metal frame to hold everything together. However, there’s absolutely nothing wrong with improvising with things you happen to have to hand.

The alt-az mechanism

In this case, the sensor is mounted at the back of a paper towel tube, with black tape covering the front and a tiny pinhole poked in the tape to act as the aperture. Similarly to the original, the sensor is scanned over the scene in an XY altitude/azimuth pattern to capture the samples one at a time. It takes just under eight minutes to capture 8100 “pixels” in a 90×90 grid. The servos are driven using a PCA9685 PWM/Servo driver, which makes motor control a lot easier. An important lesson [Hugh] learned during construction was that weak power supplies can cause all sorts of issues when motors or servos are involved. He had been encountering uneven rotation and random halting, but as soon as a beefier power supply was attached everything worked smoothly.

[Hugh] used a much more powerful ESP32 to do the actual gathering of the analog data, which is then sent over a serial port to a Python processing engine which uses Pandas, numpy and matplotlib to do the bulk of the image processing. The resulting processed photo is very recognizable, considering the differences in linearity and sensitivity between a photoresistor and the infrared photodiode used in the original project! It really is incredible what you can do with a few spare parts, some random construction materials, and a little bit of creativity.

❌
❌