Posts with «raspberry pi» label

Honey, I shrunk the NES… with Raspberry Pi and Arduino!

The NES was one of, if not, the first gaming consoles most of us ever played. That’s why we were all pretty excited to hear Nintendo’s recent plans of releasing the NES Classic Mini. As great as it sounds, though, turns out it’ll only support its 30 pre-loaded games–no Internet downloads, nor any cartridge slots. But leave it to a Maker to come up with a solution! Enter DaftMike, who has built his own shrunken-down, 3D-printed version of the retro system complete with some of the features we all would’ve loved to see with Nintendo’s re-creation.

The DIY system–which is 40% the size of the original–is powered by a Raspberry Pi and an Arduino. It runs on RetroPie emulation software and uses itsy-bitsy NFC tagged cartridges, ranging from Super Mario Bros. to Zelda. When a cartridge is inserted into the machine’s fully-functional slot, an NFC reader scans it, selects that specific game from the Pi’s internal memory, and boots it up onto the screen.

I designed the connections between the Arduino and Pi to use the top 10 GPIO pins so I could mount the Arduino directly to the Raspberry Pi using a 2×5 header. All the electronics would then sit in the case behind the USB ports.

The NFC reader mounts underneath the cartridge tray connected to the Arduino with a piece of flat cable. There’s enough length on it for the case halves to be splayed apart if I need to dismantle the unit and the Arduino ‘lump’ unplugs from the Pi so I can update the ‘firmware.’

DaftMike even rounded out his incredibly-realistic design with a mini, Arduino Pro Micro-based controller–although probably a bit too small for adult hands. (Cool nevertheless!)

In terms of software, an Arduino sketch is used to read the NFC tags and manage the power switching, while a Python script running on the Raspberry Pi is tasked with launching the games. The two communicate over serial.

Those wishing to spark some childhood gaming nostalgia should check out Daftmike’s entire blog post, which provides a full rundown of the build and its inner workings.

 

This Telepresence Robot from the 1800s Helps Promote Metal Shop

AR-Duo is a steampunk telepresence robot that shows off the skills and ingenuity of a school's metal shop.

Read more on MAKE

The post This Telepresence Robot from the 1800s Helps Promote Metal Shop appeared first on Make: DIY Projects and Ideas for Makers.

Lawn Da Vinci is an open-source, remote-controlled lawn mower

Inspired by the one seen in Honey, I Shrunk The Kids, Blake Hodgson has built a remote-controlled lawn mower of his own dubbed ”Lawn Da Vinci.”

The robotic machine’s frame is made from angle iron and steel, while its wheels and motors were taken from a mobility scooter. Power is supplied by a pair of 12V car batteries wired in series, and it’s driven across the yard with an RC airplane remote.

The Lawn Da Vinci has two Arduino Pro Minis and a Raspberry Pi for a brain–one Arduino is used for the motors and RC signal, the other for the kill switches. Meanwhile, the Raspberry Pi is tasked with streaming video from an attached webcam to his phone.

To improve reliability and reduce complexity, the motor driver now gets its signal directly from the RC receiver once it goes through the two relays controlled by the Arduino, which is always looking for a good signal. The Arduino and Raspberry Pi are powered off of a disassembled car cigarette lighter USB charger which takes the 12v of the batteries down to a clean 5v. I originally had it powered off of the Sabertooth but have better reliability this way. There are many ways to kill the motors.  You can turn the remote off, push the trainer button, left with the right joystick, or push a button separate key fob and all of these will kill it.

Rather not to push a mower around all summer long? Check out Hodgson’s entire project–complete with its code–on his blog here, or read more on Hackaday.

Digital Opponent In An Analog Package

Unsatisfied with the present options for chess computers and preferring the feel of a real board and pieces, [Max Dobres] decided that his best option would be to build his own.

Light and dark wood veneer on 8mm MDF board created a board that was thin enough for adding LEDs to display moves and for the 10mm x 1mm neodymium magnets in the pieces to trip the reed switches under each space. The LEDs were wired in a matrix and connected to an Arduino Uno by a MAX7219 LED driver, while the reed switches were connected via a Centipede card. [Dobres] notes that you’ll want to test that the reed switches are positioned correctly — otherwise they might not detect the pieces!

A small LCD screen and four buttons also connect to the Arduino for configuring options a number of options, computer difficulty, and play styles, while a Raspberry Pi acts as the main computer.

The Raspberry Pi is using ChessBoard 2.05 as a rule set with consideration for special moves (such as en passant and castling). It’s currently unsupported but used with permission by its creator, John Eriksson. The chess program Stockfish is the actual engine; be sure to adjust the skill of the AI, as it defaults to an ELO of 2600! Unfortunately, it’s a rather finicky program, only running on Python 2.7. If that doesn’t appeal to you, [Dobres] has provided a nice list of other options to help you with your own build.

He has recently updated his design and done away with the need for the Arduino in the process which — especially if you use the Pi Zero — drops the cost of this project significantly. That should leave you with enough room in your budget to build a robot to make the moves for you!

[via Max Dobres]


Filed under: Arduino Hacks, Raspberry Pi

A Pi Robot Without a Hat

Daughter boards for microcontroller systems, whether they are shields, hats, feathers, capes, or whatever, are a convenient way to add sensors and controllers. Well, most of the time they are until challenges arise trying to stack multiple boards. Then you find the board you want to be mid-stack doesn’t have stackable headers, the top LCD board blocks the RF from a lower board, and extra headers are needed to provide clearance for the cabling to the servos, motors, and inputs. Then you find some boards try to use the pins for different purposes. Software gets into the act when support libraries want to use the same timer or other resources for different purposes. It can become a mess.

The alternative is to unstack the stack and use external boards. I took this approach in 2013 for a robotics competition. The computer on the robots was an ITX system which precluded using daughter boards, and USB ports were my interface of choice. I used a servo controller and two motor controllers from Pololu. They are still available and I’m using them on a rebuild, this time using the Raspberry Pi as the brain. USB isn’t the only option, though. A quick search found boards at Adafruit, Robotshop, and Sparkfun that use I2C.

This approach has challenges and benefits. A stack of daughter boards makes a neat package, where external boards makes a tangle of wires. Random sizes can make mounting a challenge. Providing power can also be a hassle because of the random placement of power pins. You can’t rely on USB power, especially from a Raspberry Pi whose USB is power limited.

On the other hand, external boards can offload processing from your main processor. Once a command is sent, these boards handle all the details including refresh requirements. They are likely to provide capabilities beyond the microcontroller software libraries since their processors are dedicated to the task.

I am using an 18-channel board from the Pololu Maestro Servo Controller family of boards that control from 6 to 24 servos using a single board. You might find the Adafruit 16 channel I2C board a useful alternative. For motor control I turned to the Pololu Simple Motor Controller family using one that will handle 18 amps. Others will handle from 7 to 25 amps. Or consider the Sparkfun Serial Controlled Motor Driver. Another source for USB controllers is Phidgets. I experimented with one of their spatial devices for the original robot. I should have used it to measure the tilt since one of my robots rolled over on a hill. Ooops!

Servo Control

The board currently installed on my robot is the Mini Maestro 18. The Maestro provides control over the servo speed, acceleration and movement limits. A home position can be set for startup or when errors occur. You can even do scripting or set movement sequences to play on command.

On the hardware side, the Maestro also allows channels to be used for digital input or output, and some channels for analog input. On some there is one channel for pulse width modulation output. An onboard regulator converts the servo power input to the voltage needed by the processor, simplifying part of the power distribution challenge.

My previous robot used the Maestro to control pan and tilt servos for camera positioning, a servo to lift samples from the ground, and a safety LED. Two analog inputs from current sensors on the motors helped avoid burnout during stalls, and four inputs from a simple RF key fob transmitter provided control. The latter came in handy for testing. I’d program a test sequence such as starting a 360° camera scan for landmarks or drive onto the starting platform and drop the sample. A button press on the key fob would initiate the activity. One button was always set up as an emergency halt to stop a rampaging robot. The rebuild is following this pattern with some additions.

Motor Controller

The two Simple Motor Controllers (SMC) each handled the three motors on either side of the Wild Thumper chassis. The SMC does more than just control the motor speed and direction. You can set acceleration, braking, and whether forward and reverse operate at the same or different speeds. The board monitors a number of error conditions for safety. These stop the motor and prohibit movement until cleared. Such blocking errors include lost communications, low input voltage, or drivers overheating.

An additional capability I found extremely helpful is the ability to read signals from a radio control (RC) receiver. These signals can be used to control the motor and, with some cross wiring between two controllers, provide differential drive control. This is useful for driving the robot to a new location using an RC transmitter. I didn’t use the RC inputs directly. Instead I read the RC inputs and issued the control commands from my program. This let me monitor the speed in my program logs for correlation with the other logged data. I also used an input to command the robot into autonomous or RC control operations. There are also two analog inputs that can be used to directly control the motor and can be read through commands.

Serial Communications

USB ports were my choice for communications but there is also a TTL level serial port with the standard RX and TX pins. This port can be used by the Raspberry Pi, Arduino, or any other microcontroller that has a TTL serial port.

The Maestro boards using USB appear as two serial ports. One is the command port that communications with the Maestro processor. The other is a TTL port. This port can serve as simply a USB to TTL serial port converter to allow communications with other boards, even from another vendor. Another use of the TTL port is to daisy chain Pololu boards. I could attach the SMC boards in this manner and save two USB ports for other devices. These boards support this by having a TXIN pin that ANDs the TX signal from the connected board with the TX on the board.

Both of these controllers support a few different communications protocols. I use the one Pololu created and is available on some of their other products. The command details are different between the boards, but the basic command structure is the same. They call it their binary protocol, and the basic format follows:

0xAA, <device address>, <command>, <optional data>, <crc>

All the fields are single bytes except for the data field which is frequently 2 bytes to transmit 16-bit data. The returned data is only one or two bytes with no additional formatting. Note they provide for detecting errors in the message by using a CRC (cyclical redundancy check). This is probably not critical over USB but a TTL line might receive noise from motors, servos, and other devices. A CRC error sets a bit in the error register that can be read if the command is critical.

I wrote my own code, C++ of course, for the PC and converted it just now to the Raspberry Pi. The main change is the different serial port code needed by Linux and Windows. Pololu now provides Arduino source for the protocol making it easy to use these boards with that family of controller boards.

Wrap Up

The chassis, Pi, and these boards are now installed on the Wild Thumper chassis along with a pan and tilt controlled by servos. A safety LED is on when power is applied and flashes when the robot is actively controlling the system. A LiPo battery powers all but the Pi because I need to configure a battery eliminator circuit to provide five volts. I’m powering it temporarily using a USB battery pack.

A test program, cross compiled from my desktop, moves the robot forward, pivots left than right, and then reverses. The pan / tilt moves and the LED flashes. I originally used a web camera for vision processing but will switch to the Pi camera since it is better. The Neato lidar discussed in a previous article will soon find a place onboard, along with an accelerometer to detect possible rollovers.

I’m sure I could have done this using Pi daughter boards despite the challenges I mentioned earlier. There are trade-offs to both approaches that need to be considered when working on a project. But there is one final advantage to the external boards: they have a lot of twinkly LEDs.

Product photos from Pololu.


Filed under: Arduino Hacks, Raspberry Pi, robots hacks

Raspberry Pi Gets Turned On

The Raspberry Pi and other similar Linux-based single board computers simplify many projects. However, one issue with Linux is that it doesn’t like being turned off abruptly. Things have gotten better, and you can certainly configure things to minimize the risk, but–in general–shutting a Linux system down while it is running will eventually lead to file system corruption.

If your project has an interface, you can always provide a shutdown option, but that doesn’t help if your application is headless. You can provide a shutdown button, but that leaves the problem of turning the device back on.

[Ivan] solved this problem with–what else–an Arduino (see the video below). Simplistically, the Arduino reads a button and uses a FET to turn off the power to the Pi. The reason for the Arduino, is that the tiny processor (which draws less than a Pi and doesn’t mind being shut down abruptly) can log into the Pi and properly shut it down. The real advantage, though, is that you could use other Arduino inputs to determine when to turn the Pi on and off.

For example, it is easy to imagine a Pi in an automotive application where the Arduino would sense the ignition was off for a certain period of time and then go ahead and shut off the Pi. Or maybe the Pi needs to be turned on when a motion sensor fires and then turned off again once there is no motion for a particular time period. Any of these strategies would be simple to build with the Arduino.

We’ve seen a similar project that used an IR remote as the trigger instead of a physical button. If you are afraid the Pi will just lose power unexpectedly, you might consider a battery backup. If powering a Pi with regular electricity is too tame for you, try steam.


Filed under: Arduino Hacks, Raspberry Pi

Would you like to invite my robot to visit your location on it's tour around the globe?

Primary image

What does it do?

Remote controlled through web interface

The idea in short:
I will send a robot around planet earth. The robot will be sent to you free of charge. Let it run in your area for 24h and show all earthlings your projects or a piece of your country. Send the rover to the next destination after your mission is over (postal charges will be refunded).
The robot can be controlled through a web interface while transmitting a live video stream. All young scientist and of course all discoverers that are young at heart get free access to the robots, there is even no registration needed.

Cost to build

$200, 00

Embedded video

Finished project

Number

Time to build

20 hours

Type

wheels

URL to more information

Weight

3300 grams

read more

Maker hacked his car’s dashboard to display Shower Thoughts

The Shower Thoughts subreddit is a collection of all those ideas or philosophical questions that race through your mind while in the bathroom. For example, “I like to think money wouldn’t change me; yet when I’m winning Monopoly I’m a terrible person,” or “12 years ago leaving CDs out in my car gave theives a reason to break in. Today, leaving CDs out is a deterrent.”

While most folks would simply browse Reddit on their phones or laptops, Harin De Mel decided to something a bit different. He managed to hack his vehicle’s dashboard to display some of the best thoughts from the last hour. Not a bad idea for when you’re stuck in traffic or sitting in the car waiting for someone to come outside, right?

The Maker sniffed the CAN bus on his 2012 Hyundai Genesis, and isolated the LCD from the rest of the network. He used Raspberry Pi and an Arduino, both of which are interfaced with an MCP2515 — one for the display, the other to receive signals from the original network. A Wi-Fi dongle on the Raspberry Pi enables Internet connectivity.

De Mel was also able to make the text scroll, which was accomplished through the CAN bus. However, Python script on the Raspberry Pi provided more control on how fast or frequently the message would come across the screen.

Now that I have a better understanding of how the LCD is controlled, I want to use the screen for more useful information. I have an in-dash Nexus 7 and would like to parse the information of the currently playing track to the car’s system as if it was an iPod. Frank Zhao was kind enough to leave a comment on my previous post pointing me in the direction of the Apple Accessories Protocol (AAP) which I will also begin to tinker with at some point in the future.

The code for the project is available on GitHub, and you can read more about the build on his blog. In the meantime, check out the video below to see it all in action.

Hack Your Car’s Dashboard to Display Reddit Shower Thoughts

Harin De Mel could have hacked his car to display something "useful", but where's the challenge in that? Shower thoughts, it is!

Read more on MAKE

The post Hack Your Car’s Dashboard to Display Reddit Shower Thoughts appeared first on Make: DIY Projects and Ideas for Makers.

Turn Your Electronics Project into a Sellable Product

Do you dream of developing a hot, new hardware gadget and bringing it to market? Maybe your goal is to make the world better with your product, or perhaps you just want to get filthy rich selling your product. Developing a project prototype using an Arduino, Raspberry Pi, or other […]

Read more on MAKE

The post Turn Your Electronics Project into a Sellable Product appeared first on Make: DIY Projects and Ideas for Makers.