Monthly Archives: August 2019

Friday Product Post: Shoot for the Moon with Artemis!

via SparkFun: Commerce Blog

Hello and welcome, everyone! It's Friday, once again, and we have a few new products to talk about that were released this last Wednesday as well as the announcement of TWO WEEKS OF FREE! So in case you missed it, we released our official, FCC Certified Artemis Module and accompanying RedBoards on the 28th to a fair amount of fanfare but we recognize that a lot of you don't expect product releases from us that early in the week, so we wanted to talk about each of them individually!


Before we get to Artemis, though, we need to talk about our Two Weeks of Free Event that starts today! Are you ready to get your hands on some free gear? Better get ready, because we sense some good deals that might move Qwiic-ly. (See what we did there?) This year, we’re going to have two weeks of free gear. Both weeks will feature different items and you get to choose from among them. Think of it like a Choose Your Own Adventure, but with boards and sensors.

Week One: Purchase either the Artemis RedBoard (yes, the new one) or the Qwiic RedBoard and pick one of three sensors (listed below) to get for free! This week of free will end next Thursday, September 5 at 11:59pm MT. You can also find out more at our Two Weeks of Free Info Page!

Some reminders to keep it fun for everyone before we get to the good stuff:

  • It’s Labor Day weekend and we’ll be closed on Monday. Orders will ship when we return.
  • If you don’t have some, be sure to throw some Qwiic cables in your cart to get your new project up and running.
  • Only one promo code can be used per customer, per week.
  • Must have your RedBoard and Qwiic board in your cart before adding promo code.
  • Orders utilizing promo codes cannot be combined with other orders for shipping.
  • Offer is good while supplies last. No rainchecks. No backorders.
  • If items are returned in an order using a promo code resulting in the order total being below the threshold for use of the promo code, the full price of items in the order will be applied.
  • Offer for customer roles only
SparkFun Ambient Light Sensor - VEML6030 (Qwiic)

SparkFun Ambient Light Sensor - VEML6030 (Qwiic)

SEN-15436
$4.95
SparkFun Human Presence Sensor Breakout - AK9753 (Qwiic)

SparkFun Human Presence Sensor Breakout - AK9753 (Qwiic)

SEN-14349
$25.95
2
SparkFun Environmental Combo Breakout - CCS811/BME280 (Qwiic)

SparkFun Environmental Combo Breakout - CCS811/BME280 (Qwiic)

SEN-14348
$35.95
12

Use Code FD19P1 for the VEML6030 Ambient Light Sensor, FD19P2 for the AK9753 Human Presence Sensor, and FD19P3 for the CCS811/BME280 Environmental Combo Breaakout

Alright! Let's look at Artemis!


Fully certified and ready for any product!

SparkFun Artemis Module - Low Power Machine Learning BLE Cortex-M4F

SparkFun Artemis Module - Low Power Machine Learning BLE Cortex-M4F

WRL-15484
$8.95

The fully FCC/IC/CE certified Artemis Module from SparkFun is a Cortex-M4F with BLE 5.0 running up to 96MHz and with as low power as 6uA per MHz (less than 5mW). This is the world's first module to bridge the market between hobbyists and consumer products. We've packaged all the power of a modern microcontroller into a module that is both extremely easy to use but is mass-market ready.


Three new Artemis RedBoards!

SparkFun RedBoard Artemis

SparkFun RedBoard Artemis

DEV-15444
$19.95

Think of the RedBoard Artemis as just another Arduino... That has BLE. And one megabyte of flash. And runs at less than 1mA. Oh, and it can run TensorFlow models. Ya, that too. The RedBoard Artemis takes the incredibly powerful Artemis module from SparkFun and wraps it up in an easy to use and familiar Uno footprint. We've written an Arduino core from scratch to make programming the Artemis as familiar as Serial.begin(9600). Time-to-first-blink is less than five minutes.


SparkFun RedBoard Artemis Nano

SparkFun RedBoard Artemis Nano

DEV-15443
$14.95

We like to joke the Artemis Nano is a party on the front and business on the back. And that's by design! All the important LEDs, connectors, labels, and buttons are presented on the front for the best user experience with all the supporting circuitry on the rear of the board. The RedBoard Artemis Nano is a minimal but extremely handy implementation of the Artemis module. A light weight, 0.8mm thick PCB, with on board LiPo-battery charging and a Qwiic connector, this board is easy to implement into very small projects. A dual row of ground connections make it easy to add lots of buttons, LEDs, and anything that requires its own GND connection. At the same time, the board is breadboard compatible if you solder the inner rows of pins.


SparkFun RedBoard Artemis ATP

SparkFun RedBoard Artemis ATP

DEV-15442
$24.95

The RedBoard Artemis ATP is affectionately called 'All the Pins!' at SparkFun. The Artemis module has 48 GPIO and this board breaks out absolutely every one of them in a familiar Mega like form factor. What's with the silkscreen labels? They're all over the place. We decided to label the pins as they are assigned on the Apollo3 IC itself. This makes finding the pin with the function you desire a lot easier. Have a look at the full pin map from the Apollo3 datasheet. If you really need to test out the 4-bit SPI functionality of the Artemis you're going to need to access pins 4, 22, 23, and 26. Need to try out the differential ADC port 1? Pins 14 and 15. The RedBoard Artemis ATP will allow you to flex the impressive capabilities of the Artemis module.


That's it for this week but we are planning even more Artemis boards to release in the next few weeks, so make sure to check back! 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!

comments | comment feed

Recreate Super Sprint’s top-down racing | Wireframe issue 21

via Raspberry Pi

Making player and computer-controlled cars race round a track isn’t as hard as it sounds. Mark Vanstone explains all.

The original Super Sprint arcade machine had three steering wheels and three accelerator pedals.

From Gran Trak 10 to Super Sprint

Decades before the advent of more realistic racing games such as Sega Rally or Gran Turismo, Atari produced a string of popular arcade racers, beginning with Gran Trak 10 in 1974 and gradually updated via the Sprint series, which appeared regularly through the seventies and eighties. By 1986, Atari’s Super Sprint allowed three players to compete at once, avoiding obstacles and collecting bonuses as they careened around the tracks.

The original arcade machine was controlled with steering wheels and accelerator pedals, and computer-controlled cars added to the racing challenge. Tracks were of varying complexity, with some featuring flyover sections and shortcuts, while oil slicks and tornadoes posed obstacles to avoid. If a competitor crashed really badly, a new car would be airlifted in by helicopter.

Code your own Super Sprint

So how can we make our own Super Sprint-style racing game with Pygame Zero? To keep this example code short and simple, I’ve created a simple track with a few bends. In the original game, the movement of the computer-controlled cars would have followed a set of coordinates round the track, but as computers have much more memory now, I have used a bitmap guide for the cars to follow. This method produces a much less predictable movement for the cars as they turn right and left based on the shade of the track on the guide.

Four Formula One cars race around the track. Collisions between other cars and the sides of the track are detected.

With Pygame Zero, we can write quite a short piece of code to deal with both the player car and the automated ones, but to read pixels from a position on a bitmap, we need to borrow a couple of objects directly from Pygame: we import the Pygame image and Color objects and then load our guide bitmaps. One is for the player to restrict movement to the track, and the other is for guiding the computer-controlled cars around the track.

Three bitmaps are used for the track. One’s visible, and the other two are guides for the cars.

The cars are Pygame Zero Actors, and are drawn after the main track image in the draw() function. Then all the good stuff happens in the update() function. The player’s car is controlled with the up and down arrows for speed, and the left and right arrows to change the direction of movement. We then check to see if any cars have collided with each other. If a crash has happened, we change the direction of the car and make it reverse a bit. We then test the colour of the pixel where the car is trying to move to. If the colour is black or red (the boundaries), the car turns away from the boundary.

The car steering is based on the shade of a pixel’s colour read from the guide bitmap. If it’s light, the car will turn right, if it’s dark, the car will turn left, and if it’s mid-grey, the car continues straight ahead. We could make the cars stick more closely to the centre by making them react quickly, or make them more random by adjusting the steering angle more slowly. A happy medium would be to get the cars mostly sticking to the track but being random enough to make them tricky to overtake.

Our code will need a lot of extra elements to mimic Atari’s original game, but this short snippet shows how easily you can get a top-down racing game working in Pygame Zero:

Here’s Mark’s code, which gets a Super Sprint-style racer running in Python. To get it working on your system, you’ll first need to install Pygame Zero. And to download the full code, go here.

Get your copy of Wireframe issue 21

You can read more features like this one in Wireframe issue 21, available now at Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy Wireframe directly from Raspberry Pi Press — delivery is available worldwide. And if you’d like a handy digital version of the magazine, you can also download issue 21 for free in PDF format.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to news stand pricing!

The post Recreate Super Sprint’s top-down racing | Wireframe issue 21 appeared first on Raspberry Pi.

Labor Day Sale 2019

via Pololu Blog

We are having a Labor Day sale through Tuesday, September 3! Check out the sale page for more information. Please note that we will be closed Monday, September 2, so orders placed after 2 PM Pacific Time Friday, August 30th will be shipped on Tuesday, September 3.

Enginursday: Housing Fixtures

via SparkFun: Commerce Blog

Connected devices have always held one appealing characteristic to me; making life easier. In recent months, I've added a number of connected devices to my house, most of them home automation related. while most are minor conveniences, one, in particular, has solved a huge problem for me, but in doing so has presented a new problem. In this Enginursday, electronics and 3d printing help me cover my outdoor connected outlet from precipitation.

I both hate and love living in a Townhouse. On the one end, upkeep is minimal, on the other end, It's a jungle of red tape when I want to change/fix something on the exterior of the house. A poor drainage design has lead to my window well filling with water during heavy rainstorms. It's not something I can readily fix, yet it can't go unattended as it will leak into my basement if it gets too high. My solution has been a pump made for situations like this, fashioned into a makeshift sump pump. The pump has a float switch which, once powered on, will only run the pump when liquid is above the 1-inch mark. While it's very capable and solves the problem, it presents a new problem. The pump's manufacturer recommends not leaving the pump powered while idle for longer periods of time (weeks). To keep the one thing keeping my basement dry happy, I only plug it in on days where I think it's going to rain. Here in Colorado, that can be highly unpredictable. Some days I leave it unplugged, then a rainstorm will spring up in the afternoon. I'll have to drive home from work, plug the pump in, then drive back. After tolerating this possibility for a little too long, I decided a smart switch would be a good addition. The ability to control the pump remotely has proved to be an excellent way to spend $50.

The smart plug from Kasa (TP-LINK) plugs into my existing outdoor outlet, but has a pretty novel way keeping the plug part dry. In addition to rubber covers over the outlet port, it hangs off the outside outlet similar to a drooping flower. This keeps the outlets facing down and away from precipitation. Despite this, I still fear a situation where water might get in and cause the plug to act erratically. There's currently a small piece of acrylic covering the house-mounted outlet, but it doesn't cover the smart outlet as well. So I figure if I'm 3D printing a better cover, why not make it the best it could be; add some self-sufficient lighting as well? (Congratulations, if you've gotten this far, you've reached the bottom of the rabbit hole of this dilemma.)

Current Outlet Cover

While it works for just the outlet, the current cover falls a bit short of covering the new smart plugs.

So to fully define the project. I want a device that will direct precipitation away from the house and outlets while providing a lit view of the outlets. This system should be self-powered (I'd rather not lose an outlet to powering this) and illuminate the outlets only when necessary. This breaks this project into two smaller projects; an electronic setup that will work well for most solar-powered lighting projects and the enclosure for such. I'll use an Arduino Pro Mini and the Sunny Buddy as well as a mini photocell and 3.5W solar panel for the electronics, but there are many ways that you can configure this project.

3D Printing

Ah, our old friend the 3D printer will come in handy here. The design is fairly simple, we want a roof-like structure to go over the outlet that will direct water away from the side of the house and the outlet. It'll need somewhere to store the MPPT Tracker for the Solar Panel and the Pro Mini controlling the LEDs and reading the ambient light sensor. The "roof" will have a way of keeping the solar panel securely in place. Finally, holes on the underside to mount the LEDs and a hole on the side for the photocell to properly detect the ambient light. This is definitely a structure that can be done with the laser cutter, but I feel this 3D printed part will make for a cleaner solution. I'll provide this direction for the structure, but stop short of providing the files for you. The big reason is I want to utilize the screw holes that are already in my siding, so not only does it not look right, but it probably won't work for your own application. If you really want the file, send me a private message.

The final design looks like this:

Redered View of Outlet Hood

There's 1 hole on the "roof" part which is a port for the solar panel's cable.

Rear View of the Outlet Hood

The shelf inside the structure will hold all the electronics with the exception of the solar panel.

It should keep everything dry and happy while providing a clean mounting point for the solar panel. Again, I'm not happy about the mounting points of the structure, but I'd be less happy with more holes in the siding on my house.

Electronics

The electronics are fairly simple; A Pro Mini, Sunny Buddy, 3.5W Solar Panel, Mini Photocell, 3 Super Bright White LEDs (5mm), and 3.3V Lipo Battery. In addition, you'll want wires and connectors for hooking everything up. You'll notice most of my projects use connectors and more temporary wiring solutions. When you have a clean enclosure for a project, you can sacrifice some of the cleanliness of the wiring in the interest of making parts more reusable/swappable. Finally, don't be lazy like me, use current limiting resistors on your LEDs to keep them happy and healthy. Also, a 4.7kΩ Resistor is needed for the voltage divider circuit for the photocell.

The LEDs will each be hooked up to their own digital pins on the Arduino (though you could do one I/O pin, this offers a bit more configurability). The Mini Photocell connects to one of the analog pins. But before that happens, I need to figure out some base readings for the light in the area this will be in. Using the hookup guide for the Mini Photocell I'm able to get proper readings for the day, shade, dusk, and night. I really only want an on/off configuration, but with each LED having their own pin, the potential for different lighting for different situations (if you use PWM pins, you can add dimming to the configurability). With the readings I want for day/night, I can set the threshold for our if-then statement in our code below:

//Illuminated Outdoor Outlet Cover. Most of this code was derived from         Hookup Guides on SparkFun.com for the various parts used.

const float VCC = 3.22; //Measured Voltage of Pro Mini Pin.
const float rVal = 4650; //Measured Resistance of 4.7 Ohm resistor.

const float DARK_THRESHOLD = 10000.0; //Threshold for light and dark, the one from the hookup guide for the Photocell works well.

void setup() {
  // Set pins to control 3 White LEDS individually (set both power and             ground pins as an output):
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);

  //Set the Pin Connected to the Photocell Voltage Divider output as an          input.
  pinMode(A0, INPUT);
 }

 void loop() {

  digitalWrite(3, LOW);
  digitalWrite(5, LOW);
  digitalWrite(7, LOW);

  //Read Photocell and Calculate

  int sensorVal = analogRead(A0); //Get the sensor reading.
  if (sensorVal > 0) {
    float photoV = sensorVal * VCC / 1023.0;
    float photoR = rVal * (VCC / photoV - 1.0); // Calculate the resistance at current reading.

    if (photoR >= DARK_THRESHOLD) {
      digitalWrite(2, HIGH);
      digitalWrite(4, HIGH);
      digitalWrite(6, HIGH);
    }
    else
      digitalWrite(2, LOW);
      digitalWrite(4, LOW);
      digitalWrite(6, LOW);
  } //If the resistance is above the threshold turn on the LEDs
  delay(60000); //Check reading every 60 seconds.
 }

Now the Photocell gets hooked up to the Pro Mini. The 4.7kΩ Resistor mentioned above gets hooked to the ground wiring as shown in the Hookup Guide here.

The LEDs and Photocell in Place in the Structure

As you can see, it's a tight fit in there, but everything fits fine (just not the most visually appealing

Once the code is loaded and ready to go on the Pro Mini and the Photocell and LEDs are hooked up, we can turn our attention to the Sunny Buddy. For this use, it's very plug and play. Before plugging things in, it's important to set the input current limit. Our Sunny Buddy Hookup Guide has a good section on how to do it and why. Once that's complete setup consists of plugging in the solar panel and powering the Pro Mini through the "Load" pins. For what I'm looking for out of the project, it is complete at this point. However, there's much more that can be done with a setup like this.

The Real World Test

Outlet Hood being held in place.

I should mention the filament color is because someone forgot to order more Chroma Strand Black ABS for the department (it was me, I forgot to order more).

Of course, I always think everything is going to be a breeze and go perfectly, so I never leave room for error. If it isn't clear yet, this is a section on my mistakes (lessons to take into account for you the reader). The finished product looks great. Well, 2/3rds of the finished product looks great. I had some issued with some warping on the print which is easily fixable, but I didn't have the time to do so. I'll update photos later with the final print. I also broke one of the crucial rules of electronics projects; test before you glue. For this reason, only 2/3rds of the LEDs function correctly. But to refer back to my choice to use connectors rather than soldering wires, this will prove to be a small issue in the long run.

In something I refuse to take the blame for, I was unable to actually mount the structure as well. What I thought was the screws holding the current precipitation blocker in place (see the first photo) only holds the acrylic to the woodblock underneath. There are two screws on the underside of the wood that holds it to the side of the house. This will take a bit of redesign in the CAD program, but again is not the end of the world. Still, the lesson here is make sure you fully understand how you're mounting a part you're designing before doing so.

Beyond that, everything else functions as expected. I will be adding weatherstripping to the side of the structure that touches the siding.

comments | comment feed

Raspberry Pi 4: a full desktop replacement?

via Raspberry Pi

The MagPi magazine puts Raspberry Pi 4 to the ultimate test as writer and all-round tech tinkerer PJ Evans uses it for a week as his desktop computer.

When Raspberry Pi 4 was launched earlier in 2019, the significant improvements in processor speed, data throughput, and graphics handling lead to an interesting change of direction for this once humble small computer. Although it’s impressive that you can run a full Linux operating system on a $35 device, a lot of people were just using their Raspberry Pi to get Scratch or Python IDLE up and running. Many people were skipping the graphical side altogether and using smaller models, such as Raspberry Pi Zero, for projects previously covered by Arduino and other microcontrollers.

Raspberry Pi desktop experience

Raspberry Pi 4 was different. Tellingly, the Raspberry Pi Foundation released a new all-in-one kit and named it the Desktop Kit. For the first time truly in Raspberry Pi history, the new model was considered powerful enough to be used as a daily computer without any significant compromise. Challenge accepted. We asked PJ Evans to spend a week using a Raspberry Pi 4 as his only machine. Here’s what happened.

Day 1 | Monday

Decisions, decisions

Our new favourite single-board computer comes in a selection of RAM sizes: 1GB, 2GB, or 4GB. Given a price difference of £20 between the 1GB and 4GB versions, it made sense to go right for the top specification. That’s the version included in the official Desktop Kit that I went out and bought for £105 (inc. VAT) at the official Raspberry Pi store; it normally retails for $120 plus local taxes. My last laptop was £1900. I’m not suggesting that the two can be reasonably compared in terms of performance, but £1795 minus the cost of a monitor is a difference worth remarking upon.

Back at the office, I inspected the contents. For your money you get: a 4GB version of Raspberry Pi 4, thoughtfully already installed in the new official case; the official keyboard and mouse; the new USB-C power supply; a 16GB microSD card preloaded with the Raspbian Buster operating system; and a copy of The Official Raspberry Pi Beginner’s Guide 252-page book. It’s very well packaged and presented, with little plastic waste. The book is the icing on the cake if you are looking at this set for a young person’s first computer, short-circuiting the ‘now what do I do?’ stage. What pleased me, in particular, was the inclusion of two micro-HDMI cables in the kit, allowing me to set up a dual-screen system without delay.

First tests

I set up my new workstation next to my existing laptop, with two 1080p monitors that only had DVI connectors, so I had to get a couple of £2 adapters and an additional cable to get sound out of the audio jack of my Raspberry Pi. Time for an initial test-drive. Booting up into Raspbian Buster was quick, about ten seconds, and connection to WiFi easy. There’s no doubting the feel of the speed improvements. Yes, I’ve read all the benchmark tests, but I wanted to know how that translates to user experience. This new kit does not disappoint.

Raspbian has matured impressively as an OS. For my daily desktop scenario, the jewel in the crown is Chromium: having such a capable web browser is what makes this whole experiment feasible. Others have upped their game, too: Firefox has come a long way, and many other browsers are now available, such as Vivaldi. A check of some of my most visited sites showed Chromium to be just as capable as Chrome on my regular machine. Unsurprisingly, it wasn’t as snappy and I hit a few bumps, but we’ll get to that.

A day of impressions

I’m no expert when it comes to GPUs, but I was impressed with the dual-monitor support. The setup worked first time and didn’t seem to have any detrimental effect on the machine’s performance. I was expecting slow window drawing or things getting ‘stuck’, but this wasn’t the case.

By the end of the first day, I was getting used to the keyboard and mouse too. They are a nice mixture of being both functional and aesthetically pleasing. The keyboard comes with a three-port hub, so you can connect the mouse if you wish. It does not have the build quality and precision of my daily wireless keyboard and trackpad, but for a fraction of the price, I was surprised how much I got for my money. By the end of the week, I’d grown quite fond of it.

Day 2 | Tuesday

Back to basics…


If you’d like to see what PJ got up to for the rest of his week spent using Raspberry Pi as a desktop replacement, head over to The MagPi magazine’s website, where you can either buy the magazine with international home delivery or download the PDF for FREE!

The MagPi magazine is also available from most high street newsagents in the UK, or from the Raspberry Pi store in Cambridge.

What we’re trying to say, dear reader, is that there is absolutely no reason for you not to read the rest of this article. And when you have, let us know what you thought of it in the comments below.

And while we have your attention, here’s the latest video from The MagPi — a teaser of their review for the rather nifty RockyBorg, available now from PiBorg.

RockyBorg: the £99 Raspberry Pi robot!

Power. Performance. Pint-sized. The new RockyBorg has it all. Read our review in The MagPi 85: https://magpi.cc/get85 Would you like a FREE #RaspberryPi? Subscribe today to twelve months print subscription! You can see all our subscription offers on The MagPi magazine website: https://magpi.cc/subscribe

The post Raspberry Pi 4: a full desktop replacement? appeared first on Raspberry Pi.

Help us make it easier for you to design products with Raspberry Pi

via Raspberry Pi

We want to improve the way we support companies that design with Raspberry Pi computers, and we need your help to do it.

Raspberry Pi’s success is thanks to the community that exists around it.  When we launched Raspberry Pi 4, our most powerful computer yet, we gave our community the chance to ask our engineers all about the new product.

A shiny Raspberry Pi 4 on a flat white surface, viewed at an angle

Now we’d like to turn the tables and ask you some questions as we work to improve the support we offer to people and organisations that design using Raspberry Pi.

If you have experience of designing products or industrial solutions that use Raspberry Pi, we would love to hear from you.

Raspberry Pi in products

Raspberry Pi has been used to power products from Compute Module-based industrial controllers made by Kunbus

Three smart, compact orange and grey RevPi Core 3 enclosures mounted on a din rail

…to Raspberry Pi-based washing machines with Raspberry Pi touchscreen displays from Marathon.

Sleek-looking charcoal grey washing machine with a dark red door trim and a large colour display screen

Organisations are increasingly using various kinds of Raspberry Pi computer to power products and solutions, and we want to do more to support designers.

Please help us!

If you have experience as a design consultancy that uses Raspberry Pi computers in products, or if you have used a designer to build a product that includes a Raspberry Pi, we would love to talk to you about it. You will help shape what we offer in the future, and make designing products with Raspberry Pi simple, quick, and powerful.

Get in touch

If you use Raspberry Pi in products or in industrial solutions, I want to talk to you. Please fill in this form with a few details of your experience so we can talk more.

The post Help us make it easier for you to design products with Raspberry Pi appeared first on Raspberry Pi.