NTC Project: Blast Off with RocketC.H.I.P.!

This is RocketC.H.I.P.: a C.H.I.P. with specially configured WiFi and the circuitry to control a relay. Take any WiFi device like PocketC.H.I.P., connect to the RocketC.H.I.P. network, and wirelessly blast those rockets off!

I built RocketC.H.I.P. to highlight a few interesting features of C.H.I.P..

First is access point mode, a wireless configuration that allows C.H.I.P. to act like a WiFi router. This is handy for using C.H.I.P. with other devices when out in the field.

The second is utilizing RelayDIP, a custom accessory board for C.H.I.P. made by my coworker Gus. Controlling relays is really handy when working with different power requirements. They allow a small amount of current to control a larger amount, which makes them perfect for use with low power computers like C.H.I.P..

Field_Launch_RocketCHIP

Ready for the moon! Photography by Michael Bucuzzo

For more great C.H.I.P. projects to make or to submit your own build, check out our Hackster.io page.

Note: In the video you’ll see there are some wires involved in this process, that’s because we take safety seriously! In order to wirelessly launch, a wired pin and button must be depressed or the wireless launch command will fail.

TIME: 2-4 hours
COST: $40-70


Parts:

Note: You’ll be modifying the igniter, so you may want to purchase an inexpensive starter kit that includes a rocket, launchpad, and launcher. All the rocket kits I found did not include engines, so expect to buy those separately.


Tools:
You may need additional tools depending on the type of rocket kit select, but here are the basic ones you’ll need.

    • Computer
    • (Optional) Monitor, keyboard, and mouse for C.H.I.P.
    • Soldering iron and solder
    • Wood glue and epoxy
    • Wire cutters


Software Installation & Configuration

You’ll need an internet connection to install the software, so these steps are best done away from the launch field.

If this is your first C.H.I.P. project, make sure to have a monitor, keyboard, and mouse to make it easier to setup your system. Once you have WiFi working, consider ditching the extra accessories and work with C.H.I.P. wirelessly.

screen_wifisettings

1. Connect to C.H.I.P.

There are several ways to interface with the C.H.I.P. command line in headless mode: setups that don’t require a monitor and keyboard. Some require additional hardware like a serial cable, others require that WiFi is setup.

I use SSH (Secure SHell). It’s already setup on C.H.I.P. and all you need to do is determine the IP address of your $9 computer. We’ve documented all the various headless C.H.I.P. options in our docs pages. Once you figure out how you want to connect to C.H.I.P., jump back to the project.

One big reason to consider using SSH is that you’ll have a command line on C.H.I.P. on the same computer your using to read these instructions. That means copy and pasting the commands is a breeze.


2. Update C.H.I.P.
update_RocketCHIP

At the command prompt type the code below and then hit enter.
sudo apt-get update
This updates the information available to the package manager running on C.H.I.P.. It’s important to run this to keep your system aware of new software versions and the libraries necessary for them to run properly.


3. Upgrade C.H.I.P.

Next, upgrade the system.
sudo apt-get upgrade
This command makes sure that all the latest versions gleaned from the update are installed.

Note: To learn more about apt-get and how to install packages on Linux, check out the Debian package management tool here.


4. Install DNSmasq
APTDNSMASQ_RocketCHIP
Use apt-get to install dnsmasq.
sudo apt-get install dnsmasq

DNSmasq is a software package that enables you to setup a small dynamic host protocol (DHCP) network using C.H.I.P..

Note: DNSmasq is cryptic, so it’s always good to brush up with some good documentation. Or you can just copy the config that works for RocketC.H.I.P. in the next step.


5. Configure DNSmasq
DNSmasq_config_RocketCHIP
It’s not enough to simply install dnsmasq, use the text editor nano to write a configuration file.
sudo nano /etc/dnsmasq.d/access_point.conf

Enter the text below into the access_point.conf file for the proper RocketC.H.I.P. configuration.

interface=wlan1
except-interface=wlan0
dhcp-range=172.20.0.100,172.20.0.250,1h

Note: If you feel lost with nano, check out this great tutorial.


6. Static IP Setup

networkinterface_RocketCHIP

Set a static IP address for the access point on wlan1, since the IP address won’t change it will make it easier to find your RocketC.H.I.P. server.

sudo nano /etc/network/interfaces

Populate with the file with following configuration:

source-directory /etc/network/interfaces.d
auto wan1
iface wlan1 inet static
address 172.20.0.1
netmask 255.255.255.0

Note: Static addresses get their name because they don’t change when you reboot. This is opposed to dynamic IP address, which can potentially change on reboot and are typically served by DHCP servers.


7. Double-check IP Configuration
5

Run these commands to double-check the network configuration of C.H.I.P..

sudo ifup wlan1
The ifup uses /etc/network/interfaces, loads the network interfaces in the configuration file, and enables it.

sudo ifconfig wlan1
This command will output the IP address attached to the wlan1 interface. Compare the output of this command to the image above.


8. Restart the DHCP server
dnsmasq_restart_RocketCHIP

sudo /etc/init.d/dnsmasq restart

Note: As mentioned briefly above, DHCP severs assign a dynamic IP address to a client device. In this project, C.H.I.P. will provide any client device requesting an IP address with one between 172.20.0.1 and 172.20.0.254.

DHCP servers also can configure client details like the route for traffic to get to the internet and which domain name servers to use. That stuff is way beyond the scope of configuration you’ll need for RocketC.H.I.P.. Here you’ll just need PocketC.H.I.P. and C.H.I.P. to communicate, not browse the internet.


9. Configure the Access Point on C.H.I.P..
hostapdconfig_RocketCHIP

Edit the hostapd.conf file by typing:
sudo nano/etc/hostapd.conf
Populate the file with:

interface=wlan1
ssid=CHIP_AP
channel=1
ctrl_interface=/var/run/hostapd

Then start hostapd.
sudo hostapd /etc/hostapd.conf

C.H.I.P. will now broadcast an SSID called CHIP_AP. You can test the functionality by using any WiFi enabled device and connecting to the network name CHIP_AP.

Note: There’s no need to authenticate to join the network, though you can enable a password requirement in the configuration file. Check out this bbs post for more info.


10. Write a Systemd HostAPD Configuration

Since you’ll want your access point to work even after a system reboot, edit one more config file.

sudo nano /lib/systemd/system/hostapd-systemd.service

Fill the file with the following text.

And finally run these commands.
sudo update-rc.d hostapd disable
sudo systemctl daemon-reload
sudo systemctl enable hostapd-systemd
sudo systemctl start hostapd-systemd
systemctl status hostapd-systemd

11. Install Git
Apt-get_git_RocketCHIP
Use apt-get to install git.
sudo apt-get install git

Git is a popular version control system used by many open source software projects.


12. Install Node.js
Head over to nodejs.org and follow the Debian and Ubuntu installation instructions.

This project uses Node.js to control GPIO, interface with Relay DIP, and provide a web-based user interface to launch the rocket.


13. RocketC.H.I.P. Software Setup
Follow the RocketC.H.I.P. software installation instructions on the repository page. Once you’ve installed everything with npm, use git to clone the RocketC.H.I.P. software repository.
git clone git@github.com:NextThingCo/rocketchip.git

Note: Git can get confusing, but there are docs that help you gain familiarity. You don’t need to be a git pro to setup RocketC.H.I.P..


13. Run the RocketCHIP Server

On C.H.I.P. change to root by typing the following code.
su -

Start the RocketC.H.I.P. server.

cd /home/chip/rocketchip/
npm start

On a different device, connect to the CHIP_AP WiFi network, launch a web-browser, and point it to 172.20.0.1:3000. Once the server is running, you should see a user-interface like the image below.

RocketUI_RocketCHIP

Note: If you’re having trouble connecting to the 172.20.0.1, make sure the device you are connecting with is on the CHIP_AP WiFi network.


The Physical Build

Relay_DIP

The Relay DIP is able to take a small input current and control a larger output current. This is great when dealing with low power computers like C.H.I.P. And since a relay is basically a switch, consider using the Relay DIP to control a garage door, home lighting, or any other application where a switch is used.

Parts

  • Prototyping board
  • Resistors: 100Ω (x2) and a 1kΩ
  • LED
  • 1N4004 diode
  • 5V relay
  • 2N4403 transistor
  • Male header pins, .1″ pitch
  • Screw block terminal

1. Build Relay DIP
RelayDIP

Solder Relay DIP according to the schematic above. Duplicating Gus’ exact layout of the DIP is not necessary, just make sure it matches the schematic.

Note: If you’re new to reading and building from schematics, check out this helpful guide.


2. C.H.I.P. + Relay DIP = RocketC.H.I.P.

CHIP+DIP=RocketCHIP

The Relay DIP sits atop C.H.I.P. and is controlled by pin XI0–P1 on the U14 rail. To install the DIP, simply line the male header pins of the DIP up with the exterior female rails.

Note: Check out the docs site for a handy GPIO primer.


3. Splice the Ignition Wire

FullSizeRender

Separate the the plastic insulation between the two wires of the ignition system. Then cut only one of the wires and strip its ends. The wire should look like the image above after you’ve completed this step.


4. Wire the DIP

ScrewBlock_RocketCHIP

Insert both wires into separate screw block terminals. It doesn’t matter which wire goes in which terminal, just that there is only one wire per terminal. Tighten down the terminals with a screwdriver.


Get Ready and Launch!

NTC_Doge_Space

Assuming your rocket is ready, grab all your stuff and head to the launch field.

    1. Power C.H.I.P. using a LiPo battery.
    2. Connect to CHIP_AP using PocketC.H.I.P or any WiFi device.
    3. Prep the rocket and connect the ignition clips to the motor.
    4. Clear the area, insert the safety key and depress the ignition button.
    5. Count down! Then press Launch on the RocketC.H.I.P. interface.

Going forward

Launching model rockets is only one use for wireless AP mode. Use C.H.I.P. in AP mode to expand your wireless network outdoors. Since it’s easy to power C.H.I.P. from a battery, extending network range is as simple as placing C.H.I.P. where you want better connectivity. Let us know how you plan to use AP mode or the relay DIP over on the BBS.

About the Author

Posted by

I'm busy writing and editing content at Next Thing Co.

Categories:

Project