Posts | Comments

Planet Arduino

Archive for the ‘Microcontroller’ Category

The Spresense development board is Sony’s debut into the Maker market for microcontrollers, and it’s an impressive one.

Read more on MAKE

The post A First Look at Sony’s Spresense appeared first on Make: DIY Projects and Ideas for Makers.

How do you tell how much load is on a CPU? On a desktop or laptop, the OS usually has some kind of gadget to display the basics. On a microcontroller, though, you’ll have to roll your own CPU load meter with a few parts, some code, and a voltmeter.

We like [Dave Marples]’s simple approach to quantifying something as complex as CPU load. His technique relies on the fact that most embedded controllers are just looping endlessly waiting for something to do. By strategically placing commands that latch an output on while the CPU is busy and then turn it off again when idle, a PWM signal with a duty cycle proportional to the CPU load is created. A voltage divider then scales the maximum output to 1.0 volt, and a capacitor smooths out the signal so the load is represented by a value between 0 and 1 volt. How you display the load is your own choice; [Dave] just used a voltmeter, but anything from an LED strip to some kind of audio feedback would work too.

Still just looking for a load meter for your desktop? Take your pick: an LED matrixold-time meters, or even Dekatrons.


Filed under: Arduino Hacks

Sometimes less is more. This is especially true when dealing with microcontrollers with limited I/O pins. Even if you have lots of I/O, sometimes you are need to pack a lot into a little space. [Hugatry] was inspired by the simple interface found on a lot of flashlights: one button. Push it and it turns on. Push it again, and it switches modes. You cycle through the modes until you finally turn it back off. One button provides mutliple functions. The question is how can you use a power switch as an I/O device? After all, when you turn the power off, the microprocessor stops operating, right?

[Hugatry’s] answer is quite simple. He connects a resistor/capacitor network to an I/O pin (or multiple pins). When the processor turns on initially, the pin will read low and the capacitor will charge up. If you turn the power off, the CPU voltage will fall rapidly to zero, but the voltage on the capacitor will discharge slower. If you wait long enough and turn the power on, there’s no difference from that first power on event. But if you turn the power on quickly, the capacitor voltage will still be high enough to read as a logic one.

What that means is that the processor as part of its start up can detect that it was recently turned off and take some action. If it remembers the previous state in nonvolatile memory, you can have the code cycle through multiple states, just like a flashlight. You can see a video of the setup, below.

[Hugatry] included some simple Arduino code that illustrates the concept. However, the technique is simple enough that you can adapt it to other projects easily.

Think one button isn’t enough to do anything interesting? Think again. Then again, Amazon probably has a patent on things with one button.


Filed under: Arduino Hacks, Microcontrollers

IMG_6024Shields are great for connecting external circuits to your microcontroller board. In this project, you'll learn to make your own custom shields for Arduino.

Read more on MAKE

The post How to Make Custom Shields for Your Microcontroller Board appeared first on Make: DIY Projects, How-Tos, Electronics, Crafts and Ideas for Makers.

Jun
02

Optimizing AVR LCD Libraries

arduino hacks, AVR, C, LCD, Microcontroller, microcontrollers, SPI, TFT, TFT Display Comments Off on Optimizing AVR LCD Libraries 

A while ago, [Paul Stoffregen], the creator of the Teensy family of microcontrollers dug into the most popular Arduino library for driving TFT LCDs. The Teensy isn’t an Arduino – it’s much faster – but [Paul]’s library does everything more efficiently.

Even when using a standard Arduino, there are still speed and efficiency gains to be made when driving a TFT. [Xark] recently released his re-mix of the Adafruit GFX library and LCD drivers. It’s several times faster than the Adafruit library, so just in case you haven’t moved on the Teensy platform yet, this is the way to use one of these repurposed cell phone displays.

After reading about [Paul]’s experience with improving the TFT library for the Teensy, [Xark] grabbed an Arduino, an LCD, and an Open Workbench Logic Sniffer to see where the inefficiencies in the Adafruit library were. These displays are driven via SPI, where the clock signal goes low for every byte shifted out over the data line. With the Adafruit library, there was a lot of wasted time in between each clock signal, and with the right code the performance could be improved dramatically.

The writeup on how [Xark] improved the code for these displays is fantastic, and the results are impressive; he can fill a screen with pixels at about 13FPS, making games that don’t redraw too much of the screen at any one time a real possibility.


Filed under: Arduino Hacks, Microcontrollers

[Piotr] was working on a recent Arduino project when he ran into a problem. He was having trouble getting his Arduino Pro Mini to communicate with an ESP8266 module. He needed a way to snoop on the back and forth serial communications. Since he didn’t have a specialized tool for this task, [Piotr] ended up building his own.

The setup is pretty simple. You start with a standard serial cable containing the TX, RX, DTR, and GND wires. This cable connects the Arduino to the ESP8266 WiFi module. The TX and RX lines are then tapped into. Each wire is routed to the RX pin of two different serial to USB adapters. This way, the data being sent from the Arduino shows up on one COM port and the data being transmitted from the module shows up on the other.

The next piece of the puzzle was coming up with a way to see the data more clearly. [Piotr] could have opened two serial terminals simultaneously, but this wasn’t ideal because it would be difficult to compare the timing of the data. Instead, [Piotr] spent less than an hour writing his own simple serial terminal. This one connects to two COM ports at the same time and prints the data on the same screen. The data from each COM port is displayed in a separate color to make it easy to differentiate. The schematic and source code to this project can be found on [Piotr’s] website.


Filed under: Arduino Hacks, Microcontrollers
Apr
22

LightBlue Bean – Zero wires. Infinite uses

arduino, bluetooth, LightBlue Bean, Microcontroller, smartphone Comments Off on LightBlue Bean – Zero wires. Infinite uses 

iphone-and-bean-side-by-side

The LightBlue Bean is a low energy Bluetooth Arduino microcontroller. Using Bluetooth 4.0, it is programmed wirelessly, runs on a coin cell battery, and is perfect for smartphone controlled projects.

SAN FRANCISCO and MINNEAPOLIS April 20, 2015 Punch Through Design, a hardware and software development firm making it easier to develop Bluetooth Low Energy products, announced that the company?s popular LightBlue Bean has been used to create the winning device at the Bluetooth World Hack Challenge.

LightBlue Bean – Zero wires. Infinite uses - [Link]

Feb
17

Sometimes it is a blessing to have some spare time on your hands, specially if you are a hacker with lots of ideas and skill to bring them to life. [Matt] was lucky enough to have all of that and recently completed an ambitious project 8 months in the making – a Non-Arduino powered by the giant of computing history – Intel’s 8086 processor. Luckily, [Matt] provides a link to describe what Non-Arduino actually means; it’s a board that is shield-compatible, but not Arduino IDE compatible.

He was driven by a desire to build a single board computer in the old style, specifically, one with a traditional local bus. In the early days, a System Development Kit for Intel’s emerging range of  microprocessors would have involved a fair bit of discrete hardware, and software tools which were not all too easy to use.

Back in his den, [Matt] was grappling with his own set of challenges. The 8086 is a microprocessor, not a microcontroller like the AVR, so the software side of things are quite different. He quickly found himself locking horns with complex concepts such as assembly bootstrapping routines, linker scripts, code relocation, memory maps, vectors and so on. The hardware side of things was also difficult. But his goal was learning so he did not take any short cuts along the way.

[Matt] documented his project in detail, listing out the various microprocessors that run on his 8OD board, describing the software that makes it all run, linking to the schematics and source code. There’s also an interesting section on running Soviet era (USSR) microprocessor clones on the 8OD. He is still contemplating if it is worthwhile building this board in quantities, considering it uses some not so easy to source parts. If you are interested in contributing to the project, you could get lucky. [Matt] has a few spares of the prototypes which he is willing to loan out to anyone who can can convince him that they could add some value to the project.

Thanks for the tip, [Garrett]


Filed under: Arduino Hacks, Microcontrollers
Feb
07

Basic Mobile Robot with Autotravel Configuration

arduino, Microcontroller, Robots, Sensor Comments Off on Basic Mobile Robot with Autotravel Configuration 

The design is small scale mobile robot. The robot has two wheels that optimizes direction control and rotation. It is simple and low cost compared to other robotic designs. It is accurate and reliable with three sensors, which accuracy can still be increased with additional sensor pair.

The circuit is comprised of an Arduino Uno microcontroller, which serves as the main board of the system. It handles the complete integration of the system. The distance sensors serves as the eyes of the robot, which are three pairs for accuracy and faster obstacle sensing. The motors drives the two wheels independently, each has its own wheel to drive. The transistors that is connected to the motor are used as a switch of the motor as the microcontroller releases the signal.

This simple design of mobile robot is helpful in order to developed our own version of mobile robot. It is an efficient and helpful concept in developing a robot that can roam around especially without the need of human control. It is suitable to different applications like gathering data, search and rescue, safety measures, and other related stuffs that needs support at a very rigid situation.

Basic Mobile Robot with Autotravel Configuration - [Link]

Feb
06

MicroGame – Custom Arduino Compatible Gamming Platform

arduino, atmega32u4, Github, Microcontroller, OLED Comments Off on MicroGame – Custom Arduino Compatible Gamming Platform 

ee5fe36e-a105-11e4-9ca0-8aaffabbccef

Oscar Gonzalez writes:

The MicroGame is an experiment of making a custom portable platform for gamming compatible with Arduino. It’s based on a small monochrome 128×64 pixels OLED from Adafruit and a ATmega32U4 8-bits microcontroller running at 8MHz. All hardware design and game source code is writed from scratch by me and you can find all the files in my Github repository if you want to build your own. You can modify, share and make improvements as you like but do not forget to shoot me and email and show me your work!

MicroGame – Custom Arduino Compatible Gamming Platform - [Link]

 



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook