Self-driving trash can controlled by Raspberry Pi

YouTuber extraordinaire Ahad Cove HATES taking out the rubbish, so he decided to hack a rubbish bin/trash can – let’s go with trash can from now on – to take itself out to be picked up.

Sounds simple enough? The catch is that Ahad wanted to create an AI that can see when the garbage truck is approaching his house and trigger the garage door to open, then tell the trash can to drive itself out and stop in the right place. This way, Ahad doesn’t need to wake up early enough to spot the truck and manually trigger the trash can to drive itself.

Hardware

The trash can’s original wheels weren’t enough on their own, so Ahad brought in an electronic scooter wheel with a hub motor, powered by a 36V lithium ion battery, to guide and pull them. Check out this part of the video to hear how tricky it was for Ahad to install a braking system using a very strong servo motor.

The new wheel sits at the front of the trash can and drags the original wheels at the back along with

An affordable driver board controls the speed, power, and braking system of the garbage can.

The driver board

Tying everything together is a Raspberry Pi 3B+. Ahad uses one of the GPIO pins on the Raspberry Pi to send the signal to the driver board. He started off the project with a Raspberry Pi Zero W, but found that it was too fiddly to get it to handle the crazy braking power needed to stop the garbage can on his sloped driveway.

The Raspberry Pi Zero W, which ended up getting replaced in an upgrade

Everything is kept together and dry with a plastic snap-close food container Ahad lifted from his wife’s kitchen collection. Ssh, don’t tell.

Software

Ahad uses an object detection machine learning model to spot when the garbage truck passes his house. He handles this part of the project with an Nvidia Jetson Xavier NX board, connected to a webcam positioned to look out of the window watching for garbage trucks.

Object detected!

Opening the garage door

Ahad’s garage door has a wireless internet connection, so he connected the door to an app that communicates with his home assistant device. The app opens the garage door when the webcam and object detection software see the garbage truck turning into his street. All this works with the kit inside the trash can to get it to drive itself out to the end of Ahad’s driveway.

There she goes! (With her homemade paparazzi setup behind her)

Check out the end of Ahad’s YouTube video to see how human error managed to put a comical damper on the maiden voyage of this epic build.

The post Self-driving trash can controlled by Raspberry Pi appeared first on Raspberry Pi.

Read more »

NEW PRODUCTS – Rugged Metal Pushbuttons – 16mm 6V RGB Latching – Black + Silver Finishes

4659 4660

NEW PRODUCTS – Rugged Metal Pushbuttons – 16mm 6V RGB Latching – Silver + Black Finishes


We’ve got two handsome new pushbuttons! First up, the Rugged Metal Silver Finish Pushbutton – 16mm 6V RGB Latching!

By popular demand, we now have latching rugged metal pushbuttons with a full-color RGB LED ring light! These chrome-plated metal buttons are rugged, but certainly not lacking in flair. Simply drill a 16mm hole into any material up to 1/4″ thick and you can fit these in place – there’s even a rubber gasket to keep water out of the enclosure.

4659 kit ORIG 2020 08

On the front of the button is a flat metal actuator, surrounded by a plastic RGB LED ring. On the back there are two gold contacts for the button and 4 for the RGB LED ring (one anode and 3 cathodes for each red, green, and blue). Power the anode at 3-6V and light up the red, green, and blue LEDs by pulling their designated contacts to ground as you desire – there’s a built-in resistor! If you want to use this with a higher voltage, say 12V or 24V, simply add a 1K ohm resistor in series with the LED cathodes to keep the LED current at around 20mA. You can PWM the RGB pins to make any color you like.

This button is a latching pushbutton when you press and release it the ‘normally-open’ contact shorts to the common contact and stays that way. When you press and release it a second time, the contacts open up again.

The switch and LED are electrically separated, so to change the color, use a microcontroller to both read the contact pins and toggle the color control pins.

And now for the Rugged Metal Pushbutton with Black Finish – 16mm 6V RGB Latching!


By popular demand, we now have latching rugged metal pushbuttons with a full-color RGB LED ring light! These chrome-plated metal buttons are rugged, but certainly not lacking in flair. Simply drill a 16mm hole into any material up to 1/4″ thick and you can fit these in place – there’s even a rubber gasket to keep water out of the enclosure.

4660 kit ORIG 2020 08

On the front of the button is a flat metal actuator, surrounded by a plastic RGB LED ring. On the back there are two gold contacts for the button and 4 for the RGB LED ring (one anode and 3 cathodes for each red, green, and blue). Power the anode at 3-6V and light up the red, green, and blue LEDs by pulling their designated contacts to ground as you desire – there’s a built-in resistor! If you want to use this with a higher voltage, say 12V or 24V, simply add a 1K ohm resistor in series with the LED cathodes to keep the LED current at around 20mA. You can PWM the RGB pins to make any color you like.

This button is a latching pushbutton when you press and release it the ‘normally-open’ contact shorts to the common contact and stays that way. When you press and release it a second time, the contacts open up again.

The switch and LED are electrically separated, so to change the color, use a microcontroller to both read the contact pins and toggle the color control pins.

In stock and shipping now!

Read more »

Lemon Plum Jam Revisited

Jars of jam

It has been a great season for plums, so I’ve updated the lemon plum jam recipe that I’ve been gradually refining over the years. The new basic recipe is below along with other tips I’ve gathered.

Ingredients:

  • 8 cups cut up pieces of plums, pits removed, skins left on, fresh or frozen
  • 3 lemons, (optionally peeled) cut into small pieces, seeds removed
  • juice from 3 more lemons
  • 6 cups sugar

Lemon and plum pieces in a pot

Procedure:

Put the plums, lemon pieces and lemon juice in a sauce pot and cook, stirring occasionally, until the fruit starts to soften. At this point, you can use a potato masher to crush the fruit pieces for a more even consistency.

Holding potato masher above fruit cooking in pot

Add sugar and cook, stirring regularly, until it thickens. You can test the consistency for doneness by putting a spoonful in a cold dish in the fridge for a few minutes. After chilling, it’s ready if it holds its shape a bit when you move a spoon or finger through it. You can also follow your favorite canning procedure for longer term storage. Makes about 4-5 pints.

Tips and techniques:

For cutting up the fruit, I like to put a small cutting board inside a baking sheet. This catches the juice much better than any cutting board with a moat that I’ve ever used. It makes cleanup much easier, and you can pour the juice from the baking sheet into the cooking pot.

Most jam recipes call for approximately equal quantities of sugar and fruit. I prefer my jam a little more tart, so I’ve revised down the sugar.

I’ve stopped adding water to my preserves. It cooks a little faster without as much liquid, and there’s enough liquid in the lemon juice to get it started cooking even if the fruit isn’t covered.

I also often leave the lemon peel out for the preserves I make (other than marmalade). The peel gives it a stronger lemon flavor, but keeps the jam from gelling as well. If you want a thicker consistency that gels a little earlier, you can leave the peel out. If you want zingier lemon flavor, leave the peel on and cook a little longer.

During fruit season, I try to preserve as much as I can by making jams and chutneys, but I usually run out of time and end up cutting up the last of the crop and freezing it. Using frozen fruit for jams seems to work just as well as fresh. I measure out 8 cups and store it in a one gallon freezer bag. Then it’s ready to pull out start a batch of jam. I also recently revised my Plum Chutney recipe, and it starts with 8 cups of fruit as well.

Read more »

DIY portable video conference, sharing and teaching device

A DIY conference and teaching device @ mcuoneclipse.com:

COVID-19 is by far not over, and in Switzerland the infection rate is going up again (2nd wave?). During the spring 2020 semester university lock-down we moved pretty much everything to a ‘distance learning’ setup. With that experience and with the request to prepare for the fall semester, I have constructed a DIY conference and teaching device which should make things simpler and easier: a combination of video camera, speaker phone and a muting device

Read more »

Get Your Fix at Virtual Maker Faire Miami 2020 This Weekend!

It’s clear that a pandemic can’t keep makers from doing what they do best and Virtual Maker Faire Miami kicks off tonight at 6:30pm ET to celebrate the spirit of ingenuity, creativity, and fun of the maker community. Maker Faire Miami producer-maker-hacker-inventor Mario Cruz, and his team from Moonlighter Makerspace, […]

Read more on MAKE

The post Get Your Fix at Virtual Maker Faire Miami 2020 This Weekend! appeared first on Make: DIY Projects and Ideas for Makers.

Read more »

Wag the OpenLog

Hello, everyone! This week we have another handful of new products, beginning with the SparkFun OpenLog Artemis. This new data logger has just graduated from SparkX, and provides you with an Artemis-powered, plug and play logger with a built in, high resolution 9DoF IMU! We have also revised our popular Qwiic Kit for Raspberry Pi to include the Qwiic pHAT v2.0. Last up this week, we have a new 5V, 2A wall charger.

Don't forget that you can get a free SparkFun Qwiic Pro Micro BoogieBoard with any purchase of $75 or more using promo code "BOOGIEBOARD20" (some restrictions apply). Supplies are running short so get yours before we run out!

Now onto our new products!

Read us like an open log!

SparkFun OpenLog Artemis

added to your cart!

SparkFun OpenLog Artemis

In stock DEV-16832

The SparkFun OpenLog Artemis is an open source data logger that comes pre-programmed to automatically log IMU, GPS, serial da…

$49.95

The SparkFun OpenLog Artemis is an open source data logger that comes preprogrammed to automatically log IMU, GPS, serial data and various pressure, humidity and distance sensors - all without writing a single line of code! OpenLog Artemis, or "OLA," automatically detects, configures and logs Qwiic sensors. The OLA is specifically designed for users who just need to capture a lot of data to a CSV and get back to their larger project.


SparkFun Qwiic Starter Kit for Raspberry Pi

added to your cart!

SparkFun Qwiic Starter Kit for Raspberry Pi

23 available KIT-16841

The SparkFun Qwiic Kit for Raspberry Pi includes a shield with headers, three Qwiic-enabled breakout boards, and four cables …

$54.95

Ready to get started with Raspberry Pi and Qwiic? The SparkFun Qwiic Starter Kit for Raspberry Pi includes the SparkFun Qwiic pHAT v2.0 for Raspberry Pi, which adds four Qwiic connectors to your Pi. It also includes a VCNL4040 Proximity Sensor Breakout, Micro OLED Breakout, Environmental Combo Breakout and plenty of Qwiic Cables to connect everything together!


USB Wall Charger - 5V, 2A

added to your cart!

USB Wall Charger - 5V, 2A

In stock TOL-16893

This USB AC to DC power supply will do 5V at 2A!

$5.95

USB as a power connection standard is common these days, but you don't always have a computer on hand, so how are you going to power all of your sweet USB devices? How about a high quality switching 'wall wart'? This AC to DC power supply will do 5V at 2A! They're switch mode power supplies which means the output is regulated to 5V.


That's it for this week! As always, we can't wait to see what you make! Shoot us a tweet @sparkfun, or let us know on Instagram or Facebook. We’d love to see what projects you’ve made!

Never miss a new product!

hbspt.forms.create( portalId: "2224003", formId: "e963ae12-71f6-46d7-bb00-126dbfef8636" );

comments | comment feed

Read more »

App note: Charging capacitive loads with eFuse

App note from ON Semiconductors on how eFuse manage to cope up with large capacitive loads. Link here (PDF)

The eFuse protection devices are used for limiting the system load current in the events of overload or short circuit. Many applications employ On Semiconductor eFuses at the power input stage of the system between the main power input connector and DC?DC converters or power regulators. The systems utilizing eFuse protection devices at the power input stage may represent inductive, resistive, capacitive or mixed types of loads.
One of the common load characteristics for various systems is large capacitive load, typically starting from 1mF all the way to few hundred milli Farads. The challenge presented by such load to an overcurrent protection system is large inrush current due to the excessive capacitance which will cause the device to shut down during startup.

Read more »

Mini Raspberry Pi Boston Dynamics–inspired robot

This is a ‘Spot Micro’ walking quadruped robot running on Raspberry Pi 3B. By building this project, redditor /thetrueonion (aka Mike) wanted to teach themself robotic software development in C++ and Python, get the robot walking, and master velocity and directional control.

Mike was inspired by Spot, one of Boston Dynamics’ robots developed for industry to perform remote operation and autonomous sensing.

What’s it made of?

  • Raspberry Pi 3B
  • Servo control board: PCA9685, controlled via I2C
  • Servos: 12 × PDI-HV5523MG
  • LCD Panel: 16×2 I2C LCD panel
  • Battery: 2s 4000 mAh LiPo, direct connection to power servos
  • UBEC: HKU5 5V/5A ubec, used as 5V voltage regulator to power Raspberry Pi, LCD panel, PCA9685 control board
  • Thingiverse 3D-printed Spot Micro frame

How does it walk?

The mini ‘Spot Micro’ bot rocks a three-axis angle command/body pose control mode via keyboard and can achieve ‘trot gait’ or ‘walk gait’. The former is a four-phase gait with symmetric motion of two legs at a time (like a horse trotting). The latter is an eight-phase gait with one leg swinging at a time and a body shift in between for balance (like humans walking).

Mike breaks down how they got the robot walking, right down to the order the servos need to be connected to the PCA9685 control board, in this extensive walkthrough.

Here’s the code

And yes, this is one of those magical projects with all the code you need stored on GitHub. The software is implemented on a Raspberry Pi 3B running Ubuntu 16.04. It’s composed on C++ and Python nodes in a ROS framework.

What’s next?

Mike isn’t finished yet: they are looking to improve their yellow beast by incorporating a lidar to achieve simple 2D mapping of a room. Also on the list is developing an autonomous motion-planning module to guide the robot to execute a simple task around a sensed 2D environment. And finally, adding a camera or webcam to conduct basic image classification would finesse their creation.

The post Mini Raspberry Pi Boston Dynamics–inspired robot appeared first on Raspberry Pi.

Read more »

App note: How to monitor state-of-charge in small batteries with tiny, ultra-low-power comparators

App note from Maxim Integrated about low current and voltage battery monitors. Link here

Many of today’s portable consumer electronic devices are powered by small button or coin-cell batteries. Users, of course, expect long battery life and reliable charge-level information. However, it can be quite challenging to efficiently monitor the health and state-of-charge (SOC) of these batteries without significantly affecting said SOC. In this application note, learn how simple, low-power monitoring circuits for small batteries can address this challenge.

Read more »

Processing raw image files from a Raspberry Pi High Quality Camera

When taking photos, most of us simply like to press the shutter button on our cameras and phones so that viewable image is produced almost instantaneously, usually encoded in the well-known JPEG format. However, there are some applications where a little more control over the production of that JPEG is desirable. For instance, you may want more or less de-noising, or you may feel that the colours are not being rendered quite right.

This is where raw (sometimes RAW) files come in. A raw image in this context is a direct capture of the pixels output from the image sensor, with no additional processing. Normally this is in a relatively standard format known as a Bayer image, named after Bryce Bayer who pioneered the technique back in 1974 while working for Kodak. The idea is not to let the on-board hardware ISP (Image Signal Processor) turn the raw Bayer image into a viewable picture, but instead to do it offline with an additional piece of software, often referred to as a raw converter.

A Bayer image records only one colour at each pixel location, in the pattern shown

The raw image is sometimes likened to the old photographic negative, and whilst many camera vendors use their own proprietary formats, the most portable form of raw file is the Digital Negative (or DNG) format, defined by Adobe in 2004. The question at hand is how to obtain DNG files from Raspberry Pi, in such a way that we can process them using our favourite raw converters.

Obtaining a raw image from Raspberry Pi

Many readers will be familiar with the raspistill application, which captures JPEG images from the attached camera. raspistill includes the -r option, which appends all the raw image data to the end of the JPEG file. JPEG viewers will still display the file as normal but ignore the (many megabytes of) raw data tacked on the end. Such a “JPEG+RAW” file can be captured using the terminal command:

raspistill -r -o image.jpg

Unfortunately this JPEG+RAW format is merely what comes out of the camera stack and is not supported by any raw converters. So to make use of it we will have to convert it into a DNG file.

PyDNG

This Python utility converts the Raspberry Pi’s native JPEG+RAW files into DNGs. PyDNG can be installed from github.com/schoolpost/PyDNG, where more complete instructions are available. In brief, we need to perform the following steps:

git clone https://github.com/schoolpost/PyDNG
cd PyDNG
pip3 install src/.  # note that PyDNG requires Python3

PyDNG can be used as part of larger Python scripts, or it can be run stand-alone. Continuing the raspistill example from before, we can enter in a terminal window:

python3 examples/utility.py image.jpg

The resulting DNG file can be processed by a variety of raw converters. Some are free (such as RawTherapee or dcraw, though the latter is no longer officially developed or supported), and there are many well-known proprietary options (Adobe Camera Raw or Lightroom, for instance). Perhaps users will post in the comments any that they feel have given them good results.

White balancing and colour matrices

Now, one of the bugbears of processing Raspberry Pi raw files up to this point has been the problem of getting sensible colours. Previously, the images have been rendered with a sickly green cast, simply because no colour balancing is being done and green is normally the most sensitive colour channel. In fact it’s even worse than this, as the RGB values in the raw image merely reflect the sensitivity of the sensor’s photo-sites to different wavelengths, and do not a priori have more than a general correlation with the colours as perceived by our own eyes. This is where we need white balancing and colour matrices.

Correct white balance multipliers are required if neutral parts of the scene are to look, well, neutral.  We can use raspistills guesstimate of them, found in the JPEG+RAW file (or you can measure your own on a neutral part of the scene, like a grey card). Matrices and look-up tables are then required to convert colour from ‘camera’ space to the final colour space of choice, mostly sRGB or Adobe RGB.

My thanks go to forum contributors Jack Hogan for measuring these colour matrices, and to Csaba Nagy for implementing them in the PyDNG tool. The results speak for themselves.

Results

Previous attempts at raw conversion are on the left; the results using the updated PyDNG are on the right.

DCP files

For those familiar with DNG files, we include links to DCP (DNG Camera Profile) files (warning: binary format). You can try different ones out in raw converters, and we would encourage users to experiment, to perhaps create their own, and to share their results!

  1. This is a basic colour profile baked into PyDNG, and is the one shown in the results above. It’s sufficiently small that we can view it as a JSON file.
  2. This is an improved (and larger) profile involving look-up tables, and aiming for an overall balanced colour rendition.
  3. This is similar to the previous one, but with some adjustments for skin tones and sky colours.

Note, however, that these files come with a few caveats. Specifically:

  • The calibration is only for a single Raspberry Pi High Quality Camera rather than a known average or “typical” module.
  • The illuminants used for the calibration are merely the ones that we had to hand — the D65 lamp in particular appears to be some way off.
  • The calibration only really works when the colour temperature lies between, or not too far from, the two calibration illuminants, approximately 2900K to 6000K in our case.

So there remains room for improvement. Nevertheless, results across a number of modules have shown these parameters to be a significant step forward.

Acknowledgements

My thanks again to Jack Hogan for performing the colour matrix calibration with DCamProf, and to Csaba Nagy for adding these new features to PyDNG.

Further reading

  1. There are many resources explaining how a raw (Bayer) image is converted into a viewable RGB or YUV image, among them Jack’s blog post.
  2. To understand the role of the colour matrices in a DNG file, please refer to the DNG specification. Chapter 6 in particular describes how they are used.

The post Processing raw image files from a Raspberry Pi High Quality Camera appeared first on Raspberry Pi.

Read more »